Feature/surface pod errors#4540
Open
maxknee wants to merge 4 commits into
Open
Conversation
…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>
Contributor
There was a problem hiding this comment.
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.
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adding the capability to surface better errors to the job log when the underlying kubernetes errors occur.