Report the release version in released frontend builds - #1040
Open
kaysond wants to merge 1 commit into
Open
Conversation
The release workflow is a workflow_dispatch on master, so GITHUB_REF_NAME is "master" and git.version.sh writes "master#<sha>" into versions.ts. Every scrutiny-web-frontend.tar.gz attached to a release therefore shows the branch instead of the version, which is what the web UI displays. The tag-push path used for the docker images was already correct, so this only affects binary/manual installs. git.version.sh now takes an explicit SCRUTINY_VERSION, and the release workflow passes the version that the bump step just wrote to version.go, failing the job if it cannot read it. Closes #998
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.
Closes #998
What was happening
webapp/frontend/git.version.shderives the version fromGITHUB_REF_NAME/GITHUB_REF_TYPEwhenCIis set. Two workflows call it, and they land on opposite sides of that check:docker-build.yamlruns on a tag push, soGITHUB_REF_TYPE=tagand the version is right.release.yamlis aworkflow_dispatchon master, soGITHUB_REF_TYPE=branchandbuild_frontendwritesmaster#<sha>intoversions.ts.The web UI shows that string, so every
scrutiny-web-frontend.tar.gzattached to a release reportsthe branch. That matches the report: v0.9.1, binaries.
Confirmed against what is actually published:
So the docker images were already fine and only the binary/manual install path is wrong.
The fix
git.version.shtakes an explicitSCRUTINY_VERSIONahead of the existing logic, andrelease.yamlpasses the version that
packagrio/action-bumpr-gohas just written toversion.go— which is theauthoritative version for that release, and is present in the workspace artifact the frontend job
downloads. The step fails the job rather than silently producing a bad string if it cannot read it.
Reading
version.goavoids depending on the action's step output, which the workflow does notcurrently consume anywhere and which would be empty if the action still used the retired
::set-output.Verification
git.version.shexercised in a container for every path:SCRUTINY_VERSION=v0.9.3,CI=true, ref master/branchv0.9.3CI=true,GITHUB_REF_NAME=v0.9.3,GITHUB_REF_TYPE=tagv0.9.3CI=true,GITHUB_REF_NAME=master,GITHUB_REF_TYPE=branchmaster#abcdef1SCRUTINY_VERSION=, tag pushv0.9.4(falls through, no barev)And the workflow's extraction step:
version.goACCEPTED v0.9.2VERSIONconstREJECTEDREJECTEDconst VERSION = "1.10.0"ACCEPTED v1.10.0AI disclosure
Per AI_POLICY.md: this change was written by Claude Code (Opus 5). It diagnosed
the problem, confirmed it against the published v0.9.1 release asset and the published v0.9.1 docker
image, made the change, and ran the checks above in a container; nothing was installed on the host.
The one thing that cannot be exercised outside of GitHub Actions is the release workflow itself, so
the first real proof will be the next release.
That is the extent of the verification behind this PR as opened.