Skip to content

ci: replace the PR-title bump script with release-please - #65

Merged
mogita merged 2 commits into
masterfrom
chore/release-please
Sep 15, 2026
Merged

mogita merged 2 commits into
masterfrom
chore/release-please

Conversation

@mogita

@mogita mogita commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

Ticket

CHA-2963. Fourth repo, after getstream-go, stream-py (#287) and getstream-ruby (#86).

Problem

The bump script derived the version from the merged PR title and then pushed the bump, the tag, the GitHub Release and the Packagist ping with nothing testing the tree first.

Solution

release-please keeps the bump in a reviewable Release PR, and the suite runs before anything irreversible.

  • release-please-config.json / .release-please-manifest.json, php strategy, manifest seeded at 12.1.0.
  • No last-release-sha here, unlike the other repos. This workflow pushed its bump commit to master, so v12.1.0 is reachable and composer.json, src/Constant.php, the tag and Packagist already agree on 12.1.0.
  • src/Constant.php carries a // x-release-please-version comment. The generic updater has no other anchor, and it must stay on the same physical line as the literal.
  • composer.json is handled by the php strategy's own updater, which writes a bare semver, so "v12.1.0" becomes "12.1.1". Composer accepts both and Packagist derives versions from tags, so the dropped v is cosmetic.
  • changelog-sections overrides the php strategy's default, which makes chore visible and would therefore cut a release on a chore-only window. Every other SDK hides it.
  • The tag and the GitHub Release are irreversible, so a detect job finds the merged Release PR waiting to be tagged and the suite runs before the release half.
  • The test job moves into a reusable run_tests.yml that both ci.yml and the release gate call. ci.yml drops its push trigger: running on push and pull_request ran the suite twice per SHA and raced the integration leg against the Stream app several SDK repos share. check-pr-title stays in ci.yml and still gates the tests.
  • Packagist only needs telling to look now rather than on its schedule, so that step is non-fatal when the credentials are unset, and workflow_dispatch takes resync_tag to re-announce an existing tag.
  • Deletes scripts/release/bump_version.php, and backfills the changelog for 10.1.0 through 12.1.0.

How to verify

Dry-run against a throwaway branch carrying one fix: commit (release-please release-pr --dry-run --trace), now deleted:

  • proposes 12.1.1 from base v12.1.0
  • composer.json v12.1.0 -> 12.1.1
  • src/Constant.php 12.1.0 -> 12.1.1, comment intact
  • CHANGELOG.md section inserted above ## [12.1.0]
  • compare link v12.1.0...v12.1.1, so the tag shape is unchanged

actionlint clean on all three workflows.

Expected on merge: no Release PR, because ci: is a hidden type.

Review instructions

Merge settings are already correct here, unlike the ruby migration: allow_merge_commit: false, allow_rebase_merge: false, squash_merge_commit_title: PR_TITLE, squash_merge_commit_message: BLANK. Nothing outside the diff is needed.

One consequence worth agreeing on: master now has no routine CI. PR runs cover the merge ref, and the release gate covers the commit that gets tagged, but an ordinary merge to master runs nothing afterwards.

The bump script derived the version from the merged PR title and pushed the bump,
the tag, the GitHub Release and the Packagist ping with no test gate in front of
any of it. release-please keeps the bump in a reviewable Release PR instead, and
the suite now runs before the tag.

Unlike the other SDKs this repo needs no last-release-sha: its bump commit was
pushed to master, so v12.1.0 is reachable and composer.json, src/Constant.php,
the tag and Packagist all already agree on 12.1.0.

src/Constant.php carries the version behind a // x-release-please-version comment,
which is the only anchor the generic updater has. composer.json is handled by the
php strategy, which writes a bare semver, so "v12.1.0" becomes "12.1.1" on the
next release. Composer accepts both and Packagist derives versions from tags.

changelog-sections overrides the php strategy's own default, which makes chore
visible and would therefore release on a chore-only window. Every other SDK hides
it, and one change landing as a release in php but not in go is the kind of
difference nobody remembers.

The test job moves into a reusable run_tests.yml that both ci.yml and the release
gate call, and ci.yml drops its push trigger, which ran the suite twice per SHA
and raced the integration leg against the Stream app several SDK repos share.

@mogita mogita left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at 835d49e. One Should Fix, inline on README.md.

Everything else checks out. The php strategy does update composer.json (RootComposerUpdatePackages), its default sections really do leave chore visible so the changelog-sections override earns its place, v12.1.0 is reachable from master so no last-release-sha is needed, the Packagist credentials are repo-scoped rather than environment-scoped so the packagist job needs no environment: ci, master has no required status checks so the job renames break nothing, and run_tests.yml reproduces the old matrix, lint and integration legs unchanged.

One smaller note left out of the inline comment: resync_tag only reaches echo. The Packagist call posts the repository URL and recrawls every tag, so the README line about setting it to a specific tag to re-announce that tag overstates what it does. getstream-ruby and stream-py name the same input publish_tag, if the naming is worth converging too.

Comment thread README.md
…ut honest

RELEASE_SETUP.md described the bump script this PR deletes, as the live flow, and
was the only surviving reference to that file. Its How It Works and Creating a
Release sections now point at the README; the Packagist account, token and
secrets setup stays, since none of that changed.

resync_tag took a tag and never used it. The Packagist API posts a repository URL
and recrawls every tag, so the input is now a boolean resync_packagist and the
README says what it actually does.
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.

1 participant