Skip to content

Feature/surface pod errors#4540

Open
maxknee wants to merge 4 commits into
actions:masterfrom
maxknee:feature/surface-pod-errors
Open

Feature/surface pod errors#4540
maxknee wants to merge 4 commits into
actions:masterfrom
maxknee:feature/surface-pod-errors

Conversation

@maxknee

@maxknee maxknee commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Adding the capability to surface better errors to the job log when the underlying kubernetes errors occur.

maxknee and others added 2 commits June 23, 2026 14:52
…ions UI

When runner pods fail due to container-level issues (ImagePullBackOff,
CrashLoopBackOff, OOMKilled, etc.), the error was previously invisible —
pod.Status.Message is empty for these cases, and GitHub Actions only
shows a generic timeout. This change extracts container waiting/terminated
state errors and surfaces them in three ways:

1. EphemeralRunner.Status.Message now contains the specific error
2. Kubernetes Events are emitted on the EphemeralRunner resource
3. Optionally, a GitHub Check Run annotation is created (requires
   checks:write permission and wiring GitHubAnnotator in main)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ror-annotations flag

Adds a CLI flag to opt into GitHub Check Run annotations when runner pods
fail. The DynamicCheckRunAnnotator resolves credentials per-runner via the
existing SecretResolver, so it works with multi-org/repo deployments using
different GitHub Apps or PATs.

Usage: pass --enable-github-error-annotations=true to the controller.
Requires checks:write permission on the GitHub App or PAT.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 23, 2026 19:08

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

Adds mechanisms to surface Kubernetes runner pod startup failures more clearly by extracting container-level terminal errors, emitting Kubernetes warning events, and (optionally) creating GitHub Check Run outputs tied to the workflow run/commit.

Changes:

  • Add container-status error extraction/formatting for terminal pod startup failures (e.g., ImagePullBackOff, OOMKilled) and use it to populate EphemeralRunner status.
  • Emit warning Events and short-circuit reconciliation when unrecoverable container waiting states are detected.
  • Introduce optional GitHub Check Run creation for unrecoverable runner pod failures (gated behind a new CLI flag).

Reviewed changes

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

Show a summary per file
File Description
main.go Adds CLI flag and wires a dynamic GitHub annotator into the EphemeralRunner reconciler when enabled.
controllers/actions.github.com/constants.go Defines terminal container waiting/terminated reason mappings used for error categorization.
controllers/actions.github.com/pod_errors.go Implements extraction and formatting of terminal container-level errors from Pod status.
controllers/actions.github.com/pod_errors_test.go Adds unit tests for pod error extraction and formatting behavior.
controllers/actions.github.com/github_annotations.go Adds a small annotation orchestration layer (opts parsing + best-effort invocation).
controllers/actions.github.com/github_annotations_test.go Adds tests for owner/repo parsing and annotator invocation behavior.
controllers/actions.github.com/github_checkrun_annotator.go Implements GitHub Check Run creation (static-credential + dynamic-credential variants).
controllers/actions.github.com/github_checkrun_annotator_test.go Adds tests for org-level skip behavior and basic error handling paths.
controllers/actions.github.com/ephemeralrunner_controller.go Emits events, detects terminal container waiting states earlier, and populates EphemeralRunner failure messages from container status when pod-level messages are empty.

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

Comment thread controllers/actions.github.com/github_checkrun_annotator.go
Comment thread controllers/actions.github.com/github_checkrun_annotator.go
maxknee and others added 2 commits June 23, 2026 15:32
Addresses review feedback: log the actual error from GetWorkflowRunByID
to help diagnose auth/scoping issues when the annotation is skipped.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
CI requires mocks to be up-to-date with interfaces. Run `go tool mockery`
to include the new GitHubAnnotator mock.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

2 participants