Match agent failure issues by stored metadata instead of title alone#33089
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR tightens failure issue reuse so new failures are matched against stored workflow/failure metadata instead of title alone.
Changes:
- Adds parsing and generation of failure-match metadata markers.
- Uses branch, PR number, workflow ID, categories, and expiration state when reusing issues.
- Adds focused tests and regenerates one workflow lockfile.
Show a summary per file
| File | Description |
|---|---|
actions/setup/js/handle_agent_failure.cjs |
Implements precise metadata-based failure issue matching. |
actions/setup/js/handle_agent_failure.test.cjs |
Adds tests for matching, mismatching, and expired failure issues. |
.github/workflows/pr-description-caveman.lock.yml |
Regenerates the PR Description Updater workflow lockfile with updated runtime/action configuration. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comments suppressed due to low confidence (1)
actions/setup/js/handle_agent_failure.cjs:260
- The new pagination behavior is not covered by the added tests. A regression here would silently reintroduce the first-100-results limit for same-title failure issues, so add a test where the matching issue appears on a later page.
for (let page = 1; ; page += 1) {
const searchResult = await github.rest.search.issuesAndPullRequests({
q: searchQuery,
per_page: perPage,
page,
});
- Files reviewed: 3/3 changed files
- Comments generated: 2
|
|
||
| /** @type {Record<string, string>} */ | ||
| const metadata = {}; | ||
| const pairPattern = /([a-zA-Z0-9_-]+):\s*([^,]+?)(?=,\s*[a-zA-Z0-9_-]+:\s*|$)/g; |
| - name: Setup Scripts | ||
| id: setup | ||
| uses: github/gh-aw-actions/setup@v0.72.1 | ||
| uses: ./actions/setup |
|
@copilot review all comments |
|
Please address the unresolved review feedback and rerun checks after the branch refresh.
|
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Addressed the reviewer comments in c663f28: fixed failure-issue metadata parsing so comma-containing marker values still match correctly, added coverage for comma-containing workflow/branch values, and removed the unrelated |
|
@copilot review all comments |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…lure-issue-handler # Conflicts: # actions/setup/js/handle_agent_failure.test.cjs Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot add tests |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
`` Please summarize remaining blockers and post a short completion plan. If applicable, refresh the branch and rerun checks. ``
|
The failure-issue handler was reusing open issues by workflow title alone, causing unrelated failures across branches, PRs, categories, and expired reports to accumulate into the same thread. This change scopes reuse to the issue’s stored workflow metadata and expiration state so only the same failure stream is appended.
Problem
workflow_idalready stored in the body markerWhat changed
workflow_idSearch behavior
Metadata format
<!-- gh-aw-failure-issue: true, workflow_id: pr-docs-check, branch: docs/fix-links, pull_request: 123, failure_categories: missing_safe_outputs|report_incomplete -->pr-sous-chef: refreshed branch from https://github.com/github/gh-aw/actions/runs/26052176977