Skip to content

Add --base-ref to manually override scan base#91

Merged
RomainCscn merged 4 commits into
mainfrom
romain/lin-71182-first-sync-issue-override-the-initial-sha
May 21, 2026
Merged

Add --base-ref to manually override scan base#91
RomainCscn merged 4 commits into
mainfrom
romain/lin-71182-first-sync-issue-override-the-initial-sha

Conversation

@RomainCscn
Copy link
Copy Markdown
Collaborator

@RomainCscn RomainCscn commented May 20, 2026

--base-ref scans <ref>..HEAD, applies existing path filters, and stores HEAD as the new release baseline.

When provided, it skips automatic release baseline selection for that run. This covers the original first-sync use cases, where no useful prior release commitSha exists yet, and also workflows where the desired lower bound is not a prior release commitSha, such as hotfix branches whose release delta should start at the fork point from an integration branch.

Usage examples:

First-time monorepo onboarding:

linear-release sync --base-ref=<commit-before-backfill> --include-paths="apps/api/**"

Rewritten repo migration:

linear-release sync --base-ref=<new-repo-baseline> --include-paths="apps/api/**"

Hotfix branch delta:

linear-release sync --base-ref="$(git merge-base origin/develop HEAD)"

--base-ref is advanced range control: the ref must be an ancestor of HEAD, and users intentionally own the selected range.


Fixes #88.

@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 20, 2026

LIN-71182

@RomainCscn RomainCscn force-pushed the romain/lin-71182-first-sync-issue-override-the-initial-sha branch from d8c47d3 to 1d500d9 Compare May 20, 2026 15:22
Copy link
Copy Markdown

@linear-code linear-code Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. The --base-ref escape hatch is correctly guarded (throws when a reachable baseline already exists), the inspectSingleCommit: false path properly handles baseRef == HEAD as an empty range, and the release-at-zero-commits behavior for baseline establishment is both tested and intentional. No blocking issues found.

@RomainCscn RomainCscn changed the title Add --base-ref to manually override scan base for initialization and migration flows Add --initial-base-ref to manually override scan base for initialization and migration flows May 21, 2026
@RomainCscn RomainCscn requested a review from axelniklasson May 21, 2026 07:24
@RomainCscn RomainCscn marked this pull request as draft May 21, 2026 07:46
@RomainCscn RomainCscn changed the title Add --initial-base-ref to manually override scan base for initialization and migration flows Add --base-ref to manually override scan base May 21, 2026
@RomainCscn RomainCscn marked this pull request as ready for review May 21, 2026 08:18
@RomainCscn RomainCscn requested a review from mwolting May 21, 2026 08:22
Copy link
Copy Markdown
Collaborator

@axelniklasson axelniklasson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! We should add this and any other missing arguments if there are any to https://github.com/linear/linear-release-action as well to ensure parity between the action and the CLI.

Copy link
Copy Markdown
Collaborator Author

Of course, PR incoming!

@RomainCscn RomainCscn enabled auto-merge (squash) May 21, 2026 08:35
@RomainCscn RomainCscn merged commit ec08798 into main May 21, 2026
10 checks passed
@RomainCscn RomainCscn deleted the romain/lin-71182-first-sync-issue-override-the-initial-sha branch May 21, 2026 08:35
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.

First sync issue - override the initial SHA

3 participants