Skip to content

Keep the stored release commit when HEAD is behind it - #139

Merged
axelniklasson merged 4 commits into
mainfrom
axel/lin-83611-forward-only-anchor
Sep 1, 2026
Merged

Keep the stored release commit when HEAD is behind it#139
axelniklasson merged 4 commits into
mainfrom
axel/lin-83611-forward-only-anchor

Conversation

@axelniklasson

@axelniklasson axelniklasson commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

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 — send preserveStoredCommitSha: true so the server keeps the release's stored commit, and log that the release commit is left unchanged. --base-ref keeps controlling the scan range; it no longer drags the anchor backwards as a side effect.

Requires linear/linear-app#89072 (preserveStoredCommitSha on ReleaseSyncInputBase) to deploy before this releases.

Towards #138

🤖 Generated with Claude Code

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>
@linear-code

linear-code Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

LIN-83611

axelniklasson and others added 3 commits September 1, 2026 11:16
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>
@axelniklasson
axelniklasson merged commit bf53b8e into main Sep 1, 2026
11 checks passed
@axelniklasson
axelniklasson deleted the axel/lin-83611-forward-only-anchor branch September 1, 2026 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants