Keep the stored release commit when HEAD is behind it - #139
Merged
Conversation
A sync from a rolled-back checkout used to write its older HEAD onto an existing release, rewinding the pipeline's scan baseline. The next sync then re-scanned the range up to the current HEAD and re-attached issues that had already shipped. Before syncing, compare HEAD to the newest stored release anchor from recentReleasesByAccessKey. When HEAD is strictly behind it, omit commitSha from the sync input and log that the release commit is left unchanged. The scan range itself is unaffected; --base-ref keeps controlling it without dragging the anchor backwards as a side effect. Requires server support for a nullable commitSha on ReleaseSyncInputBase. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
Omitting commitSha broke continuous pipelines, which identify releases by it. Always send the checked-out commit and set preserveStoredCommitSha when HEAD is behind the stored anchor; the server applies it to scheduled pipelines only. The field is only sent when set, so normal syncs remain compatible with older servers. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The field was dropped from the payload when false to tolerate servers without it. The server change deploys before this releases, so the compatibility gate is unnecessary. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The candidate list is ordered by activity, not ancestry, so a release from a divergent train could rank first. Ancestry to it cannot be established, the check failed open, and the sync could still replace the syncing version's stored commit with the rollback HEAD. When a version is supplied and a candidate carries it, that release's commit alone decides preservation, mirroring the scan-base rule that prefers the syncing version's release. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
RomainCscn
approved these changes
Sep 1, 2026
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.
Before syncing, compare HEAD to the stored release anchor from
recentReleasesByAccessKey— the syncing version's own release when one carries it, else the newest anchor. When HEAD is strictly behind it — a rollback — sendpreserveStoredCommitSha: trueso the server keeps the release's stored commit, and log that the release commit is left unchanged.--base-refkeeps controlling the scan range; it no longer drags the anchor backwards as a side effect.Requires linear/linear-app#89072 (
preserveStoredCommitShaonReleaseSyncInputBase) to deploy before this releases.Towards #138
🤖 Generated with Claude Code