fix(impl-merge): clear stale failed labels on merge - #11197
Conversation
…really clears them `gh issue edit --remove-label a,b,c` resolves every name against the repository's labels before it edits and fails the whole call when one is unknown; `impl:<lib>:pending` only exists on demand, so the comma-separated cleanup failed and its fallback added `impl:<lib>:done` while leaving `impl:<lib>:failed` in place (issues #3343 and #3650 after the 2026-09-02 rescue). Remove the labels individually, each call tolerated, and take the watchdog's `watchdog:retried-<lib>` marker with them. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SrKzcwZBnref1sWYtdXynu
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SrKzcwZBnref1sWYtdXynu
There was a problem hiding this comment.
🟡 Changes recommended
The new stale-label removal loop suppresses all gh failures, which can silently leave the exact :failed/watchdog-marker labels behind on transient API errors.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR updates the impl-merge GitHub Actions workflow to reliably clear stale “failure/retry” labels from spec issues when an implementation successfully merges, preventing watchdog scans from incorrectly flagging issues as needing manual attention. It also records the behavior change in the project changelog.
Changes:
- Update
impl-merge.ymlto addimpl:<lib>:doneand then remove stale labels (generate:<lib>,impl:<lib>:pending,impl:<lib>:failed, andwatchdog:retried-<lib>) via individual tolerated calls. - Add a
[Unreleased]changelog entry describing the label-cleanup fix and the outage-rescue fallout it addresses.
File summaries
| File | Description |
|---|---|
| CHANGELOG.md | Documents the fix so releases capture the operational impact and motivation. |
| .github/workflows/impl-merge.yml | Adjusts issue label updates to avoid gh issue edit failing the entire removal when any label name is unknown. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…rt failures Review feedback: silently tolerating every removal would hide a transient API failure and leave the stale label in place, which is the state this step exists to clear. Read the issue's labels once, remove only the stale ones that are present, and emit a warning when a removal fails. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SrKzcwZBnref1sWYtdXynu
There was a problem hiding this comment.
🔵 Needs a closer look
It modifies a production GitHub Actions workflow where mistakes can silently break automation and there is no local verification loop to fully validate behavior.
Review details
Suppressed comments (1)
.github/workflows/impl-merge.yml:393
- The label-removal loop suppresses all errors (
2>/dev/null || true), so ifgh issue editfails for a real reason (token permissions, API outage/rate limit), the workflow will silently leave stale labels behind and you won’t have any signal in the run logs. Consider emitting at least a::debug::line on failure so troubleshooting doesn’t require reproducing locally.
# (2026-09-02). A removal that fails anyway is reported, not hidden:
# the stale label is exactly the state this step exists to clear.
PRESENT=$(gh issue view "$ISSUE" --json labels -q '.labels[].name' 2>/dev/null || echo "")
for stale in "generate:${LIBRARY}" "impl:${LIBRARY}:pending" \
- Files reviewed: 2/2 changed files
- Comments generated: 0 new
- Review effort level: Lite
…failed-labels # Conflicts: # CHANGELOG.md
There was a problem hiding this comment.
🟡 Changes recommended
The new label-cleanup step still suppresses/ignores failures when fetching current issue labels, which can silently skip the very cleanup this workflow change is meant to guarantee.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
There was a problem hiding this comment.
🟡 Changes recommended
The updated workflow still suppresses gh issue view errors and can silently skip stale-label cleanup on transient failures, undermining the PR’s intent to reliably clear stale labels.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (1)
.github/workflows/impl-merge.yml:392
gh issue viewerrors are currently suppressed and replaced with an empty label list; if that call fails (rate limit/transient API error), this step silently skips stale-label cleanup, leavingimpl:<lib>:failed/watchdog:retried-<lib>behind. Since the goal here is to clear stale state, it’s better to emit a warning when the label read fails.
PRESENT=$(gh issue view "$ISSUE" --json labels -q '.labels[].name' 2>/dev/null || echo "")
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
|
|
||
| # Then clear every label that says this library is still pending or | ||
| # broken: the generate trigger, the pending marker, the :failed label | ||
| # impl-generate.yml sets at its retry cap, and the watchdog's |
Summary
impl-merge.ymlremovedgenerate:<lib>,impl:<lib>:pendingandimpl:<lib>:failedin one comma-separatedgh issue edit;ghresolves each name against the repository's label list first and rejects the whole call when one is unknown (impl:<lib>:pendingis created on demand), so the fallback only addedimpl:<lib>:done.impl:<lib>:failednext toimpl:<lib>:donesince the 2026-09-02 outage rescue, and every watchdog scan reports those pairs as "already retried — needs manual attention".watchdog:retried-<lib>marker is cleared with them.Plan
N/A
Test plan
bash -n.impl-mergerun on an issue that carriesimpl:<lib>:failed(e.g. a rescue of [choropleth-basic] Choropleth Map with Regional Coloring #3069's muix) leaves onlyimpl:<lib>:done.🤖 Generated with Claude Code
https://claude.ai/code/session_01SrKzcwZBnref1sWYtdXynu