Skip to content

fix: detect runner aborts from raw job logs instead of annotations#744

Merged
cmur2 merged 1 commit into
mainfrom
submit-aborted-gha-status-log-detection
Jul 14, 2026
Merged

fix: detect runner aborts from raw job logs instead of annotations#744
cmur2 merged 1 commit into
mainfrom
submit-aborted-gha-status-log-detection

Conversation

@cmur2

@cmur2 cmur2 commented Jul 9, 2026

Copy link
Copy Markdown
Member

What

submit-aborted-gha-status now detects aborted jobs by scanning the raw job logs (/actions/jobs/{id}/logs) instead of job annotations.

Why

GitHub changed how runner disconnect/preemption events are logged. The tell-tale messages:

  • The self-hosted runner: <name> lost communication with the server.
  • The runner has received a shutdown signal. (emitted when a preemptible runner is reclaimed by the host)

no longer appear as job annotations — the annotation now only carries a generic The operation was canceled.. They only show up in the raw job logs. As a result the previous annotation-based grep matched nothing and CI Analytics stopped recording any aborted-job events.

Verified against a real preempted job (camunda/camunda run 28489068489, job 84442217068): its only annotation is The operation was canceled., while the raw log contains The runner has received a shutdown signal..

How

  • Fetch the raw job logs and grep -E for the two messages.
  • Take the runner name from the job API's runner_name field (reliably populated).

Example:

image

Reviewer notes

Related to camunda/camunda#57701

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings July 9, 2026 13:34

Copilot AI 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.

Pull request overview

Updates the submit-aborted-gha-status composite action to detect runner disconnect/preemption aborts by scanning GitHub Actions raw job logs rather than job annotations, aligning with GitHub’s newer logging behavior for these events.

Changes:

  • Switched aborted-job detection from annotation scanning to scanning raw job logs for runner disconnect/shutdown messages.
  • Added a local test.sh smoke test to validate the detection logic against a known run/job.
  • Updated README behavior text to reflect the new detection mechanism.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
submit-aborted-gha-status/action.yml Replaces annotation-based abort detection with raw job log scanning and runner name extraction logic.
submit-aborted-gha-status/test.sh Adds a local smoke test script to scan failed jobs and identify runner-abort signatures.
submit-aborted-gha-status/README.md Updates documentation to describe log-based detection behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread submit-aborted-gha-status/action.yml Outdated
Comment thread submit-aborted-gha-status/test.sh Outdated
Comment thread submit-aborted-gha-status/test.sh Outdated
Comment thread submit-aborted-gha-status/README.md Outdated

Copilot AI 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.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

Comment thread submit-aborted-gha-status/action.yml
Comment thread submit-aborted-gha-status/test.sh Outdated
Comment thread submit-aborted-gha-status/README.md

@kellervater kellervater left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm. left a non-blocking comment

Comment thread submit-aborted-gha-status/test.sh Outdated
GitHub no longer surfaces runner disconnect/shutdown events as job
annotations; the annotation now only carries a generic "The operation
was canceled." message. The tell-tale lines ("... lost communication
with the server." and "The runner has received a shutdown signal.")
now appear only in the raw job logs, so the previous annotation-based
detection stopped recording any aborted-job events to CI Analytics.

Scan the raw job logs (/actions/jobs/{id}/logs) for those messages
instead. The runner name is taken from the job API's runner_name field,
falling back to parsing it from the "lost communication" log line.

Callers must grant the token `actions: read` to read raw job logs
(the old annotations endpoint only needed `checks: read`).
@cmur2
cmur2 force-pushed the submit-aborted-gha-status-log-detection branch from 2cbad28 to ba5c15e Compare July 13, 2026 13:07
pull Bot pushed a commit to Mu-L/camunda that referenced this pull request Jul 13, 2026
…unda#57280)

## What

Adds `actions: read` to the `observe-aborted-jobs` job in
`check-licenses.yml`.

## Why

Companion to
[camunda/infra-global-github-actions#744](camunda/infra-global-github-actions#744),
which changes `submit-aborted-gha-status` to detect runner aborts by
scanning **raw job logs** instead of job **annotations**. GitHub moved
the tell-tale `The runner has received a shutdown signal.` message out
of annotations (which now only say `The operation was canceled.`) and
into the raw logs, so the old annotation-based detection stopped
recording preempted/aborted self-hosted runner jobs.

Reading raw job logs requires the token to have `actions: read`; the
previous annotation approach only needed `checks: read`. This job scoped
its permissions to `checks: read` only, so without this change the log
fetch fails and aborted-job events go unrecorded.

`ci.yml`'s `check-results` job already grants `actions: read`, so no
change is needed there.

## Note

Merge order: this is safe to merge independently, but the behavior only
takes effect once #744 is live on `infra-global-github-actions` `main`
(the action is pulled `@main`).

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@cmur2
cmur2 merged commit 9c552f4 into main Jul 14, 2026
4 checks passed
@cmur2
cmur2 deleted the submit-aborted-gha-status-log-detection branch July 14, 2026 10:06
This was referenced Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants