fix: sync-preview restores version instead of ignoring files#1203
Closed
notgitika wants to merge 1 commit into
Closed
fix: sync-preview restores version instead of ignoring files#1203notgitika wants to merge 1 commit into
notgitika wants to merge 1 commit into
Conversation
Instead of keeping preview's entire package.json/package-lock.json (which discards new deps, scripts, etc. from main), accept main's content and surgically restore only the version field to preview's value after merge.
agentcore-cli-automation
approved these changes
May 11, 2026
agentcore-cli-automation
left a comment
There was a problem hiding this comment.
Reviewed the workflow changes end-to-end. The approach is a clear improvement over #1078 — surgically restoring only the version field preserves new deps/scripts from main instead of discarding them, and splitting branch-creation/merge/PR-creation into distinct steps reads much better.
Verified the tricky bits:
git add -A+git commiton conflicted files does stage and commit files with conflict markers as intended (confirmed locally), so the conflict-PR path produces a branch with markers for humans to resolve.git checkout --theirs+git addcorrectly removes package.json/package-lock.json from the unmerged set, so the subsequent--diff-filter=Ucheck only sees remaining real conflicts.- The version-restore node snippet reliably runs in both the clean-merge (main bumped version with no conflict) and conflict-resolved-by-theirs cases.
- Concurrency group + pre-merge
Check for existing PRstep correctly gates against duplicate sync PRs.
No blocking issues. LGTM.
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.
Summary
Improves on #1078 — instead of
git checkout --oursto discard main's entire package.json/package-lock.json (which throws away new deps, scripts, etc.), this approach:versionfield back to preview's valueCHANGELOG.md and schemas merge normally from main — no special handling needed since they're autogenerated/diverge naturally.
Also keeps the structural improvements from #1078:
Test plan
yaml.safe_load)