Uh oh!
There was an error while loading. Please reload this page.
fix(kanban-router): use -f over -F for ID/String GraphQL vars - #25
Merged
Merged
Conversation
`gh api -F` performs type inference: digit-only strings are sent as JSON numbers. Two Status option IDs on project #2 are all-digit (`Done`=98236657, `Validation`=90729828), which made the `updateProjectV2ItemFieldValue` mutation reject them with `Variable $o of type String! was provided invalid value`. Switch the four `-F` flags on the mutation call to `-f` so they're always serialized as strings. The GraphQL types involved are `ID!`/`String!`, never numeric, so `-f` is correct for all four. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
LukasWodka
approved these changes
Apr 29, 2026
LukasWodka
left a comment
Contributor
There was a problem hiding this comment.
Approving — clean root-cause analysis in the body, fix is correct (-f always-string is right for all four ID!/String! vars). All checks green. Merging now since every PR-merge → kanban Done flow is currently failing on this.
Uh oh!
There was an error while loading. Please reload this page.
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
The kanban closure router fails on every PR merge with
gh: Variable $o of type String! was provided invalid value. Two of the six Status option IDs on project #2 are all-digit strings, sogh api -Fwas coercing them to JSON numbers — which the GraphQL schema rejects.First failing run: tracebloc-py-package#108 → run 25111214624.
What happened
PR
tracebloc-py-package#108was merged → router workflow correctly decidedstatus=Done→ then died on the GraphQL mutation with:Root cause
The router shells out with:
The
gh apiflag conventions matter:-F= typed: digit-only strings get coerced to numbers-f= always stringThe Status option IDs on project #2 are:
f75ad84661e4505c47fc9ee4df73e18b90729828← all digits98236657← all digits-F o="98236657"makesghsend the value as a JSON number98236657, but the GraphQL schema declares$o: String!. Server rejects it. Hence the failure.The other three vars (
PROJECT_ID,ITEM_ID,STATUS_FIELD) all start with prefixes likePVT_…,PVTI_…,PVTSSF_…— alphanumeric, so-Fhappens to behave correctly.STATUS_OPTis the only one that can be all-digit, and right now 2 of the 6 statuses (Done and Validation) trigger it. Done is the one the router writes most often, so this would have hit on every merged PR.Fix
Change the four
-Fflags on the mutation call to-f. The GraphQL types involved areID!/String!— never numeric — so-fis correct for all four and removes the latent risk for the other three IDs too.gh api graphql -f query=' mutation($p: ID!, $i: ID!, $f: ID!, $o: String!) { updateProjectV2ItemFieldValue(input: { projectId: $p, itemId: $i, fieldId: $f, value: {singleSelectOptionId: $o} }) { projectV2Item { id } } - }' -F p="$PROJECT_ID" -F i="$ITEM_ID" -F f="$STATUS_FIELD" -F o="$STATUS_OPT"+ }' -f p="$PROJECT_ID" -f i="$ITEM_ID" -f f="$STATUS_FIELD" -f o="$STATUS_OPT"After the fix, retry by closing/merging any test PR; the log should show
→ #N → Status=Doneinstead of the GraphQL error.Why "Cancelled" status didn't blow up too
If/when a
CancelledStatus option gets added, check whether its ID is also all-digit — same bug would hit closed-but-unmerged PRs going forward. The-ffix covers that too.Side note
PR
tracebloc-py-package#108was the rollout PR adding this caller workflow into that repo — so this was the very first real-world execution of the new routing system. First run, first bug.Test plan
Doneand the workflow run is green.Cancelled(once that Status option exists / when applicable).Note
Low Risk
Single-line change in a GitHub Actions workflow; it only affects how GraphQL variables are serialized for a status-update mutation.
Overview
Fixes the reusable
kanban-closure-routerGitHub Actions workflow by passing GraphQL variables togh api graphqlwith-f(string) instead of-F(typed) when updating the ProjectV2 Status field, preventing all-digit option IDs from being coerced to numbers and rejected by the GraphQLString!schema.Reviewed by Cursor Bugbot for commit 10a9de0. Bugbot is set up for automated code reviews on this repo. Configure here.