Sync module.json from git tag in release workflow (fixes endless update loop) - #1
Open
charlesvestal wants to merge 1 commit into
Open
charlesvestal wants to merge 1 commit into
charlesvestal wants to merge 1 commit into
Conversation
The release workflow has two coexisting module.json files (root and
src/) and previously did two related but incomplete things:
1. "Verify version match" only compared the git tag against
`src/module.json`. At the v0.2.3 tag, src/module.json said 0.2.3 so
the check passed.
2. The build step then copied the *root* `module.json` into the
tarball, which was still at 0.2.2 because nothing bumps it.
So the v0.2.3 release shipped a tarball whose bundled module.json
reports 0.2.2. Schwung's Module Store fetches `release.json` (0.2.3),
downloads the tarball, finds module.json claims 0.2.2, decides the
install is still on 0.2.2 → re-offers v0.2.3 on every sync. Endless
update loop.
Changes:
- module.json (root): one-time bump 0.2.2 -> 0.2.3 so master matches
src/module.json and the latest tag.
- .github/workflows/release.yml:
* Replaced "Verify version match" with "Sync module.json version
from tag" — derives VERSION from the tag and writes it into
both module.json + src/module.json before the Docker build.
The tag is now the single source of truth; bumping module.json
before tagging is no longer required.
* The "Commit release.json" step now also writes the same version
into both module.json files on the default branch and commits
them alongside release.json, so the tree stays consistent with
what was tagged.
Note: the v0.2.3 release asset still has module.json=0.2.2 inside (it
was built from the pre-bump tree). Users will keep seeing the update
loop on v0.2.3 until either a v0.2.4 is cut with this workflow change,
or the v0.2.3 asset is re-uploaded from a rebuild.
Reported by a user attempting to update Dissolver via Module Store; the
same publisher-side bug also surfaced for bbgen, davebox, and euclidrum
this week — PRs sent to all four.
3 tasks
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.
Summary
The v0.2.3 release shipped a tarball whose bundled
module.jsonreports 0.2.2, so Schwung's Module Store advertises v0.2.3 (fromrelease.json), downloads the tarball, findsmodule.jsonclaims 0.2.2, decides the install is still on 0.2.2, and re-offers v0.2.3 on every sync — endless update loop.Root cause
The repo has two
module.jsonfiles:module.json(root) — the one the build copies into the tarball (cp /repo/module.json /repo/dist/dissolver/)src/module.json— the one the workflow'sVerify version matchstep compares against the tagAt the v0.2.3 tag,
src/module.jsonsays0.2.3so the check passed. But rootmodule.jsonwas never bumped (still0.2.2), and that's what got packaged. The two files have drifted before too — at presentsrc/module.jsonis0.2.3and rootmodule.jsonis0.2.2.(Aside: there's also a
files/module.jsonreporting1.0.0. Looks unrelated/stale — not touched in this PR.)What this PR does
module.json(root): one-time bump0.2.2→0.2.3so master matchessrc/and the latest tag..github/workflows/release.yml:Verify version matchwithSync module.json version from tag. DerivesVERSIONfrom the git tag and writes it into bothmodule.jsonandsrc/module.jsonbefore the Docker build. The tag becomes the single source of truth.Commit release.jsonstep now also writes the same version into bothmodule.jsonfiles on the default branch and commits them alongsiderelease.json, so the tree stays consistent with what was tagged.After this, the author can cut a release with just
git tag v0.x.y && git push --tags— no need to remember to bump module.json beforehand.Caveat — v0.2.3 release asset
The existing v0.2.3 tarball asset still has
module.json0.2.2 inside. Users will keep seeing the update loop on v0.2.3 until either:Context
Reported by a user attempting to update Dissolver via the Module Store. Three sister bugs hit other community modules this week (
bbgen/ mestela/schwung-breakbeat,davebox/ legsmechanical/schwung-davebox,euclidrum/ filliformes/euclidrum-move) — PRs sent to all four.Test plan
v0.2.3-test1) on this branch and verify:module.jsonreporting the tag versionrelease.jsonon master ends up advertising the tag's versionmodule.json+src/module.jsonon master both end up at the tag's version