Skip to content

[ENG-1012] docs: cancelling runs from CI - #60

Merged
agoldis merged 9 commits into
mainfrom
docs/currents-cancel
Jul 30, 2026
Merged

[ENG-1012] docs: cancelling runs from CI#60
agoldis merged 9 commits into
mainfrom
docs/currents-cancel

Conversation

@agoldis

@agoldis agoldis commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

User description

Documents cancelling a Currents run from CI: the currents cancel command (currents-dev/currents-reporter#380, backend currents-dev/currents#3279) and the GitHub action (currents-dev/cancel-run-gh-action#11).

What changed

  • New page 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.
  • New page getting-started/ci-setup/github-actions/cancel-runs.md — the GitHub Actions article: the if: cancelled() step, which credential to use, a full workflow, and how it pairs with concurrency: 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-id and github-run-attempt are still required" note is gone — none of them are required now.
  • NavigationSUMMARY.md entries for both new pages.

Note on timing

The command ships in a future @currents/cmd release and the action in a new v1 tag; 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 cancel command, the cancel-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.

TopicDetails
Docs nav Update the docs navigation to surface the new cancellation guides in the GitHub Actions section and command reference.
Modified files (3)
  • SUMMARY.md
  • getting-started/ci-setup/github-actions/README.md
  • resources/reporters/currents-cmd/README.md
Latest Contributors(2)
UserCommitDate
agoldis@gmail.comMerge origin/main into...July 25, 2026
agoldis@users.noreply....docs: add AI section o...July 22, 2026
CI cancel Document how cancelled CI jobs should cancel their Currents run with currents cancel or the GitHub Actions action, including the record key, CI build ID, and run ID behaviors.
Modified files (3)
  • dashboard/runs/cancel-run.md
  • getting-started/ci-setup/github-actions/cancel-runs.md
  • resources/reporters/currents-cmd/currents-cancel.md
Latest Contributors(2)
UserCommitDate
agoldis@gmail.comdocs: keep the API key...July 30, 2026
miguel@currents.devExamples linksMarch 10, 2026
Review this PR on Baz | Customize your next review

Summary by CodeRabbit

  • Documentation
    • Added new guides for canceling in-progress CI test runs when CI workflows/jobs are canceled.
    • Documented the new currents cancel CLI command, including authentication, required inputs, and usage examples.
    • Added GitHub Actions cancellation examples using both a direct npx currents cancel step and a dedicated cancellation action.
    • Expanded the GitHub Actions setup documentation with additional sections covering reruns, cancellation, sharding, and CI build ID handling.
    • Updated documentation navigation to include the new cancellation resources.

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
@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The documentation adds guidance for cancelling Currents runs when CI workflows are cancelled, documents the currents cancel CLI command, updates dashboard cancellation examples, and adds navigation links for the new pages.

Changes

CI Run Cancellation

Layer / File(s) Summary
CLI cancellation command documentation
resources/reporters/currents-cmd/README.md, resources/reporters/currents-cmd/currents-cancel.md, SUMMARY.md
Documents currents cancel, authentication, run identification flags, CI examples, cancellation behavior, and the new resource link.
GitHub Actions cancellation guide
getting-started/ci-setup/github-actions/README.md, getting-started/ci-setup/github-actions/cancel-runs.md, SUMMARY.md
Adds GitHub Actions setup, rerun, cancellation, and example navigation, plus workflow cancellation instructions, environment requirements, examples, and operational notes.
Dashboard cancellation guidance
dashboard/runs/cancel-run.md
Adds CI cancellation instructions and updates GitHub Actions and API-key examples with current run identification inputs.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately summarizes the main documentation change about cancelling runs from CI.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/currents-cancel

Comment @coderabbitai help to get the list of available commands.

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
@agoldis agoldis changed the title docs: add currents cancel docs: cancelling runs from CI Jul 25, 2026
agoldis and others added 2 commits July 24, 2026 22:09
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
Comment thread dashboard/runs/cancel-run.md
Comment thread dashboard/runs/cancel-run.md
Comment thread getting-started/ci-setup/github-actions/cancel-runs.md Outdated
Comment thread resources/reporters/currents-cmd/currents-cancel.md Outdated
Comment thread resources/reporters/currents-cmd/currents-cancel.md
Comment thread resources/reporters/currents-cmd/currents-cancel.md
@agoldis agoldis changed the title docs: cancelling runs from CI [ENG-1012] docs: cancelling runs from CI Jul 26, 2026
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>
agoldis and others added 2 commits July 26, 2026 00:05
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.

@coderabbitai coderabbitai 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.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 616e4ab and bc72efe.

📒 Files selected for processing (6)
  • SUMMARY.md
  • dashboard/runs/cancel-run.md
  • getting-started/ci-setup/github-actions/README.md
  • getting-started/ci-setup/github-actions/cancel-runs.md
  • resources/reporters/currents-cmd/README.md
  • resources/reporters/currents-cmd/currents-cancel.md

Comment thread dashboard/runs/cancel-run.md Outdated
Comment thread getting-started/ci-setup/github-actions/cancel-runs.md
Comment thread resources/reporters/currents-cmd/currents-cancel.md
@agoldis

agoldis commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

Heads up for anyone re-reading the earlier review comments on the cancel-run-gh-action@v1 examples: they were correct when written, and are now stale.

When this PR was opened, v1 still pointed at e9c3885 (July 2023), where api-token, github-run-id and github-run-attempt were required: true and record-key/run-id did not exist. That's why the examples here looked wrong.

On 2026-07-30 the action was released and v1 was moved to b701810, alongside the new v1.1.0 tag. At that commit:

  • every input is required: false
  • record-key, run-id, project-id and ci-build-id all exist
  • record-key falls back to CURRENTS_RECORD_KEY, project-id to CURRENTS_PROJECT_ID, ci-build-id to CURRENTS_CI_BUILD_ID, so the no-input example works when the reporting step already exports them
  • github-run-id/github-run-attempt fall back to GITHUB_RUN_ID/GITHUB_RUN_ATTEMPT, which the runner always sets, so the api-token example needs only api-token

So the examples in this PR match the action as released. Changing them to pass api-token, github-run-id and github-run-attempt as required inputs would document a build that @v1 no longer resolves to, and would drop the record-key flow this PR exists to document.

Verified with git show v1:action.yml and src/inputs.ts at b701810.

The heading skipped from the H2 it sits under straight to H4, the only
place in the page that does.
@agoldis
agoldis merged commit 0bb413e into main Jul 30, 2026
4 checks passed
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.

1 participant