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

Fix ESR check to check for a newer remote branch instead of an increment #3314

Merged
merged 2 commits into from
Feb 11, 2025

Conversation

devinbinnie
Copy link
Member

Summary

Something I realized with the ESR check is that we still might be doing dot releases before the next version is out, and the current check would stop those from being added to the auto-update line.

This PR changes the check to check for the presence of a tag for the final release of the next version of the app. If that exists, we can confirm that there is a newer minor version that we would rather release on the auto-update line and thus we shouldn't add the current ESR to the line.

NONE

@devinbinnie devinbinnie added 2: Dev Review Requires review by a core committer CherryPick/Approved Meant for the quality or patch release tracked in the milestone labels Feb 3, 2025
@devinbinnie devinbinnie added this to the v5.11.0 milestone Feb 3, 2025
@devinbinnie devinbinnie requested review from a team and lieut-data and removed request for a team February 3, 2025 14:36
@devinbinnie devinbinnie requested a review from larkox February 3, 2025 14:37
@devinbinnie
Copy link
Member Author

@amyblais This is a tooling fix to be cherry-picked over before the next dot release. Doesn't need QA testing and isn't required for the v5.11 release.

@lieut-data
Copy link
Member

@devinbinnie, is there some context you can share into how this "auto-updater" works? At first blush, I don't quite understand why we're doing this check at build time instead of at runtime, but I'm probably misunderstanding how it's all used.

@devinbinnie
Copy link
Member Author

@devinbinnie, is there some context you can share into how this "auto-updater" works? At first blush, I don't quite understand why we're doing this check at build time instead of at runtime, but I'm probably misunderstanding how it's all used.

Sure, so it's all using the electron-updater library provided by electron-builder, which has some documentation here: https://www.electron.build/auto-update

For this case, the YML file that describes the update and where its located is published to our releases.mattermost.com endpoint where the releases also exist. However, given that we only have one place to get automatic updates and potentially 2 branches that we might be releasing from at any given time (ie. the latest one and the ESR), we don't want to overwrite the YML file to put users back a version (or have the auto update stop working). So this change just prevents that.

Happy to talk about it more, feel free to message me :)

Copy link
Member

@lieut-data lieut-data left a comment

Choose a reason for hiding this comment

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

Question about major version bumps and how that fits together.

Comment on lines 14 to 17
# If we are on a ESR branch, we don't want to generate the auto-updater yml if there is a newer version
NEXT_VERSION="$(npx semver $STABLE_VERSION -i minor)"
NEWER_VERSION_EXISTS="$(git ls-remote --tags origin v${NEXT_VERSION%.*}.0)"
if [ -e .esr ] && [ ! -z "$NEWER_VERSION_EXISTS" ]; then
Copy link
Member

Choose a reason for hiding this comment

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

What happens when the "next version" is a major version, but NEXT_VERSION doesn't exist as a minor increment?

Copy link
Member Author

Choose a reason for hiding this comment

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

We haven't done a major version in a while, but yes that will likely break.
Will patch.

@devinbinnie devinbinnie added the Do Not Merge Should not be merged until this label is removed label Feb 3, 2025
@devinbinnie devinbinnie added 4: Reviews Complete All reviewers have approved the pull request and removed 2: Dev Review Requires review by a core committer Do Not Merge Should not be merged until this label is removed labels Feb 5, 2025
@devinbinnie devinbinnie merged commit d8ff162 into master Feb 11, 2025
29 checks passed
@mattermost-build
Copy link
Contributor

Cherry pick is scheduled.

@devinbinnie devinbinnie deleted the fix_esr_check branch February 11, 2025 14:10
mattermost-build pushed a commit that referenced this pull request Feb 11, 2025
…ent (#3314)

* Fix ESR check to check for a newer remote branch instead of an increment

* Fix for major version

(cherry picked from commit d8ff162)
@mattermost-build mattermost-build added CherryPick/Done Successfully cherry-picked to the quality or patch release tracked in the milestone and removed CherryPick/Approved Meant for the quality or patch release tracked in the milestone labels Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4: Reviews Complete All reviewers have approved the pull request CherryPick/Done Successfully cherry-picked to the quality or patch release tracked in the milestone release-note-none
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants