Skip to content

Release automation tool#2

Open
OleksiiBulba wants to merge 6 commits into
Micro-PHP:2.xfrom
OleksiiBulba:2.x
Open

Release automation tool#2
OleksiiBulba wants to merge 6 commits into
Micro-PHP:2.xfrom
OleksiiBulba:2.x

Conversation

@OleksiiBulba
Copy link
Copy Markdown
Member

Summary

This MR syncs the latest release-tooling improvements from origin-public/2.x into micro-php/2.x.

The main focus is hardening the multi-repo initialization and release flow for Micro PHP packages, making the tooling safer, more
explicit, and easier to operate for first releases and ongoing package releases.

What Changed

  • improved init flow for package repositories
  • added cleanup tooling to undo nested package git initialization
  • hardened release automation with safer preflight checks
  • added direct release mode for publishing from the current branch without PRs
  • added forced release support for cases where a tag/release is needed even without new commits
  • added dry-run and status modes for release planning
  • documented the scripts workflow
  • added automated Python test coverage for the scripts

Key Improvements

Init flow

  • support --from-branch fallback when the target branch does not exist in package repos
  • support --push-missing-branches as an opt-in
  • avoid destructive defaults during initialization
  • improve handling of freshly initialized package repos inside the monorepo

Release flow

  • require explicit branch inputs
  • validate GitHub CLI auth before package processing
  • preflight remote branch existence before running release actions
  • preflight release tags before attempting publication
  • fail early on dirty worktrees for prepare/direct-release flows
  • fail the overall run when any package fails
  • recover from the case where a PR is already merged but the release was not created
  • generate release notes in a way that matches squash-merge flow
  • support --dry-run and --status
  • support --release-current for tag/release creation directly from the base branch
  • support --force-release for first-line releases and other explicit no-commit release cases

Tooling and docs

  • add scripts/clean.py
  • extend Makefile targets for preview and direct release flows
  • add scripts/README.md with release instructions
  • add Python test suite and workflow coverage for the scripts

Why

The previous release flow was too easy to misuse:

  • destructive branch/reset behavior during init
  • incomplete preflight validation
  • PR/release state mismatches
  • no clean way to perform a first release for an existing branch line
  • limited operator visibility before mutating repositories

This MR makes the release tooling much more predictable and operationally safe.

Testing

  • added unit/integration-style Python tests for script behavior
  • verified script test suite passes locally
python -m pytest tests/python -q

Notes

This branch is ahead of micro-php/2.x by 5 commits and includes the release-tooling changes needed to support the first 2.x
package releases, including 2.0.0-alpha1.

- sync init_repository with origin and add init fallback branch handling

- harden release flow with explicit branches, auth validation, remote-branch preflight, clean-worktree checks, and non-zero failures

- add missing-release recovery, squash-friendly release notes, and dry-run/status modes

- add make targets and cleanup/docs for init, release preview, and clean

- add Python test suite and GitHub Actions workflow for script coverage
- Updated the --help test coverage so it only applies to scripts that are meant to be run directly.

  The test in micro-dev/tests/python/test_scripts.py now checks only:

  - clean.py
  - fix.py
  - init.py
  - release.py

  Helper modules like git_shell.py, github.py, git_commands.py, packages.py, packagist.py, and shell.py are no longer part of that
  --help contract.
- Implemented tag preflight inside the existing release flow.
- Added --force-release to scripts/release.py.
- Added direct-release Make targets with optional FORCE=1 in micro-dev/Makefile.
@OleksiiBulba OleksiiBulba requested a review from Asisyas March 20, 2026 06:45
@OleksiiBulba OleksiiBulba self-assigned this Mar 20, 2026
@OleksiiBulba OleksiiBulba added the enhancement New feature or request label Mar 20, 2026
…from all framework packages;\n- Added script for merging composer requirements from all framework packages to root composer.json;\n- Updated spiral/roadrunner to ^2025.1.13 version;\n- Normalized composer.json;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant