[ENG-1012] docs: cancelling runs from CI - #60
Conversation
A cancelled CI job stops reporting mid-run, so the run stays in progress until the project's inactivity timeout. `currents cancel` cancels it using the record key the job already holds, on any CI provider. - new page under @currents/cmd, listed in the subcommands and in SUMMARY - a "Cancelling Runs from CI" section on the cancel-run page, above the API and GitHub Action sections - a note on the GitHub Action section, since that route needs an API key
📝 WalkthroughWalkthroughThe documentation adds guidance for cancelling Currents runs when CI workflows are cancelled, documents the ChangesCI Run Cancellation
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
The GitHub Actions section had no landing page and no cancellation article, and the cancellation examples still required an API key plus the GitHub run id and attempt. - new "Cancel Runs on Workflow Cancellation" article: the `if: cancelled()` step, both credentials, and how it pairs with `cancel-in-progress: true` - the GitHub Actions README now lists what is in the section - the action examples in cancel-run.md use the record key the job already has, with the API key kept as a second option
SUMMARY.md conflicted because this branch had rewritten every list marker from `*` to `-`. Kept main's markers, which is what GitBook writes, and re-added the two new entries on top.
`currents cancel` now accepts --run-id / CURRENTS_RUN_ID as well as the CI build id. Also state what happens when a job does not set CURRENTS_CI_BUILD_ID: the generated CI build id includes the test framework, so a cancelling step that rebuilds the value from environment variables does not find the run. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QYks4ynK7rmCmDuVTVuo1b
Points the input list at the action's README, which is where it is maintained, rather than at this page. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
ci-build-id.md recommends `${{ github.repository }}-${{ github.run_id }}-${{ github.run_attempt }}`, and the other cancellation pages already use it. Also moves the GitLab CI build id to the pipeline level, where the reporting job reads the same value.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Both the command and the action accept either identifier; the intros only mentioned the CI build ID. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@currents/cmd 1.10.0 is the first release with the command. npx resolves the latest version, so this only matters for a pinned one.
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@dashboard/runs/cancel-run.md`:
- Line 99: Update the “Cancelling with an API key” section heading in the
cancellation documentation from H4 to H3 so it correctly follows the surrounding
H2 hierarchy.
In `@getting-started/ci-setup/github-actions/cancel-runs.md`:
- Around line 27-35: Update the cancel-run-gh-action@v1 examples in
getting-started/ci-setup/github-actions/cancel-runs.md (lines 27-35) and
dashboard/runs/cancel-run.md (lines 68-89 and 99-127) to use the required
api-token, github-run-id, and github-run-attempt inputs. Remove misleading
no-input, record-key, and run-id usage, retaining project-id and ci-build-id
only as optional inputs where needed.
In `@resources/reporters/currents-cmd/currents-cancel.md`:
- Line 13: Update the section headings in currents-cancel.md—Usage, Identifying
the run, Cancelling from GitHub Actions, Cancelling from other CI providers, and
Notes—from H3 to H2 so they consistently follow the page’s H1 structure.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: fccc32ee-2200-4031-85c2-175733d9761f
📒 Files selected for processing (6)
SUMMARY.mddashboard/runs/cancel-run.mdgetting-started/ci-setup/github-actions/README.mdgetting-started/ci-setup/github-actions/cancel-runs.mdresources/reporters/currents-cmd/README.mdresources/reporters/currents-cmd/currents-cancel.md
|
Heads up for anyone re-reading the earlier review comments on the When this PR was opened, On 2026-07-30 the action was released and
So the examples in this PR match the action as released. Changing them to pass Verified with |
The heading skipped from the H2 it sits under straight to H4, the only place in the page that does.
User description
Documents cancelling a Currents run from CI: the
currents cancelcommand (currents-dev/currents-reporter#380, backend currents-dev/currents#3279) and the GitHub action (currents-dev/cancel-run-gh-action#11).What changed
resources/reporters/currents-cmd/currents-cancel.md— usage, GitHub Actions and GitLab examples, and the behaviours worth knowing: it is safe for every job of a parallelized run to call it, and cancelling before any results were uploaded succeeds rather than failing the step.getting-started/ci-setup/github-actions/cancel-runs.md— the GitHub Actions article: theif: cancelled()step, which credential to use, a full workflow, and how it pairs withconcurrency: cancel-in-progress: true, which is what creates abandoned runs in the first place.getting-started/ci-setup/github-actions/README.md— the section landing page was an empty heading. It now lists what is in the section, grouped as setup, reruns and cancellation.dashboard/runs/cancel-run.md— new "Cancelling Runs from CI" section, and the GitHub action examples now use the record key the job already has. The API key is documented as the second option rather than the only one, and the stale "api-token,github-run-idandgithub-run-attemptare still required" note is gone — none of them are required now.SUMMARY.mdentries for both new pages.Note on timing
The command ships in a future
@currents/cmdrelease and the action in a newv1tag; the director route both call has to be deployed first. Worth holding this until they are out.Generated description
Below is a concise technical summary of the changes proposed in this PR:
Document how cancelled CI jobs should stop their Currents run from hanging in progress, covering the
currents cancelcommand, thecancel-run-gh-action, and the updated cancellation guidance in the dashboard and GitHub Actions docs. Update the docs index so the new cancellation pages are easy to find from the GitHub Actions and command references.Modified files (3)
Latest Contributors(2)
currents cancelor the GitHub Actions action, including the record key, CI build ID, and run ID behaviors.Modified files (3)
Latest Contributors(2)
Summary by CodeRabbit
currents cancelCLI command, including authentication, required inputs, and usage examples.npx currents cancelstep and a dedicated cancellation action.