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

Support dev builds for auto updater #3997

Merged
merged 2 commits into from
Jan 15, 2024

Conversation

HebaruSan
Copy link
Member

@HebaruSan HebaruSan commented Jan 10, 2024

Motivation

  • Fixes land in the dev builds before releases are made, so it would be nice for users experiencing problems to have easier access to them
  • The v1.34.0 release had a lot of big changes that I knew would have bugs, but very few people were trying to test it. Unsurprisingly, we've now done two subsequent fix releases to catch up with the issues that made it into the release. Even if we could find people to help with testing, it would still be cumbersome for them to get the dev builds and stay up to date.

Changes

Now interested users can opt in to the bleeding edge dev builds to get changes as they are merged into the master branch, which will hopefully allow us to receive earlier bug reports and reduce bug counts of releases. To make this work:

  • Now the build piece of CKAN's version string is no longer part of the git commit hash but instead the git commit date in YYDDD format (2-digit year concatenated with 0-padded day of year, e.g. 1.34.5.24009, which we already use for the .rpm and .deb packages), to make dev build versions comparable
    • This is displayed in the CKAN title bar as well, to aid in identifying precise dev builds from screenshots
      image
  • Now when we upload the dev build to S3, we also upload a new version.json file containing the client version (including the above build number) and the dev build's changelog entries, generated by a new Python script in bin/version_info.py:
    {
        "version": "v1.34.5.24010",
        "changelog": "### Bugfixes\n\n- [GUI] Suppress admin user check for URL handler registration (#3996 by: HebaruSan)\n\n### Internal\n\n- [Policy] Fix #3518 rewrite de-indexing policy (#3993 by: JonnyOThan; reviewed: HebaruSan)"
    }
  • Now the core config JSON file has a boolean DevBuilds property, and if it's true:
    • We retrieve that version.json file from S3 to determine whether the dev build is newer than the current client as well as get the changelog
    • We get ckan.exe and AutoUpdater.exe from S3 as well to update to the dev build
  • Now the GUI settings dialog contains a "Use dev builds" checkbox in the Auto-Update section that toggles the DevBuilds setting
    • If you toggle this, it switches to the other kind of build and the labels show the version
    • The install button is enabled if the version is older in case you want to downgrade from dev builds to regular builds (otherwise there would be no way to "undo" switching to the dev builds)
    • The settings dialog is now wider and less tall to make vertical room for this new checkbox, with two groupboxes per row. The large height of this window was an occasional problem previously, so this should be a good change in general.
      image
  • Now if you have auto-updates enabled, GUI will ask you whether you want to use dev builds (but this prompt will only appear once), so existing users can find out about this option:
    image
  • AutoUpdate.cs is moved from Core/Net to Core/AutoUpdate and accompanied by a variety of other autoupdate-related files
  • For CmdLine, the ckan upgrade ckan command now has --dev-build and --stable-release flags that toggle the setting before upgrading. If neither flag is present, then the previous value of the setting is used.

While I was working on the above, I noticed some minor refactoring opportunities:

  • Net has several members that are only used by/for NetAsyncDownloader, which are now moved into that class to reduce the coupling of these two classes:
    • DownloadTarget (which is now also moved to its own file to make it easier to find)
    • DownloadWithProgress
  • NetAsyncDownloader.NetAsyncDownloaderDownloadPart is a long redundant name, so now it's shortened to just DownloadPart as well as moved to its own file to make it easier to find
  • LeftRightRowPanel was accidentally left out of the GUI namespace and is now moved into it
  • The buttons in the YesNoDialog are now auto-sized (GrowOnly mode) and automatically positioned by a LeftRightRowPanel
  • We now pass more of the objects the settings dialog needs so it can eliminate some of its Main.Instance references

Fixes #997 (just before its 10-year anniversary!).

@HebaruSan HebaruSan added Enhancement New features or functionality GUI Issues affecting the interactive GUI Core (ckan.dll) Issues affecting the core part of CKAN Build Issues affecting the build system Cake Issues affecting Cake AutoUpdate Issues affecting the automatic updating labels Jan 10, 2024
@HebaruSan HebaruSan added the In progress We're still working on this label Jan 10, 2024
@HebaruSan

This comment was marked as resolved.

@HebaruSan HebaruSan removed the In progress We're still working on this label Jan 10, 2024
@HebaruSan HebaruSan added the Cmdline Issues affecting the command line label Jan 10, 2024
@HebaruSan HebaruSan force-pushed the feature/auto-nightly-builds branch 11 times, most recently from 7682630 to 95513ca Compare January 15, 2024 02:16
@HebaruSan HebaruSan merged commit 393df1e into KSP-CKAN:master Jan 15, 2024
8 checks passed
@HebaruSan HebaruSan deleted the feature/auto-nightly-builds branch January 15, 2024 03:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AutoUpdate Issues affecting the automatic updating Build Issues affecting the build system Cake Issues affecting Cake Cmdline Issues affecting the command line Core (ckan.dll) Issues affecting the core part of CKAN Enhancement New features or functionality GUI Issues affecting the interactive GUI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to point the CKAN autoupdater to CKAN-nightlies rather than releases
1 participant