Repository navigation
fix: lease the major tag on the state the release checks ran against - #165
Merged
Merged
Conversation
The lease came from an ls-remote after the fetch and the checks. A release that landed in between became the lease, and the push moved the major tag back from it. The script now reads the remote tags before the fetch, stops when the fetch brings a different major tag, checks the remote again after the prompt, and leases the major tag on the snapshot. The snapshot comes from the remote, not the local tag, because a failed push of a new major leaves a local tag the remote never had. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011baD3hG81A9qbFYrSn1ysE
The check after the prompt took every line ls-remote printed for the major
tag. A git that also lists the peeled commit of an annotated tag
(refs/tags/vN^{}) would give two IDs, and the check would stop every
release of an existing major. It now keeps only the refs/tags/vN line, as
the snapshot before the fetch already does.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011baD3hG81A9qbFYrSn1ysE
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.
Owner: @agoldis
Linear: P-ENG-132
script/releasecould movev2backward over a release that landed after its checks. It read the lease from the remote after the fetch and the version checks. A release published in between became the lease, the checks never saw it, and the push succeeded. This is the same problem a review found in cancel-run-gh-action#21, which copied this script.The lease now comes from what the remote had before the fetch:
git ls-remote --tagsruns beforegit fetch. The major tag's object from that snapshot is the lease. It is empty when the remote has no major tag yet, which means "must not exist".--atomic --force-with-lease=refs/tags/v2:<snapshot>with no+.The snapshot comes from the remote, not from the local tag. A run whose atomic push failed for a new major leaves a local
v2that the remote never had. Leasing on that tag would make every retry fail.How it was tested
bash -nandshellcheck -S warningpass. A harness ran the whole script against throwaway local bare repositories, withghreplaced by a stub. A second clone plays another operator, and agitwrapper lets it publish a release just before a chosen git call:vX.Y.Zpublished, major tag at the releasenls-remotepackage.jsonis behind the release that landedCase 9 against the script before this change: it moves the major tag back over the other release. That is the review's reproduction. All 9 cases pass with this change. The harness is not committed.
🤖 Generated with Claude Code
https://claude.ai/code/session_011baD3hG81A9qbFYrSn1ysE
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.