Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework and simplify update checking logic #92597

Merged

Conversation

KoBeWi
Copy link
Member

@KoBeWi KoBeWi commented May 31, 2024

Fixes #92593

I have rewritten the update checking logic based on the new format from godotengine/godot-website#858. Unfortunately there was a nasty bug in the previous version that will make users not get notified about beta2 .-.

  • The main simplification is that releases array is no longer iterated; instead only the first (newest) release is checked.
  • Removed UpdateStatus::DEV, which was effectively unused and made logic more complex.
  • Changed [] to get(), so it's safer now (it didn't crash, but it's better to be safe).

Some more testing appreciated. For testing different versions faster, you can replace the code that loads JSON with a custom one that loads a local file: String s = FileAccess::get_file_as_string("somewhere/versions.json");.

@KoBeWi KoBeWi added this to the 4.3 milestone May 31, 2024
@KoBeWi KoBeWi force-pushed the make_update_checker_actually_find_updates branch from 125a894 to 32386d7 Compare May 31, 2024 16:49
@KoBeWi KoBeWi force-pushed the make_update_checker_actually_find_updates branch from 32386d7 to 44593ee Compare May 31, 2024 16:49
@SpockBauru
Copy link

Tested the windows artifact, now it doesn't show anything so... It's working?
How to do the json thing?

@KoBeWi
Copy link
Member Author

KoBeWi commented May 31, 2024

If nothing appears it means there is no new version available.
You can get the official JSON here: https://godotengine.org/versions.json
However testing custom versions requires compiling a custom build.

@SpockBauru
Copy link

Got the branch on my repo (yes, GitHub Desktop works!), compiled, changed VERSION_STATUS to "dev6" in version_generated.gen.h, compiled again and now it seems to work :D
The link correctly opens https://godotengine.org/download/archive/4.3-beta1/

image

@AThousandShips AThousandShips requested review from a team June 6, 2024 14:20
@akien-mga akien-mga self-requested a review June 11, 2024 17:02
Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good, I'll try to do some tests to make sure it works for different build names.

@akien-mga
Copy link
Member

akien-mga commented Jun 12, 2024

Did some quick testing by adding 4.3-beta2, 4.3-stable, and 4.4-dev1 to versions.json, and making a local build named 4.3-beta1. Seems to work as expected.

@akien-mga akien-mga merged commit 0dfe93b into godotengine:master Jun 12, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

@KoBeWi KoBeWi deleted the make_update_checker_actually_find_updates branch June 12, 2024 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Project manager lists unavailiable update for "4.3-4.3"
4 participants