Skip to content

[NO-JIRA] Make upstream-sync patch-id validation rename-aware - #48

Merged
johnnymo87 merged 2 commits into
fork-mainfrom
fix/patch-id-rename
Dec 2, 2026
Merged

johnnymo87 merged 2 commits into
fork-mainfrom
fix/patch-id-rename

Conversation

@johnnymo87

Copy link
Copy Markdown
Owner

Description

  • Fixes upstream_sync.py validate() rejecting clean rename-following cherry-picks during publish (bead workstation-6w7i.27.18).
  • When upstream renames a file between base_v and target (e.g. crates/goose-provider-types -> crates/oi-kit-provider-types in upstream chore: rename GDK to oi-kit (Open Intelligence Kit) aaif-goose/goose#13447), git cherry-pick applies fork patches cleanly to the new path, changing the diff's file paths and therefore its git patch-id --stable.
  • validate() now computes git-detected renames between trusted upstream tags refs/tags/{base_v} and refs/tags/{target} (git diff -z -M -l0 --diff-filter=R --name-status) and rewrites only diff file headers (diff --git, --- a/, +++ b/, never hunk bodies) for each known source commit before hashing with git patch-id --stable.
  • Candidate diffs are never rewritten, and renames into .github/workflows/ are excluded from auto-mapping (fail-closed, preserving the GOOSE_SYNC_TOKEN workflow-write trust boundary).
  • Adds unit tests covering renamed files, paths with spaces + header-like hunk lines, foreign commits on renamed files, known hunks redirected to unrenamed files, and renamed workflow files. Verified against a local replay of patched/v1.60.2 onto v1.61.1.

References

  • Bead: workstation-6w7i.27.18 (parent workstation-6w7i.27)
  • Failing runs: 46135262750, 46252384068, 46400395457

@johnnymo87
johnnymo87 merged commit 6e9a98b into fork-main Dec 2, 2026
1 check passed
@johnnymo87
johnnymo87 deleted the fix/patch-id-rename branch December 2, 2026 21:12
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.

1 participant