Use a different action to get latest Zui Insiders release#2852
Merged
Conversation
nwt
approved these changes
Oct 4, 2023
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the days right before publishing the GA Zui v1.3.0 release, I realized that Zui Insiders releases had not been getting published for a while. A peek at a recent attempted release seemed to show what was going on: The "Check If Release Is Needed" seemed to be finding tag
1.2.1-9as the "latest" even though1.2.1-10had been published for weeks. The "Build Zui" would therefore proceed as if it was building1.2.1-10, then it would bail on actually uploading any artifacts, saying:Before the Monorepo changes #2818, Insiders builds were triggered from within the Zui Insiders repo itself, and the logic was simpler such that it always triggered a build with a new version tag every weekday even if nothing had changed in the repo. But as part of the Monorepo changes and Insiders build now being triggered from within the main Zui repo, new logic was introduced to only trigger builds when there were changes, and part of this logic included using an Action to find the build SHA of the "latest" release.
It turns out the Action we had been using for that "latest" check doesn't play nicely with the version naming we use. GitHub's "Releases" page seems guilty of the same, which you can see in my personal repo where I was testing out these fixes: The release ending in
-10appears lower down in the sort order than the one ending in-9. Since it's just atag_namein GitHub's schema, I guess it's sorting as strings in a way that ignores their numeric significance.I looked a little closer at the Action we'd been using and shopped for some alternatives, and indeed, they seem to be trying to be clever by downloading all the releases and then doing some kind of local sorting that still screws us. As it turns out, a straight hit on GitHub's
/repos/{owner}/{repo}/releasesactually does what we want, and thankfully I did find an action that uses it. Here's the proof from my personal test repo that shows the old Action doing the wrong thing and the new one doing what we want.One caveat is that the new Action happens to use the
set-outputcommand that's set to be deprecated, so some warnings are surfaced when it runs. I do see there's an open Issue gregziegan/fetch-latest-release#14 to address this. In a pinch I also can see that writing our owncurl&jqto repeat the essential logic would not be difficult, so if GitHub breaks us I could cook that up in in a pinch.