Uh oh!
There was an error while loading. Please reload this page.
fix(kanban): advance-deploy-env must fail closed on unreadable or truncated reads - #180
fix(kanban): advance-deploy-env must fail closed on unreadable or truncated reads#180LukasWodka wants to merge 3 commits into
Conversation
…ncated reads Bugbot (#166), two findings of the same class -- both fail OPEN, which is the one direction this workflow must never fail: 1. Both closing-issue lookups ended in `|| CIS='{}'` / `|| IRESP='{}'`, so an expired token, a rate limit or a cross-repo permission error was indistinguishable from "this PR closes no issues". RUN_FAILED was never set, the cards stayed behind, and the run reported success -- the drift this advancement exists to eliminate, returning invisibly. 2. Neither connection requested totalCount, so a PR closing more than 30 issues (or an issue on more than 10 projects) silently advanced the first page and the remainder looked like it did not exist. Both now use the workflow's existing fail-closed convention: warn, set RUN_FAILED, and let the end-of-run check exit non-zero. actionlint clean; healthy path unchanged. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Bugbot on the duplicate PR (#181) caught a regression I introduced in the previous commit, and it would have hurt: PR_NUMBERS is scraped from commit subjects, so it legitimately carries numbers that are not PRs in this repo -- a hand-written (#47) issue reference, or a subject carried in from another repo. The loop above already documents exactly that. Failing closed on those turned ordinary pushes red. Fail-closed is right for an outage and wrong for a reference that simply does not resolve. The two are now split on the error text: * "Could not resolve to a PullRequest" / "...to an Issue" -> notice, skip * anything else (401, rate limit, permissions) -> warning + RUN_FAILED 2>/dev/null is also gone. It discarded the only evidence that could tell the two apart, and left any red run undiagnosable -- barely better than a silent one. The error text now reaches the log. Verified with a stub: a normal read passes, #47 skips as a notice, a 401 sets RUN_FAILED. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
LukasWodka
commented
Aug 6, 2026
Cross-reference: #181 fixes the same two Bugbot's review of #181 also caught a regression that was in this PR, and I have since fixed it here: |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e05ac93. Configure here.
Uh oh!
There was an error while loading. Please reload this page.
…SS, not missing data Bugbot (#180, High) caught the opposite over-correction to the one I made last commit, and it is right. I had added "Could not resolve to a Repository" to the benign skip list. GitHub returns that same message for a private repo the token cannot see -- missing scope, expired SSO, cross-repo auth. That is exactly the case this block exists for: a client/website PR closing a `backend` issue. So the skip restored the fail-open hole on the one route it was added to close. The benign case is gone from the issue read entirely, deliberately. These owner/repo/number triples come from closingIssuesReferences, which GitHub itself already resolved, so the issue and its repo exist by construction -- a failure here cannot be missing data. The scraped-PR read above keeps its benign case for the opposite reason: those numbers come from commit subjects, nothing resolved them, and the repo is the one running the workflow. actionlint clean. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
LukasWodka
commented
Aug 10, 2026
Closing in favour of #181, per @LukasWodka's decision. Both PRs independently fix the same two Bugbot findings on .github#166 (fail-closed closing-issue lookups + totalCount in
Closing to keep the review queue unambiguous for @saadqbal. Reopen if ever needed. |

Summary
Two Bugbot findings on the
develop -> stagingpromotion (.github#166). Both are the same class, and both fail open — which is the one direction this workflow must never fail, since a silent no-op looks identical to a green run.1. A failed read was indistinguishable from "closes nothing." Both lookups ended in
|| CIS='{}'/|| IRESP='{}'. An expired token, a rate limit, or a cross-repo permission error produced an empty result, the loop advanced nothing, and the run reported success. That is precisely the board drift this advancement was added to eliminate — returning invisibly.2. Truncation was silent.
closingIssuesReferences(first: 30)andprojectItems(first: 10)requested nototalCount, so anything past the limit simply looked like it did not exist.Changes
Both reads now follow the workflow's existing fail-closed convention (
RUN_FAILED=1, warning, non-zero exit at the end):RUN_FAILED, never "closes nothing"RUN_FAILED, never "not on project"totalCountrequested on both connections; exceeding the page size warns and setsRUN_FAILEDrather than skipping the remainder quietlyTest plan
actionlintclean🤖 Generated with Claude Code
Note
Medium Risk
Changes CI kanban automation behavior on error paths across all repos that call this workflow; misclassification could redden runs or still miss cards, but the happy path is unchanged.
Overview
The closing-issue advancement path in
advance-deploy-envno longer treats API failures or partial pages as “nothing to do.” GraphQL stderr is captured in a temp file so errors can be classified instead of being discarded with2>/dev/nulland|| '{}'fallbacks.For closing-issues lookups on scraped PR numbers, only “not a pull request” is skipped quietly; token, rate-limit, and permission failures emit warnings, set
RUN_FAILED, and the step exits non-zero at the end.totalCountonclosingIssuesReferencestriggers a warning andRUN_FAILEDwhen more than 30 closing issues exist.Per-issue reads from GitHub-resolved triples always fail closed on any GraphQL error (including cross-repo access gaps), with no benign skip for “could not resolve” text.
projectItems.totalCountover 10 is similarly flagged so a kanban item might be missed without a silent green run.Healthy paths are unchanged aside from the extra
totalCountfields in the queries.Reviewed by Cursor Bugbot for commit c273577. Bugbot is set up for automated code reviews on this repo. Configure here.