fix(ci): GitHub App active-PR-limit exemption regression#75311
Conversation
|
/clawsweeper automerge |
|
🦞🦞 I added Draft PRs stay fix-only until GitHub marks them ready for review. A maintainer can pause this with |
|
Codex review: passed for ClawSweeper automerge. What this changes: The PR updates Barnacle’s label-removal helper to clear the in-memory label set even when GitHub returns 404 and adds a regression test for GitHub App PRs with stale active-PR-limit labels. Automerge follow-up: No repair job is needed; this automerge-opted PR has no review findings and should be handled by exact-head mergeability and CI gates. Security review: Security review cleared: The diff only changes Barnacle’s in-memory label cache behavior and a unit-test mock; it does not add dependencies, action refs, permissions, secrets handling, package publishing, downloads, or artifact execution. Review detailsBest possible solution: Land the narrow helper change with the regression test so Barnacle’s local label state matches the intended absent-label state after 404-tolerant removals, then let the existing automerge/CI gates handle the exact PR head. Do we have a high-confidence way to reproduce the issue? Yes. A focused harness can reproduce the current-main bug by simulating a GitHub App-authored PR whose webhook payload includes stale Is this the best way to solve the issue? Yes. Moving the in-memory delete outside the successful API-removal branch is the narrowest maintainable fix because the current What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 52bf20b07d6e. |
Summary
Found one regression in the new GitHub App active-PR-limit exemption. A concurrent successful removal by the Labeler workflow can make Barnacle receive a 404, keep the stale in-memory
r: too-many-prslabel, and then close the App-authored PR for the exact limit this commit meant to skip.What ClawSweeper Is Fixing
scripts/github/barnacle-auto-response.mjs:986removeLabels(...)atscripts/github/barnacle-auto-response.mjs:986, butremoveLabelsonly deletes fromlabelSetafter a successful API removal and ignores 404s without clearing the local set atscripts/github/barnacle-auto-response.mjs:799. The Labeler workflow now also removes the same stale label for bot/App authors at.github/workflows/labeler.yml:299, so both workflows can race on the samepull_request_targetevent. I reproduced this with a focused harness whereremoveLabelthrows 404 for arenovate[bot]PR whose event payload includesr: too-many-prs; Barnacle attempted removal twice, then created the “more than 10 active PRs” close comment and closed the PR.labelSeteven if GitHub returns 404. A small targeted test should simulateremoveLabelreturning 404 for an App-authored PR withr: too-many-prsand assert no comment/update happens.Expected Repair Surface
scripts/github/barnacle-auto-response.mjs.github/workflows/labeler.ymltest/scripts/barnacle-auto-response.test.tsSource And Review Context
ClawSweeper report: https://github.com/openclaw/clawsweeper/blob/main/records/openclaw-openclaw/commits/ef799fd57a77ff34eba85cae283267fb98543ad4.md
Commit under review: ef799fd
Latest main at intake: 52bf20b
Original commit author: Shadow
GitHub author: @thewilloftheshadow
Highest severity: medium
Review confidence: high
Diff:
5a3b75de33dda11de7931686264ecf86df93de2d..ef799fd57a77ff34eba85cae283267fb98543ad4Changed files:
.github/workflows/labeler.yml,scripts/github/barnacle-auto-response.mjs,test/scripts/barnacle-auto-response.test.tsCode read: changed files, Auto response workflow entry point, active-label callers, Barnacle label/action flow, CI workflow docs, scoped script instructions
Dependencies/web: no dependency manifests changed; no web checks needed
Expected validation
pnpm check:changedClawSweeper already ran:
pnpm docs:listgit diff --check 5a3b75de33dda11de7931686264ecf86df93de2d..ef799fd57a77ff34eba85cae283267fb98543ad4pnpm installpnpm test test/scripts/barnacle-auto-response.test.tspassed: 19 testspnpm exec oxfmt --check --threads=1 scripts/github/barnacle-auto-response.mjs test/scripts/barnacle-auto-response.test.tspassedpnpm check:workflowspassedKnown review limits:
pnpm exec actionlint .github/workflows/labeler.ymlwas unavailable directly, so I used the repo wrapperpnpm check:workflows, which installs/runs the pinned actionlint path.ClawSweeper Guardrails
mainbefore changing code.ClawSweeper 🐠 replacement reef notes:
fish notes: model gpt-5.5, reasoning medium; reviewed against 97ba924.