fix: stop treating the floating major tag as a GitHub release#17
Merged
Conversation
A standalone `v1` GitHub Release (uploaded out-of-band when PR #10 force-pushed the v1 git tag and triggered the old release-action.yml) was still pinning `@v1` consumers to stale v1.0.1-era assets: the resolver found /releases/tags/v1 -> 200 and returned `v1`, downloading the pre-coverage-install binary that made PHPUnit report "No code coverage driver available / No tests executed". Codify the contract that the vN git tag is a `uses:` convenience and must never have a matching release: - src/index.js:resolveReleaseTag skips /releases/tags/<ref> for floating-major refs (/^v\d+$/), resolving through /releases/latest + major-match. Also propagates 404 as an error for specific-version pins (/^v\d+\.\d+\.\d+/) instead of silently substituting latest (which violated pin reproducibility). - release-please.yml adds a defense-in-depth step that deletes any standalone vN release after each release cut. - Unit tests cover the regression directly (ignores a standalone floating-major release) plus the pin-respect tightening. - CLAUDE.md documents the release-artifact contract. Post-merge cleanup (out of band): `gh release delete v1 v1.0.1 v1.1.0` to purge the stale + empty-asset releases while keeping the git tags.
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
After PR #15 + v1.1.1,
@v1consumers were still hitting the stale binary. Root cause: a standalonev1GitHub Release (uploaded when PR #10 out-of-band force-pushed the v1 git tag and triggered the oldrelease-action.yml) hijacksresolveReleaseTag— it finds/releases/tags/v1→ 200 → returnsv1→ downloads the v1.0.1-era binary without PR #14's coverage-driver install. PHPUnit then reports "No code coverage driver available / No tests executed".The intent of the existing resolver is already that
@v1resolves via/releases/latest+ major-match (seeresolveReleaseTag falls back to latest for floating major tagtest). The bug is that nothing enforced it. This PR encodes the contract in code, workflow, and docs.Architectural contract (now codified)
Changes
src/index.js:resolveReleaseTag: floating-major refs (/^v\d+$/) skip/releases/tags/<ref>entirely and resolve via/releases/latest+ major-match. Specific-version refs (/^v\d+\.\d+\.\d+/) that 404 on lookup now throw instead of silently substitutinglatest(pre-existing bug: violated pin reproducibility)..github/workflows/release-please.yml: new Ensure no standalone major-tag release exists step after the major-tag move — belt-and-braces cleanup if av1release ever appears (shouldn't post-PR fix: build and upload release assets from release-please workflow #15, but cheap insurance).test/unit/index.test.js: 1 existing test strengthened (proves resolver doesn't call/releases/tags/for floating major), 2 new tests — ignores a standalone floating-major release (direct regression test for today's incident) and rejects when a specific-version release is missing.CLAUDE.md: new Release Engineering section documenting the contract.Post-merge cleanup (out of band, with your OK)
Git tags preserved in all three cases.
@v1then resolves via latest-major-match tov1.1.1.Test plan
npm test— 15/15 passmake check— greenactionlint— cleanv1,v1.0.1,v1.1.0GitHub releases