Skip to content

ci(sdk-tests): cancel superseded runs on the same PR - #1937

Merged
charlie-e2b merged 2 commits into
mainfrom
charlie/sdk-tests-cancel-superseded
Oct 2, 2026
Merged

charlie-e2b merged 2 commits into
mainfrom
charlie/sdk-tests-cancel-superseded

Conversation

@charlie-e2b

@charlie-e2b charlie-e2b commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A new push to a PR now cancels that PR's in-flight SDK Tests run. Only first attempts of pull_request runs share the per-PR group; reruns and workflow_dispatch runs each get their own group, so a rerun of an older commit can't cancel the current head's run and manual dispatches never replace each other.

Why

Rapid pushes to a PR leave several runs overlapping. Each one builds the same shared test templates (e.g. e2b-tags-test) in parallel, across the 7 JS runtime legs and the Python sync and async suites. Only the latest run's result matters, so the earlier runs are wasted CI time and duplicate build load.

Possible follow-ups, for discussion:

  • give the tag tests a per-run template name instead of the shared e2b-tags-test
  • run PR builds against staging only and keep production for main/dispatch (this changes what the required SDK Tests Status check covers)

Verification

  • actionlint .github/workflows/sdk_tests.yml passes.
  • A superseded run reports cancelled in its SDK Tests Status, but the required check is evaluated on the PR's latest head SHA, whose run is unaffected.

🤖 Generated with Claude Code

@changeset-bot

changeset-bot Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 6a3c911

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

devin-ai-integration[bot]

This comment was marked as resolved.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

TASTE.md review: checked T-1 through T-74 — 0 violations. The only change is a concurrency block in .github/workflows/sdk_tests.yml; it touches no packages/js-sdk or packages/python-sdk public API surface, so none of the SDK design principles apply.

@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Package Artifacts

Built from dc9e451. Download artifacts from this workflow run.

JS SDK (e2b@2.52.1-charlie-sdk-tests-cancel-superseded.0):

npm install ./e2b-2.52.1-charlie-sdk-tests-cancel-superseded.0.tgz

CLI (@e2b/cli@2.21.1-charlie-sdk-tests-cancel-superseded.0):

npm install ./e2b-cli-2.21.1-charlie-sdk-tests-cancel-superseded.0.tgz

Code Interpreter JS SDK (@e2b/code-interpreter@2.8.1-charlie-sdk-tests-cancel-superseded.0):

npm install ./e2b-code-interpreter-2.8.1-charlie-sdk-tests-cancel-superseded.0.tgz

Desktop JS SDK (@e2b/desktop@2.4.1-charlie-sdk-tests-cancel-superseded.0):

npm install ./e2b-desktop-2.4.1-charlie-sdk-tests-cancel-superseded.0.tgz

Python SDK (e2b==2.52.0+charlie.sdk.tests.cancel.superseded):

pip install ./e2b-2.52.0+charlie.sdk.tests.cancel.superseded-py3-none-any.whl

Code Interpreter Python SDK (e2b-code-interpreter==2.10.1+charlie.sdk.tests.cancel.superseded):

pip install ./e2b_code_interpreter-2.10.1+charlie.sdk.tests.cancel.superseded-py3-none-any.whl

Desktop Python SDK (e2b-desktop==2.6.0+charlie.sdk.tests.cancel.superseded):

pip install ./e2b_desktop-2.6.0+charlie.sdk.tests.cancel.superseded-py3-none-any.whl

Rapid pushes to a PR left several SDK Tests runs overlapping, each building
the same shared test templates in parallel. Only the latest run matters, so
the earlier ones were wasted CI time and duplicate build load.

Group runs per PR and cancel the in-flight run when a newer push arrives.
workflow_dispatch runs are grouped by ref but never cancelled.
@charlie-e2b
charlie-e2b force-pushed the charlie/sdk-tests-cancel-superseded branch from 4218dd1 to 149c1a2 Compare October 2, 2026 20:37

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks good, straightforward CI config change.

What was reviewed: the new concurrency block in .github/workflows/sdk_tests.yml — group key (workflow name + PR number, falling back to ref) and the cancel-in-progress expression scoped to pull_request events only. Confirmed workflow_dispatch runs are excluded from cancellation as intended (the only candidate issue raised — two manual dispatches on the same ref not cancelling each other — is an accepted, explicitly documented tradeoff, not a bug).

Extended reasoning...

The change adds a single concurrency block (group + cancel-in-progress) to a GitHub Actions workflow file, with no touch to application code, auth, or data handling. The expression logic is standard and correct for the stated goal (dedupe overlapping PR pushes while leaving workflow_dispatch runs uncancelled), the change is small and self-contained, and no outstanding reviewer objections exist in the timeline.

This review covers commit 4218dd1, which is no longer the latest commit on this pull request; later commits are not covered by it.

A rerun keeps its PR number, so an older commit's rerun joined the PR's
group and cancelled the current head's run. Manual dispatches on one ref
shared a group too, and GitHub keeps only one pending run per group, so a
third dispatch silently replaced the second.

Only first attempts of pull_request runs share the per-PR group now; reruns
and dispatches each get a group keyed by run ID.
@charlie-e2b
charlie-e2b merged commit a9e893b into main Oct 2, 2026
75 of 80 checks passed
@charlie-e2b
charlie-e2b deleted the charlie/sdk-tests-cancel-superseded branch October 2, 2026 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants