chore(release): refactor sync-dev-after-release.sh to PR-based flow#28
Merged
Merged
Conversation
The script currently commits directly to dev at the end of the
backport. That conflicts with this repo's PR-only convention
documented in AGENTS.md ("Squash merges only. PR title becomes the
commit title; PR body becomes the commit message.") and RELEASES.md
("Direct commits to dev or main are not permitted — every change
has a PR number in its squash commit message.").
Refactor the dev-side write step so the same backport now:
- Cuts a chore/sync-dev-after-vX.Y.Z branch off dev (with both local
and remote existence checks; exit 68 on conflict).
- Commits VERSION + CHANGELOG.md backport on that branch.
- Pushes the branch and opens a PR against dev via gh pr create
--body-file (PR body composed at runtime into a mktemp file, with
a trap-cleanup, so the body itself uses the same --body-file
pattern this repo's CLAUDE.md mandates).
- Exits 69 if gh is not on PATH, leaving the local branch in place
so the operator can push and PR by hand.
Idempotency preserved: if dev already matches main on VERSION and
CHANGELOG.md after the file edits, the script switches back to dev,
deletes the empty sync branch, and exits 0 cleanly. The preflight
(tag existence, main ancestry, GitHub Release published-state) and
the post-sync generate-changelog.sh dry-run drift warning are
unchanged.
Mirrors the same refactor landing in brettdavies/xurl-rs-skill PR #7
so the two scripts stay byte-identical going forward.
9 tasks
brettdavies
added a commit
that referenced
this pull request
Jun 4, 2026
…#29) ## Summary PR #28 refactored `scripts/sync-dev-after-release.sh` from direct-commit-to-dev to PR-based flow (cuts a `chore/sync-dev-after-vX.Y.Z` branch and opens a PR), but the accompanying documentation in `RELEASES.md` and `RELEASES-RATIONALE.md` still describes the old direct-commit shape. Bring both docs in sync with the shipped script. No script changes; this PR only updates the prose that lagged the script. ### What changed in `RELEASES.md` § "After publish — sync dev with the release" - Replace "commits the result directly to `dev` as one signed commit (no PR)" with "cuts a `chore/sync-dev-after-vX.Y.Z` branch off `dev` and opens a PR". - Add a pointer to the rationale section explaining the PR-only norm applies here too. - Update the idempotency line from "exits 0 with no commit" to "exits 0 without creating a branch or PR" to match the script's actual short-circuit behavior. ### What changed in `RELEASES-RATIONALE.md` § "Why backport main → dev after publish" - Replace the "lands directly on `dev` (one signed commit, no PR). This is a deliberate exception to the PR-only norm" paragraph with the current behavior: the backport opens a PR, the PR-only norm applies, the mechanical-diff and idempotency arguments justify reviewer spot-check + squash-merge rather than the prior exception-from-norm framing. - Same idempotency-line correction as RELEASES.md. ## Changelog ### Fixed - `RELEASES.md` and `RELEASES-RATIONALE.md` corrected to reflect the PR-based dev-sync flow that `scripts/sync-dev-after-release.sh` has shipped since PR #28. The previous text claimed the backport lands directly on `dev` as one signed commit; the script actually cuts a `chore/sync-dev-after-vX.Y.Z` branch and opens a PR. ## Type of Change - [x] `fix`: Bug fix (non-breaking change which fixes an issue) ## Related Issues/Stories - Architecture: pairs with the PR-based-flow refactor in PR #28 that introduced the staleness; the prose docs lagged the script change. - Related PRs: this is a sibling fix to `brettdavies/agent-skills` PR #12, which lands the same documentation (RELEASES.md + RELEASES-RATIONALE.md + RELEASES-PREFLIGHT.md triad) into the canonical `github-repo-setup` skill template with the corrected PR-based wording from day one. ## Testing - [x] Manual testing completed **Test Summary:** - `markdownlint-cli2 RELEASES.md RELEASES-RATIONALE.md` clean on both files. - No script changes; runtime behavior is unaffected. ## Files Modified **Modified:** - `RELEASES.md` - `RELEASES-RATIONALE.md` ## Breaking Changes - [x] No breaking changes ## Deployment Notes - [x] No special deployment steps required This is a docs-only fix. After merge to `dev`, the file changes will sit on `dev` until the next `release/* → main` cherry-pick brings them onto `main` (per RELEASES.md's branching model). ## Checklist - [x] Code follows project conventions and style guidelines - [x] Commit messages follow [Conventional Commits](https://www.conventionalcommits.org/) - [x] Self-review of code completed - [x] No new warnings or errors introduced - [x] Changes are backward compatible
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
Refactors
scripts/sync-dev-after-release.shto open a PR againstdevinstead of committing directly, aligning the script with this repo's PR-only convention documented inAGENTS.md("Squash merges only. PR title becomes the commit title; PR body becomes the commit message.") andRELEASES.md("Direct commits to dev or main are not permitted").The same refactor is landing in the sibling repo
brettdavies/xurl-rs-skillas PR #7, so both copies stay byte-identical going forward.What changes:
chore/sync-dev-after-vX.Y.Zbranch offdev(with both local and remote existence checks; exit 68 on conflict).VERSION+CHANGELOG.mdbackport on the new branch.devviagh pr create --body-file(body composed at runtime into a mktemp file, with a trap-cleanup, so the body itself uses the same--body-filepattern this repo's CLAUDE.md mandates).ghis not onPATH, leaving the local branch in place, so the operator can push and PR by hand.What is unchanged:
devalready matchesmainonVERSIONandCHANGELOG.mdafter the file edits, the script switches back todev, deletes the empty sync branch, and exits 0 cleanly.origin/mainancestry, GitHub Release published-state, working tree clean.generate-changelog.sh --dry-rundrift warning.Changelog
Changed
scripts/sync-dev-after-release.shrefactored to open a PR againstdevinstead of committing directly, aligning the script with this repo's PR-only convention. Same effective end state per release; the PR-and-merge is now the unit of work, not a direct commit.Type of Change
chore: Maintenance tasks (producer-side release infrastructure refactor)Related Issues/Stories
brettdavies/xurl-rs-skill#7lands the same refactor on the sibling repo.Testing
Test Summary:
shellcheck --severity=style scripts/sync-dev-after-release.shclean.brettdavies/xurl-rs-skill@feat/port-sync-dev-after-release) produced no output; the two copies stay aligned.Files Modified
Modified:
scripts/sync-dev-after-release.sh(+86 lines for the PR-based refactor; total 207 lines)Breaking Changes
The script's invocation surface is unchanged (
./scripts/sync-dev-after-release.sh vX.Y.Z). What changes is where the backport lands: previously a single commit ondev; now a PR againstdevthat the operator merges via the normal CI-gated flow.Deployment Notes
Checklist