Repository navigation
AI-3639: let client SDKs CI runs on main finish - #2283
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
kanat
left a comment
There was a problem hiding this comment.
Round 1 review. The expression is right for both triggers the workflow has (push to main and pull_request, client-sdks.yml:3-30; no workflow_dispatch, merge_group or schedule). Queue behaviour is fine: one pending run per group, a newer one replaces it, so the newest main commit always runs. actionlint shows only the known xcode-27 warning. Title and body follow the pr skill. swift and dart were still pending when I read the checks.
One finding blocks: R1.1 (group key shares main's group with a PR whose head branch is main).
Verdict: NO-GO (1 Should fix).
| cancel-in-progress: true | ||
| # A run on main is never cancelled: only a finished push run saves the Swift package cache (#2235, | ||
| # #2225), and a newer push queues behind it. A pull request run still cancels the one before it. | ||
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} |
There was a problem hiding this comment.
[Should fix] R1.1 A run on main can still be cancelled: the group key is github.head_ref || github.ref_name (line 259), so a pull request whose head branch is named main (a fork's main; the repo is public) has head_ref == main and lands in the same group as the push runs on main. GitHub applies the cancel-in-progress of the run that enters the group, so that PR's run (true here) cancels the running main run and replaces its pending one, which is the starvation this PR removes and contradicts the comment above ("A run on main is never cancelled"). Same for every later push to that PR. Not new, but this PR claims to close it. Fix: put the event in the key, group: ci-client-sdks-${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref_name }}, so a push group and a pull_request group never meet. Cancellation semantics are from the docs (https://docs.github.com/en/actions/using-jobs/using-concurrency); I did not run a fork PR to show it live.
There was a problem hiding this comment.
Fixed in ad0528e: the group key is now ci-client-sdks-${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref_name }}, so a fork's main PR gets …-pull_request-main, never main's …-push-main. actionlint shows only the xcode-27 warning; the PR body table is updated.
A pull request from a fork's main must not share main's push group. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kanat
left a comment
There was a problem hiding this comment.
[reviewer R2] GO: delta round 2, head ad0528e, merged onto origin/main e416613.
PRIOR
- R1.1 (a fork PR from branch
mainjoined main's push group): fixed. The pre-fix key gives both the same group (mutant M1 fails); the head key gives…-push-main(cancel false),…-pull_request-Xand…-pull_request-main(cancel true), as in the fixer table.
NEW FINDINGS (both Nit, not blocking; inline)
- R2.1 (client-sdks.yml:261): "A run on main is never cancelled" overstates. A pending main run is still replaced by a newer push (GitHub docs, using-concurrency); only a running run is protected.
- R2.2 (client-sdks.yml:260): the PR group uses the branch name, so a fork PR and a same-repo PR with the same branch name cancel each other. Pre-existing and rare; the PR-number form fixes it.
Checks: actionlint shows only the known xcode-27 warning. The new key changes main's group for one run only; nothing is cancelled by it. Mutations: 5 run, 1 survived (equivalent). Details: ~/.claude/ship-task/Vision-Agents/AI-3639/pr/reviewer-2.md. CI was read once, not waited on: run 45249844670 was still in progress.
| cancel-in-progress: true | ||
| # The event is in the key so a pull request from a fork's `main` never joins main's push group. | ||
| group: ci-client-sdks-${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref_name }} | ||
| # A run on main is never cancelled: only a finished push run saves the Swift package cache (#2235, |
There was a problem hiding this comment.
[R2.1] Nit: "A run on main is never cancelled" overstates. A pending main run is still replaced by a newer push (GitHub docs: "any existing pending job or workflow in the same concurrency group will be canceled"), and a run can be cancelled by hand. Fix: "A run on main that is running is not cancelled by a newer push; a newer push replaces only a pending one (#2235, #2225)."
There was a problem hiding this comment.
Fixed in fe13b24: the comment now says a running run on main is not cancelled by a newer push, and a newer push replaces only a pending one. Comment text only; actionlint shows only the known xcode-27 warning.
| group: ci-client-sdks-${{ github.workflow }}-${{ github.head_ref || github.ref_name }} | ||
| cancel-in-progress: true | ||
| # The event is in the key so a pull request from a fork's `main` never joins main's push group. | ||
| group: ci-client-sdks-${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref_name }} |
There was a problem hiding this comment.
[R2.2] Nit (pre-existing): the PR group uses github.head_ref, the branch name. A fork PR and a same-repo PR with the same branch name (e.g. feature-x) both get …-pull_request-feature-x, so one cancels the other's run. Optional fix, keyed by PR number: ${{ github.event_name }}-${{ github.event.pull_request.number || github.ref_name }} in place of the event and head_ref parts.
The comment said a run on main is never cancelled. A pending main run is still replaced by a newer push; only a running one is protected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Why
client-sdks.ymlcancelled in-progress runs on every ref, main included. Since #2235 only a push to main saves the Swift package cache, and since #2225 a cancelled run saves nothing. An empty-cache swift job takes about 21 minutes, so when main gets a push faster than that, no run finishes and the cache is never saved. After #2225 merged, main runs 45229507749 (17:36 UTC) and 45232221644 (17:51 UTC) were cancelled by the next push; run 45233683223 finished and savedswiftpm-…onrefs/heads/main(gh api repos/GetStream/Agents/actions/caches?key=swiftpm-). AI-3639.How it works
cancel-in-progressis an expression, which GitHub allows (docs: "can specifycancel-in-progressas an expression", example${{ !contains(github.ref, 'release/')}}). It is nowgithub.event_name == 'pull_request'.…-push-mainfalsependingjob or workflow in the same concurrency group will be canceled")…-pull_request-Xtruemain…-pull_request-maintrueThe workflow has only
pushandpull_requesttriggers (client-sdks.yml:3-30), so no other event reaches the expression.Validation
actionlint .github/workflows/client-sdks.yml: only the knownxcode-27runner-label warning.run_tests.yml:68saves a mypy cache only on push, andci-go,ci-python,ci-sdks,integration,python-versions,run_testscancel on main too. Not changed here; a cancelled mypy-cache run only costs a cold mypy cache, not 21 minutes.CI (client SDKs)on main should endcancelled, andgh api repos/GetStream/Agents/actions/caches?key=swiftpm-should list an entry onrefs/heads/main.🤖 Generated with Claude Code