Repository navigation
ci(tests): diff affected suites against the merge commit's main parent - #1551
Merged
Merged
Conversation
pull_request.base.sha stays at the main commit a PR branch was last synced with, while the checked-out merge commit is built on the current main tip. Diffing the two pulled every main commit merged since into the change set (root package.json, lockfile, turbo.json), so turbo marked all workspaces affected. Use HEAD^1, the exact main tip the PR was merged onto. Co-Authored-By: Claude Opus 5.5 <[email protected]>
hello-jackytruong
referenced
this pull request
in hello-jackytruong/ChatWorkAI
Nov 22, 2026
…t (#1551) pull_request.base.sha stays at the main commit a PR branch was last synced with, while the checked-out merge commit is built on the current main tip. Diffing the two pulled every main commit merged since into the change set (root package.json, lockfile, turbo.json), so turbo marked all workspaces affected. Use HEAD^1, the exact main tip the PR was merged onto. Co-authored-by: Claude Opus 5.5 <[email protected]>
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.
Problem
Test affected workspaces(added in #1522) ran almost every suite on PRs that touch a handful of files — e.g. #1398 changes 8 files but tested 62 workspaces, includingutils,logger,vitest-config.TURBO_SCM_BASEwasgithub.event.pull_request.base.sha, which stays at the main commit the PR branch was last synced with.TURBO_SCM_HEADis the checked-out merge commit, which GitHub builds on the current main tip. Once main moves, the diff includes every main commit merged since (4040 files for #1398), including rootpackage.json,pnpm-lock.yamlandturbo.json— so turbo marks every workspace affected.Fix
Use the merge commit's first parent (
HEAD^1) as the base — that is exactly the main tip the PR was merged onto, so the diff is just the PR's own changes.fetch-depth: 0is already set, so the parent is available.Verification
Dry run against #1398's real merge commit
b243fa0:pull_request.base.sha(e4913ef)HEAD^1(270eb50)(24 is expected: #1398 touches
packages/database, which pulls in its dependents.)Test plan
Test affected workspacesruns and the scope matches the PR's diff🤖 Generated with Claude Code