Ensure stale branch are not taken into account by --include-paths by RomainCscn · Pull Request #104 · linear/linear-release · GitHub
Skip to content

Ensure stale branch are not taken into account by --include-paths#104

Merged
RomainCscn merged 2 commits into
mainfrom
romain/lin-74544--include-paths-over-attributes-issues-from-stale-branch
Jun 9, 2026
Merged

Ensure stale branch are not taken into account by --include-paths#104
RomainCscn merged 2 commits into
mainfrom
romain/lin-74544--include-paths-over-attributes-issues-from-stale-branch

Conversation

@RomainCscn

Copy link
Copy Markdown
Collaborator

Fix: --include-paths over-attributes issues from stale-branch merges (closes #102)

When you scope a release to a folder, the tool was crediting it with issues from branches that never touched that folder.

Why: to decide if a merge belongs to the folder, it checked whether the folder "changed" across the merge (--full-history, from #62). But a stale branch — cut from old main and merged late without rebasing — makes the folder look changed because of other work that landed on main meanwhile, not because of the branch itself. So the merge slips through the filter and its branch-name issue key gets attributed to a folder it never touched.

Example

Web release runs sync --include-paths="apps/web/**".
ENG-2100 is a backend-only branch, merged after the web app moved on:

  • Before: web release lists ["ENG-2100"] ❌ (backend issue on the web release)
  • After: web release lists []

Fix

Before crediting a merge, ask git what the merge itself changed in the folder (git diff <merge> vs. the commit just before it, limited to the folder):

@linear-code

linear-code Bot commented Jun 9, 2026

Copy link
Copy Markdown

@RomainCscn RomainCscn requested a review from axelniklasson June 9, 2026 07:40
Comment thread src/git.ts Outdated
const branchName = extractBranchNameFromMergeMessage(message) ?? extractBranchName(rawDecorations);

return { sha: sha.trim(), branchName, message };
// Drop grafted/shallow-boundary parents so a shallow clone doesn't misreport a

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What is a grafted/shallow-boundary parent? Having some trouble wrapping my head around this.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Made this clearer!

Comment thread src/git.test.ts Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Big nit: Could we drop references to #62 here and in the comments? Ideally we keep comments and tests self explanatory so we don't have to link out to a GitHub PR.

@RomainCscn RomainCscn merged commit bbeffdf into main Jun 9, 2026
10 checks passed
@RomainCscn RomainCscn deleted the romain/lin-74544--include-paths-over-attributes-issues-from-stale-branch branch June 9, 2026 08:27
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.

--include-paths over-attributes issues from stale-branch merges (follow-up to #62)

2 participants