Repository navigation
Treat empty add_labels list as a no-op instead of a job failure - #61429
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
add_labels list as a no-op instead of a job failure
|
@copilot the tools.json spec of the field should set min 1 |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Added |
There was a problem hiding this comment.
🟡 Changes recommended
The no-op is currently counted as an applied mutation rather than a skipped operation.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Makes empty add_labels requests non-fatal while guiding agents toward non-empty input.
Changes:
- Returns successful no-op results for empty or missing labels.
- Adds
minItems: 1to both tool schemas. - Updates tests and release notes.
File summaries
| File | Description |
|---|---|
pkg/workflow/js/safe_outputs_tools.json |
Updates compiler schema constraints. |
actions/setup/js/safe_outputs_tools.json |
Updates runtime schema constraints. |
actions/setup/js/add_labels.cjs |
Implements empty-label no-op handling. |
actions/setup/js/add_labels.test.cjs |
Updates no-op expectations. |
.changeset/add-labels-empty-list-no-op.md |
Documents the patch. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 1
- Review effort level: Balanced
| return { | ||
| success: true, | ||
| number: itemNumber, | ||
| labelsAdded: [], | ||
| message, | ||
| }; |
There was a problem hiding this comment.
Addressed in 9ebe596 and 3c0e220: the empty-labels path now returns { success: true, skipped: true, reasonCode: "NO_LABELS_PROVIDED", reason: "No labels provided", ... }. classifySafeOutputResult checks skipped before success, so it is counted in items_skipped rather than items_applied, and the summary renders the reason code. Tests assert result.skipped === true, the reason code, and classifySafeOutputResult(result) === "skipped".
|
@copilot this PR still needs forward progress before a maintainer can investigate quickly. Please update the empty-label no-op so it is reported as a skipped operation rather than an applied mutation, refresh the branch if needed, and then run the Latest blocking review points:
Run URL: https://github.com/github/gh-aw/actions/runs/35174719104 Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "github.com"See Network Configuration for more information.
|
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Fixed in 9ebe596: the empty-labels no-op now returns |
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
|
Previously raised review point to re-check:
Run URL: https://github.com/github/gh-aw/actions/runs/35176271104
|
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Re-verified and refreshed in 3c0e220. The empty- A fresh Copilot review pass returned no comments, and the earlier review thread has been replied to. Ran
Hand-off: CI must be re-triggered by a maintainer (close/reopen, |
|
Latest points to close out:
Run URL: https://github.com/github/gh-aw/actions/runs/35183135294
|
Fresh review found no issues, and |
|
🎉 This pull request is included in a new release. Release: |
An agent emitting
add_labelswithlabels: []caused the safe-output job to fail (partial_success, 1 failed) and triggered an automatic failure-report issue, even though there was simply nothing to label.The handler was already inconsistent here: a list whose entries all get filtered out by validation returns success with
labelsAdded: [], while an empty list returned an error.Changes
actions/setup/js/add_labels.cjs— an empty/missinglabelslist now logscore.warning(...)and returns{ success: true, number, labelsAdded: [], message }rather than{ success: false, error }. The message still names the allowed list (or the repository's available labels) so the agent gets corrective feedback.actions/setup/js/add_labels.test.cjs— the three empty/missing-labels cases assert the no-op success result..changeset/add-labels-empty-list-no-op.md— patch changeset.Unchanged: missing/invalid issue numbers, disallowed or blocked label names, label-count limits, and API/permission errors all remain failures.
add_labelswith an empty list fail the workflow? #61419Run: https://github.com/github/gh-aw/actions/runs/35174719104
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
github.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.
pr-sous-chef run https://github.com/github/gh-aw/actions/runs/35183135294