Report Codespaces prebuild failures in GitHub issues#8191
Conversation
Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>
Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>
|
joshblack
left a comment
There was a problem hiding this comment.
@copilot let's just have it make a contextual workflow and the title should include the workflow name e.g. Investigate {workflow_name} workflow failure. It should not duplicate issues if one already exists, instead it should update the issue with the latest failure. It should also close any open failure issues for the workflows if they pass.
Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>
Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>
Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>
Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>
Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>
Implemented in |
Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>
Implemented in |
There was a problem hiding this comment.
Pull request overview
Adds a new GitHub Actions workflow that monitors selected workflow_run completions (initially “Codespaces Prebuilds”) and opens/updates an issue on failures, then closes the issue once the monitored workflow succeeds.
Changes:
- Introduces
.github/workflows/report-workflow-failures.ymlto create/update a single “workflow failure” issue per monitored workflow when the latest completed run fails. - Includes job-level links for failed jobs (falling back to the run link when no failed jobs are found).
- Automatically closes the open failure issue(s) for that workflow when the latest completed run succeeds.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/report-workflow-failures.yml | New workflow that creates/updates/closes GitHub issues in response to monitored workflow failures/successes. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 3
- Review effort level: Low
| const failedJobLinks = failedJobs.map( | ||
| (job) => `[${job.name}](${job.html_url})`, | ||
| ); |
Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>
Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>
Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>
Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>
Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>
Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>
Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>
Addressed in |
| const latestRuns = await github.rest.actions.listWorkflowRuns({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| workflow_id: workflowRun.workflow_id, | ||
| per_page: 1, | ||
| }); |
There was a problem hiding this comment.
non-blocking The create-or-update-issue job filters this to status: 'completed', but this one doesn't, so if a newer run is queued or in progress when a success comes in, the guard bails and the issue never gets closed. Should it match the create job?
| const latestRuns = await github.rest.actions.listWorkflowRuns({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| workflow_id: workflowRun.workflow_id, | |
| per_page: 1, | |
| }); | |
| const latestRuns = await github.rest.actions.listWorkflowRuns({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| workflow_id: workflowRun.workflow_id, | |
| status: 'completed', | |
| per_page: 1, | |
| }); |
Adds failure reporting for monitored workflows, initially Codespaces Prebuilds. Each failure creates an issue linking failed jobs and prompting
@github/primer-engineering.Changelog
New
Changed
Removed
Rollout strategy
Testing & Reviewing