fix: sync-preview pushes directly on clean merge, PRs only on conflict#1078
fix: sync-preview pushes directly on clean merge, PRs only on conflict#1078notgitika wants to merge 6 commits into
Conversation
|
Reviewed the workflow — a few things worth considering before merge: 1. PRs created by
|
Coverage Report
|
1cdd7ec to
a36a123
Compare
|
1/ is a real issue. unfortunately we need a PAT token or github app token to resolve that |
a36a123 to
4377fed
Compare
Package TarballHow to installnpm install https://github.com/aws/agentcore-cli/releases/download/pr-1078-tarball/aws-agentcore-0.13.1.tgz |
| else | ||
| git merge --abort | ||
| echo "status=conflict" >> $GITHUB_OUTPUT | ||
| # If package.json or package-lock.json conflict, accept main's content |
There was a problem hiding this comment.
sorry if I forgot the answer here, but why we do need to special case package.json/package-lock.json? Does preview have new dependencies we want to manage separately?
There was a problem hiding this comment.
the reason is that the package version itself is different in main and preview
example:
main: 0.13.1
preview: 1.0.0-preview.5
Everything else should ideally be identical
There was a problem hiding this comment.
added inline comment
agentcore-cli-automation
left a comment
There was a problem hiding this comment.
Nice iteration — the GitHub App token addresses the main concern from the prior review and the version-restore logic is much cleaner than just ignoring package.json wholesale. One blocking issue with the dedup search, plus a couple of smaller robustness nits. See inline comments.
cceae68 to
664aff9
Compare
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.
Use agentcore-devx-automation app token to bypass branch protection and push directly when the merge is clean (or only version conflicts). Only creates a PR when there are real conflicts in other files.
- Pass PREVIEW_VERSION via env var instead of string interpolation in node -e scripts (safer against special chars) - Make git add of package-lock.json conditional on file existence to match the earlier -f guard - Replace loose title search for dedup with headRefName prefix filter to avoid false positives from unrelated PRs - Clarify why package.json/package-lock.json are special-cased (preview carries a different version string that needs preserving)
Adds a step to restore schemas/agentcore.schema.v1.json and CHANGELOG.md to preview's versions after merging main. These files are auto-generated during preview releases — schema-check CI rejects direct modifications to schemas/, and CHANGELOG.md tracks preview releases separately.
Aligns with the pattern in PR #1210 and ci-failure-issue.yml.
64b3783 to
7e9f6a1
Compare
Summary
Reworks the sync-preview workflow to push directly to
previewwhen the merge is clean (using theagentcore-devx-automationGitHub App to bypass branch protection), and only creates a PR when there are real conflicts.How it works
preview. No PR.Key changes
actions/create-github-app-tokenwith theagentcore-devx-automationapp to get a token that bypasses branch protectionversionfieldTest plan