Uh oh!
There was an error while loading. Please reload this page.
fix(closure-router): add GH_TOKEN to closing-PR lookup so issues mirror their closing PR's Status - #64
Closed
LukasWodka wants to merge 1 commit into
Closed
fix(closure-router): add GH_TOKEN to closing-PR lookup so issues mirror their closing PR's Status#64LukasWodka wants to merge 1 commit into
LukasWodka wants to merge 1 commit into
Conversation
…or their PR
The "Determine target Status" step resolves the base branch of the PR
that closed an issue via `gh api graphql`, but had no GH_TOKEN in its
env. On Actions runners `gh` exits immediately without a token, the
error was discarded (2>/dev/null) and the exit code swallowed
(|| CLOSING_PR_BASE=""), so the base always resolved to "" and every
issue closed as completed fell through to the manual-close default
(Prod) instead of mirroring its closing PR's Status ("FR on dev" for
develop merges, "FR on staging" for staging merges).
Observed 2026-07-23 on client-runtime issues #200 (closed by PR #204,
base develop) and #202 (closed by PR #205, base develop), both routed
to Prod by the issues-event router runs.
Also surface the lookup's stderr and log the resolved base so future
failures are visible in the run log.
Refs tracebloc/backend#1195
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>LukasWodka
commented
Jul 23, 2026
ContributorAuthor
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 4a8a488. Configure here.
This was referenced Jul 23, 2026
Merged
This was referenced Jul 25, 2026
Merged
LukasWodka
commented
Jul 26, 2026
ContributorAuthor
Superseded by #67, which merged with both the GH_TOKEN fix and the Prod-default fix. Closing (→ Cancelled). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the org-wide kanban misroute where an issue closed by a merged PR lands on Prod instead of mirroring its closing PR's Status. Full evidence and analysis: tracebloc/backend#1195.
The "Determine target Status" step resolves the closing PR's base branch via
gh api graphql, but had noGH_TOKENin its env (only the "Update Status" step had one). On Actions runnersghexits immediately without a token, the error was discarded (2>/dev/null), the exit code swallowed (|| CLOSING_PR_BASE=""), and the empty base fell into the*) status=Prodarm — the default meant for manually completed issues. Deterministic for every issue closed ascompleted, in every repo calling this reusable workflow.Observed twice on 2026-07-23 in client-runtime: issue #200 (closed by PR #204, base
develop) and issue #202 (closed by PR #205, basedevelop) — both routed to Prod by the issues-event router runs while the PR cards correctly went to "FR on dev".Changes
GH_TOKEN: ${{ secrets.PROJECTS_KANBAN_TOKEN }}to the "Determine target Status" step env — the same secret the "Update Status" step already uses; all callers passsecrets: inherit, so no caller changes are needed.|| CLOSING_PR_BASE=""fallback stays, so manually completed issues still default to Prod as designed.Verification
baseRefName=develop(PR chore: drop a committed .pyc, and ignore the class (backend#1602) #204 / PR release-train: staging -> main #205) — with the token present the router emits "FR on dev". No query change needed: merged closing PRs are returned withoutincludeClosedPrs.gh api graphqlcall withGITHUB_ACTIONS=trueand noGH_TOKENexits 4 with "gh: To use GitHub CLI in a GitHub Actions workflow, set the GH_TOKEN environment variable."yaml.safe_loadpasses on the edited workflow.Deploy note
Callers pin this reusable workflow
@main, so the fix only takes effect once promoteddevelop → mainon the normal cadence. (developwas fast-forwarded frommainto serve as the PR base — it was stale at the PR #55 merge.)Refs tracebloc/backend#1195
🤖 Generated with Claude Code
Note
Low Risk
CI workflow-only change with no app runtime impact; uses an existing secret already passed to the same workflow’s update step.
Overview
Fixes org-wide kanban routing when an issue is closed as completed by a merged PR: those issues were always sent to Prod instead of matching the closing PR’s branch (e.g. FR on dev).
The Determine target Status step now sets
GH_TOKENfromPROJECTS_KANBAN_TOKEN(same secret the update step already uses; callers alreadysecrets: inherit). Without it,gh api graphqlfails on Actions, the failure was hidden, and the script treated every completed issue like a manual close (Prod).Stderr is no longer discarded on that lookup so failures show in logs, and the resolved closing-PR base is echoed for debugging. Manual completions still default to Prod when no closing PR is found.
Reviewed by Cursor Bugbot for commit 4a8a488. Bugbot is set up for automated code reviews on this repo. Configure here.