Skip to content

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

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

mogita merged 3 commits into
masterfrom
chore/release-please

Conversation

@mogita

@mogita mogita commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

Ticket

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

Problem

The bump script derived the version from the merged PR title and then tagged, released and pushed to NuGet from a single job. One unreleased feat: is sitting on master right now because that job failed on 2026-09-10.

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, manifest seeded at 16.0.0. No last-release-sha: this workflow pushed its bump commit to master, so v16.0.0 is reachable and the csproj, the tag and NuGet all agree.
  • .NET has no first-class release-please strategy, so this is simple plus an xml extra-file at /Project/PropertyGroup/Version. The simple strategy also looks for a version.txt, which does not exist here and is a no-op.
  • src/stream-feed-net.csproj is pre-normalized to the serialization the XML updater emits. BaseXml reparses and rewrites the whole document, so without this the first Release PR would carry whitespace churn on four PackageReference lines next to the version bump. dotnet restore passes on the normalized file.
  • The tag, the GitHub Release and the NuGet push 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, on 8.0.x rather than the release workflow's 9.0.x, matching ci.yml and the net8.0 target. STREAM_API_KEY reads vars then secrets, because the two workflows disagreed about which held it and both exist.
  • ci.yml drops its push trigger, which ran the suite twice per SHA and raced the live legs against the Stream app several SDK repos share. pr_title.yml is added to match the other SDKs.
  • NuGet publishing keeps the OIDC login and dotnet nuget push --skip-duplicate, and workflow_dispatch takes publish_tag so an existing tag can be pushed after GitHub retires the original run.
  • Deletes scripts/bump_version.sh, and backfills the changelog for 15.1.0 through 16.0.0.

How to verify

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

  • proposes 16.1.0 from base v16.0.0, which is the unreleased feat: from feat: [FEEDS-1763.1] regenerate OpenAPI client #74 finally shipping
  • src/stream-feed-net.csproj <Version> 16.0.0 -> 16.1.0, and nothing else in the file moves
  • CHANGELOG.md section inserted above ## [16.0.0]
  • compare link v16.0.0...v16.1.0, so the tag shape is unchanged

actionlint clean on all four workflows. dotnet restore clean on the normalized csproj.

Expected on merge: a Release PR for 16.1.0, unlike the other four migrations. ci: is a hidden type, but #74's feat: is still unreleased on master, so there is a real release waiting.

Review instructions

The first Release PR's changelog will list [FEEDS-1763.1] regenerate OpenAPI client twice, once for the merge commit and once for the branch commit under it. That is history from before the repo went squash-only and it cannot be rewritten; later releases will not do it.

Merge settings are already correct: allow_merge_commit: false, allow_rebase_merge: false, squash_merge_commit_title: PR_TITLE, squash_merge_commit_message: BLANK.

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.

@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 8691da5. Two Must Fix, four Should Fix, all inline.

The two that matter: src/Client.cs loses its version bump, because no updater covers it once the script is gone, and the manifest seed is one release behind master after v16.0.1 landed today.

Nothing else blocks. The csproj change is whitespace-only with no dependency movement, run_tests.yml is a faithful move of the old ci.yml steps, the detect gating holds on every path I traced, and master has no required status checks, so the job renames break nothing.

Two smaller things left out of the inline comments: the packing SDK moves 9.0.x to 8.0.x (the TFM stays net8.0, but the toolchain producing the shipped nupkg changes), and run_tests.yml requires STREAM_API_KEY as a workflow_call secret while the steps read vars.STREAM_API_KEY || secrets.STREAM_API_KEY. Both exist today, so it works; retiring the secret in favour of the variable would fail the call at start-up.

Comment thread release-please-config.json
Comment thread .release-please-manifest.json Outdated
Comment thread .github/workflows/release.yml
Comment thread .github/workflows/release.yml
Comment thread .github/workflows/run_tests.yml Outdated
Comment thread .github/workflows/ci.yml Outdated
The bump script derived the version from the merged PR title and pushed the bump,
the tag, the GitHub Release and the NuGet package from one job. release-please
keeps the bump in a reviewable Release PR instead, and the suite gates the tag.

No last-release-sha is needed: this workflow pushed its bump commit to master, so
v16.0.0 is reachable and the csproj, the tag and NuGet all agree on 16.0.0. There
is one unreleased feat on master, from PR #74, whose release run failed on
2026-09-10, so the first Release PR proposes 16.1.0 and finishes that release.

.NET has no first-class release-please strategy, so this uses simple plus an xml
extra-file with an xpath at /Project/PropertyGroup/Version. The simple strategy
also looks for a version.txt, which does not exist here and is a no-op.

The test job moves into a reusable run_tests.yml that both ci.yml and the release
gate call, on 8.0.x rather than the release workflow's 9.0.x, matching ci.yml and
the net8.0 target. STREAM_API_KEY reads vars first then secrets, because the two
workflows disagreed about which held it and both exist.

ci.yml drops its push trigger, which ran the suite twice per SHA and raced the
live legs against the Stream app several SDK repos share, and pr_title.yml is
added to match the other SDKs.

src/stream-feed-net.csproj is pre-normalized to the serialization the XML updater
emits. BaseXml reparses and rewrites the whole document, so without this the first
Release PR would carry unrelated whitespace churn on four PackageReference lines
alongside the version bump.
src/Client.cs carries a second version literal that the deleted bump script kept
in step with the csproj. release-type simple adds no source updater, so nothing
would have bumped it: VersionName feeds the X-Stream-Client header and the
stream.sdk.version log field, and both would have frozen at 16.0.1 while the
package moved on. Covered by an extra-file with the usual marker comment.

Merging #77 fired the old release workflow, which cut v16.0.1 and shipped #74's
feat with it, so the seed and the changelog move to 16.0.1 and the changelog
header no longer promises 16.1.0.

The NuGet push took a glob with --skip-duplicate, which exits 0 and publishes
nothing when the packed version does not match the tag. It now pushes the exact
path and fails when that file is absent, and re-attaches the nupkg to the GitHub
Release, which every release before this one carried and release-please does not.

run_tests.yml gains a Release-configuration test leg. The package is packed from
Release and the old release.yml was the only place that tested it. ci.yml covers
PRs into N.x, and STREAM_API_KEY drops to required: false because the steps fall
back to the repository variable.
@mogita
mogita force-pushed the chore/release-please branch from 8691da5 to e043484 Compare September 15, 2026 13:09
@mogita

mogita commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator Author

Review addressed in e043484. Both must-fix and all four should-fix are fixed, replies on each thread.

Correcting the description, which is now wrong in the way the manifest comment describes: merging #77 fired the old release.yml, still on master and still triggering on a closed PR. It read fix(test): ..., cut v16.0.1, and shipped #74's feat: with it. So expected on merge is no Release PR, not a Release PR for 16.1.0, because the only commits this branch adds are ci: and docs:. The branch is rebased onto 9ce65bd and seeded at 16.0.1; a dry run with one fix: on top proposes 16.0.2.

On the two smaller notes:

Packing SDK 9.0.x to 8.0.x. Deliberate, and worth a second opinion. The TFM is net8.0, ci.yml has always used 8.0.x, and one reusable workflow cannot hold both, so the gate and the pack now agree on the version that matches the target. It does mean the shipped nupkg is produced by a different toolchain than 16.0.1 was. Say the word if you would rather both sides moved to 9.0.x instead.

STREAM_API_KEY declared required: true while the steps read vars first. Dropped to required: false in the same commit, so retiring the secret in favour of the variable no longer fails the call at start-up.

Adding a second Release leg alongside Debug ran the whole live suite twice per
job. HardDeleteChannels then failed four times in a row, once in each leg, on an
async hard-delete task that gets 30 one-second polls; the same test passed twice
at 11:57 and 12:03 today, when a job ran the suite once.

Release is the configuration the package is packed from, so running only that one
answers the original point without doubling the async-task load on an app that
getstream-php shares.
@mogita
mogita merged commit 194a793 into master Sep 15, 2026
5 checks passed
@mogita
mogita deleted the chore/release-please branch September 15, 2026 13:54
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