Fix breaking-change check: compare against merge-base, scope to PR diff#7467
Open
alfonso-noriega wants to merge 1 commit intomainfrom
Open
Fix breaking-change check: compare against merge-base, scope to PR diff#7467alfonso-noriega wants to merge 1 commit intomainfrom
alfonso-noriega wants to merge 1 commit intomainfrom
Conversation
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced May 5, 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.

WHY are these changes introduced?
The "Breaking change detection" check in
tests-pr.ymlwas reporting false-positive breaking changes whenevermainhad progressed past a PR's branch point. Concrete repro: PR #7466 only edits.github/workflows/tests-pr.yml, yet the check reportspackages/app/src/cli/models/extensions/specifications/type-generation.tsremoved a Zod fieldvalue. The field wasn't removed by the PR — it was added onmainin commitbc9ca2eafter the PR branched, and the script was diffing the PR (which is 7 commits behind) againstmain's current tip.This pattern silently inflates over time: any PR that sits unrebased while schema or manifest edits land on
mainaccumulates phantom breaking-change reports.WHAT is this pull request doing?
Replaces "compare against
mainHEAD" with "compare against the merge-base of the PR head and the base branch", and scopes the schema/manifest scan to files actually present in the PR's diff.workspace/src/major-change-check.jsresolveContext()readsGITHUB_EVENT_PATHand resolves:pull_request/pull_request_review→merge_base_commit.shafrom the GitHub compare API;changedFiles= the compare'sfiles[]merge_group→merge_group.base_sha(already the right baseline);changedFilesfrom the same compare APImainHEAD withchangedFiles=nullso legacy behavior is preservedcheckSchemasandcheckManifestnow accept{changedFiles}. When provided, they skip files outside the diff. The OCLIF manifest check short-circuits entirely ifpackages/cli/oclif.manifest.jsonisn't in the diff (a removed command always shows up there by definition).changedFiles=nullso the scan widens rather than silently skipping potential removals. We never want to mask a real breaking change because of a transient API blip.workspace/src/utils/git.jscloneCLIRepository(tmpDir, {ref})now takes arefso callers can pin the baseline to the merge-base SHA (default stillmain).workspace/src/major-change-check.test.jspull_requestuses merge-base,merge_groupusesbase_sha, compare-API failure widens the scan, missing event payload falls through tomain.How to test your changes?
cd workspace node --test src/major-change-check.test.jsAll 13 tests pass locally, including the new 4. The existing schema-extractor tests are unchanged.
In CI, the false-positive on PR #7466 will disappear once this lands on
main(the check will use the merge-base, which contains the samevaluefield).Post-release steps
None.
Checklist