Skip to content

chore: add script to sync release branches#10394

Merged
paulbalandan merged 1 commit into
codeigniter4:developfrom
paulbalandan:sync-release-branches
Jul 8, 2026
Merged

chore: add script to sync release branches#10394
paulbalandan merged 1 commit into
codeigniter4:developfrom
paulbalandan:sync-release-branches

Conversation

@paulbalandan

Copy link
Copy Markdown
Member

Description
Final piece of the release automation series (#10390, #10391, #10392, #10393). RELEASE.md contained three nearly identical fetch/merge/push blocks that the release manager typed out by hand: merging develop into the next minor branch before the release, fast-forwarding develop from master after it, and updating the next minor branch again.

New script admin/sync-release-branches.php:

  • Usage: php admin/sync-release-branches.php <target> <source> [--push], e.g. 4.8 develop --push (merges develop into 4.8) or develop master --push (merges master into develop).
  • Encodes the sequence once: git fetch upstream, check out <target> (creating it from upstream/<target> if there is no local branch), git merge upstream/<target>, git merge upstream/<source>, and only with the explicit --push flag, git push upstream HEAD. Without --push it stops so the merge result can be reviewed first.
  • Guards before touching anything: the branch names must be develop, master, or X.Y, target and source must differ, the upstream remote must be configured, and the working tree must be clean.
  • On a merge conflict it exits with instructions to resolve, git merge --continue, and push, leaving the merge in progress for the release manager.

Also included:

  • admin/RELEASE.md: the three command blocks collapse to one-line script calls.
  • admin/README.md: script documented.
  • tests/system/AutoReview/SyncReleaseBranchesTest.php: data-provider coverage of the argument validation. The successful path switches branches and merges, so it is not exercised by the test suite. It was instead verified end-to-end in a disposable sandbox (seed repo, bare "upstream", work clone) covering the --push run, the review-first run, the conflict exit, the dirty-tree guard, and the create-missing-local-branch case.

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value (without duplication)
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@paulbalandan paulbalandan force-pushed the sync-release-branches branch from 52fc230 to 043bb4a Compare July 8, 2026 19:36
@paulbalandan paulbalandan merged commit f9c71a7 into codeigniter4:develop Jul 8, 2026
54 checks passed
@paulbalandan paulbalandan deleted the sync-release-branches branch July 8, 2026 20:00
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.

2 participants