You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
AI-3368: publish Kotlin only from a release PR merge - #2092
publish-sdk-kotlin.yml published on any push to main whose gradle.properties held a new non-SNAPSHOT version, so a refactor PR that bumped the version published a release (AI-3368). The release flow stays as it is: the merge of a PR from release-kotlin-X.Y.Z publishes and tags.
How it works
push to main
└─ gh api commits/$GITHUB_SHA/pulls -> merged PRs into main
├─ head = release-kotlin-X.Y.Z -> existing checks (version == branch, newer, unpublished) -> releases + tag
└─ anything else (direct push, other PR) -> ::notice + channel=none
e2f68ff28 (#2072, the 0.7.0 release) is still associated with its PR through the API: head release-kotlin-0.7.0, base main, merged.
Changes
version job: pull-requests: read (this job only), GH_TOKEN, and the PR lookup before the version checks. The old "main with a SNAPSHOT or already-tagged version" branch is gone: every non-release push exits earlier.
Workflow header and sdks/kotlin/README.md say the same, and say how to recover a release merge whose run says nothing is published: re-run all its jobs (the PR lookup can lag right after the merge). Reasoned from the step, not run live.
Behaviour change: a release merge whose version is already tagged now fails already released (red, nothing published) instead of ending green with none.
Closes the comment part of AI-3364: the two environment: release comments name the secrets as GetStream organization secrets that the environment does not limit. The environment: release lines are unchanged; AI-3372 tracks limiting the secrets to the release jobs.
Validation
No local workflow run exists, so the step's own run: block is extracted from the YAML and run with gh (real --jq filter over a fixture) and curl stubbed. actionlint is clean.
Case (push to main unless noted)
Base
Head
PR head release-kotlin-0.8.0, version 0.8.0
releases
releases
PR head feature/refactor, version 0.8.0
releases
none
no PR (direct push)
releases
none
release PR not merged / base not main / head release-kotlin-0.8.0x / SNAPSHOT head
n/a
none
head release-kotlin-0.9.0, version 0.8.0
releases
error (mismatch)
pull_request event, release branch
releases
releases
Mutations (drop the gate, drop merged_at, drop base == main, unanchor or loosen the branch regex, drop exit 0 after none, drop || true, wrong event, keep BRANCH): all 9 killed by the case table.
Unverified: the real workflow on GitHub (the API can lag right after a merge: the lookup then gives none and publishes nothing; unverified), and that the pull-requests: read job permission is enough for commits/{sha}/pulls (documented so; not run).
A push to main published whenever gradle.properties held a new non-SNAPSHOT
version. It now asks the API for the pull request that the pushed commit
merged, and publishes only when its head is release-kotlin-X.Y.Z.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
No actionable comments were generated in the recent review.
Walkthrough
For pushes to main, the Kotlin publishing workflow checks for a merged pull request targeting main from a release-kotlin-X.Y.Z branch. If none matches, it sets channel=none. If one matches, it uses that branch for version checks. Snapshot versions proceed through snapshot validation and timestamping, and versions that match an existing release reach the already-released error path. The README documents the publishing condition and rerun behavior.
Merge Risk: Low · up to 36554
Kotlin releases now publish only when a release-kotlin-X.Y.Z PR merges into main. If another push to main queues while a release run is still pending, that run can be replaced and the release not published. The window is narrow, and the release can be recovered by rerunning the workflow, so the risk is low and the owner should be aware of it.
- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Reviewing files that changed from the base of the PR and between 976c5d9 and 3655443.
Files selected for processing: 1
.github/workflows/publish-sdk-kotlin.yml
Files skipped from review as they are similar to previous changes: 1
.github/workflows/publish-sdk-kotlin.yml
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 3 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1c03f443b merged onto main at bbff046b5 (actionlint clean; the step's run: block run with stubbed gh/curl, including the live API answer for e2f68ff28/#2072, which still resolves to release-kotlin-0.7.0 and publishes).
[Question] R1.2.github/workflows/publish-sdk-kotlin.yml:40: a non-release PR can still set version=X.Y.Z. It now publishes nothing, but the usual release PR (#2072 changes only gradle.properties) then has no diff, so releasing X.Y.Z needs some other change under sdks/kotlin/**. Failing a non-release PR that sets a new non-SNAPSHOT version would prevent that. This is a separate decision, so it goes to a ticket.
Checked and sound: pull-requests: read is on the version job only and the other jobs are unchanged. A failed gh api call fails the step (red). Snapshot pushes and release PR checks never call gh. The new "already released" error on a release merge is reachable only by re-running a successful release run, or by merging a release PR whose own check already failed (no checks are required on main). Nothing is published in either case, and red is right there. 15 mutations of the step: all non-equivalent ones are killed by the case tables.
The reason will be displayed to describe this comment to others. Learn more.
[Should fix] R1.1 If the commit-to-PR lookup comes back empty right after a release merge (API lag), the run ends green. It shows only a ::notice and creates no tag. Nothing here, in the workflow header or in the notice tells the owner what to do. The fix is to re-run all jobs of that run: a re-run keeps GITHUB_SHA, queries the API again, and finds version above the last tag and not published, so it publishes and tags. Please add one sentence here and in the header (publish-sdk-kotlin.yml:12-13), e.g. "If the run of a release merge says Nothing is published, re-run all its jobs". Please also say in the PR body that a release merge whose version is already tagged now fails "already released" where it used to give none.
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 7c35b15: the README (sdks/kotlin/README.md:385-387) and the workflow header (:13-14) say a release merge whose run says nothing is published is recovered by re-running all its jobs, and the notice (:70) names the same re-run. Test: author's run-cases.sh pins the notice text in 6 cases; reverting the added sentence changes those 6 notice lines (killed). Header and README wording are text only, so no mutation applies to them.
The reason will be displayed to describe this comment to others. Learn more.
[Should fix] R1.1 (same finding) Please name the recovery in this notice too, e.g. ... pull request. If it was one, re-run this workflow. The person who just merged a release only sees this line on a green run.
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 7c35b15: the README (sdks/kotlin/README.md:385-387) and the workflow header (:13-14) say a release merge whose run says nothing is published is recovered by re-running all its jobs, and the notice (:70) names the same re-run. Test: author's run-cases.sh pins the notice text in 6 cases; reverting the added sentence changes those 6 notice lines (killed). Header and README wording are text only, so no mutation applies to them.
A release merge's run can find no pull request (the API lags right after the merge), and then publishes nothing. Re-running all its jobs recovers it. Say so in the workflow header, the README and the notice.
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
The workflow comments said the signing key and the repository endpoint live in the release environment. They are GetStream organization secrets, which the environment does not limit; moving them into it is AI-3372.
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
The reason will be displayed to describe this comment to others. Learn more.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
⚠️ Outside diff range comments (1)
Minor · Keep pending release runs in the queue. · publish-sdk-kotlin.yml:31-33
.github/workflows/publish-sdk-kotlin.yml:31-33 Minor · Stability & Availability · Quick win
Keep pending release runs in the queue.
If a main run is active, a release merge waits behind it. A subsequent Kotlin push cancels that pending release run, even with cancel-in-progress: false. (docs.github.com) The later non-release run now selects channel=none, so it does not publish the release. Use a queue that retains pending runs while preserving serialization.
Reviewing files that changed from the base of the PR and between 1c03f44 and 976c5d9.
Files selected for processing: 2
.github/workflows/publish-sdk-kotlin.yml
sdks/kotlin/README.md
Files skipped from review as they are similar to previous changes: 1
.github/workflows/publish-sdk-kotlin.yml
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 4 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
VERDICT: GO (delta round 2, head 3655443, merged onto main bbff046)
Prior findings:
R1.1 (re-run recovery wording, notice, PR body behaviour change): fixed. Header, README and the ::notice all name the re-run. Mutation: removing the notice sentence changes 7 lines of the case output (killed). PR body states the already-released behaviour change.
D1 (environment: release comments): fixed. The org secrets SIGNING_, STREAM_REPO_ are listed for this repo; the repo-level secret list has none of them; the release environment has no branch policy, no protection rules, no environment secrets. Comments now say so. environment: release lines unchanged.
D2 (AI-3372 wording in the two comments): accepted. I could not read AI-3372 from Linear in this run, so its title is unverified.
New findings: none blocking.
Nit (PR body): "Closes the comment part of AI-3364" is not a Linear close keyword pattern (words not adjacent), but rewording it avoids doubt.
Checks: actionlint clean on publish-sdk-kotlin.yml. Author's run-cases.sh and mutate.sh re-run at head: identical outputs, 9/9 mutants killed. #2072 still maps to its PR through the API. Re-run recovery and API lag are reasoned, not run live (stated in the PR body).
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
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.
Why
publish-sdk-kotlin.ymlpublished on any push tomainwhosegradle.propertiesheld a new non-SNAPSHOT version, so a refactor PR that bumped the version published a release (AI-3368). The release flow stays as it is: the merge of a PR fromrelease-kotlin-X.Y.Zpublishes and tags.How it works
e2f68ff28(#2072, the 0.7.0 release) is still associated with its PR through the API: headrelease-kotlin-0.7.0, basemain, merged.Changes
versionjob:pull-requests: read(this job only),GH_TOKEN, and the PR lookup before the version checks. The old "main with a SNAPSHOT or already-tagged version" branch is gone: every non-release push exits earlier.sdks/kotlin/README.mdsay the same, and say how to recover a release merge whose run says nothing is published: re-run all its jobs (the PR lookup can lag right after the merge). Reasoned from the step, not run live.already released(red, nothing published) instead of ending green withnone.environment: releasecomments name the secrets as GetStream organization secrets that the environment does not limit. Theenvironment: releaselines are unchanged; AI-3372 tracks limiting the secrets to the release jobs.Validation
No local workflow run exists, so the step's own
run:block is extracted from the YAML and run withgh(real--jqfilter over a fixture) andcurlstubbed.actionlintis clean.release-kotlin-0.8.0, version 0.8.0feature/refactor, version 0.8.0main/ headrelease-kotlin-0.8.0x/ SNAPSHOT headrelease-kotlin-0.9.0, version 0.8.0Mutations (drop the gate, drop
merged_at, dropbase == main, unanchor or loosen the branch regex, dropexit 0after none, drop|| true, wrong event, keep BRANCH): all 9 killed by the case table.Unverified: the real workflow on GitHub (the API can lag right after a merge: the lookup then gives none and publishes nothing; unverified), and that the
pull-requests: readjob permission is enough forcommits/{sha}/pulls(documented so; not run).🤖 Generated with Claude Code