fix: pass kanban option IDs as raw strings (-f not -F) to survive num…#53
Conversation
…eric IDs (#52) * fix: pass ProjectV2 option IDs as raw strings (-f not -F) in kanban mutations The kanban field automations set single-select option IDs via `gh api graphql -F o="$OPT_ID"`. The -F flag does magic type coercion: an all-numeric value is converted to an integer. The mutation variable is `$o: String!`, which rejects an integer with: gh: Variable $o of type String! was provided invalid value ProjectV2 single-select option IDs are 8-char hex and are frequently all-numeric. Two are today: - Status "FR on dev" = 90729828 - Status "Prod" = 98236657 advance-deploy-env.yml drives exactly those two transitions, so it has been crashing on every push to develop (-> FR on dev) and master/main (-> Prod). The Deploy-environment update runs first and succeeds (its option IDs contain letters), so that field "half-worked" while the Status update crashed the job. Card advancement was masked by the separate kanban-closure-router.yml, which already uses -f correctly. Fix: switch the option-ID parameter from -F to -f (raw string) in all five mutations across four workflows. The $p/$i/$f params stay -F: they are GraphQL ID! (which accepts integer coercion) and are always letter-prefixed (PVT_/PVTI_/PVTSSF_) anyway. - advance-deploy-env.yml (2 mutations - actively crashing) - set-pr-status.yml (latent: Code review / In progress have letters) - fr-pass-comment.yml (latent: Ready for * have letters) - customer-priority-bump.yml (latent: P1 has a letter; P0 = 79628723 does not) kanban-closure-router.yml already used -f (no change). auto-classify.yml inlines the option ID as a quoted string literal (no change). A comment at each call site explains the -f so it is not reverted to -F. * chore: genericize kanban-fix comments (drop internal IDs/labels) These reusable workflows live in the public tracebloc/.github repo. Remove the specific option-ID values and column/priority names from the comments added in the previous commit; keep the full technical rationale (option IDs can be all-numeric; -F coerces to int; $o: String! rejects it; use -f).
|
👋 Heads-up — Code review queue is at 20 / 8 Above the WIP limit. The team convention is to review existing PRs before opening new work. Open PRs currently in Code review (oldest first):
Pull from review before opening new work. (This is a nudge from the kanban WIP check, not a block.) |
LukasWodka
left a comment
There was a problem hiding this comment.
Approving — develop→main promotion of the kanban option-ID fix (#52).
Single clean commit, nothing else riding along. The fix switches advance-deploy-env, set-pr-status, fr-pass-comment, and customer-priority-bump to pass the single-select option ID with -f (raw string) instead of -F, so the all-numeric "FR on dev" (90729828) and "Prod" (98236657) IDs stop being coerced to int and rejected by $o: String!.
Fast-tracking to main is appropriate for this repo: .github is process-only with no deploy environment, and the callers run these workflows at @main — so the fix is inert until it lands on main, and every push keeps failing advance-deploy-env until then.
…eric IDs (#52)
The kanban field automations set single-select option IDs via
gh api graphql -F o="$OPT_ID". The -F flag does magic type coercion: an all-numeric value is converted to an integer. The mutation variable is$o: String!, which rejects an integer with:ProjectV2 single-select option IDs are 8-char hex and are frequently all-numeric. Two are today:
advance-deploy-env.yml drives exactly those two transitions, so it has been crashing on every push to develop (-> FR on dev) and master/main (-> Prod). The Deploy-environment update runs first and succeeds (its option IDs contain letters), so that field "half-worked" while the Status update crashed the job. Card advancement was masked by the separate kanban-closure-router.yml, which already uses -f correctly.
Fix: switch the option-ID parameter from -F to -f (raw string) in all five mutations across four workflows. The $p/$i/$f params stay -F: they are GraphQL ID! (which accepts integer coercion) and are always letter-prefixed (PVT_/PVTI_/PVTSSF_) anyway.
kanban-closure-router.yml already used -f (no change). auto-classify.yml inlines the option ID as a quoted string literal (no change).
A comment at each call site explains the -f so it is not reverted to -F.
These reusable workflows live in the public tracebloc/.github repo. Remove the specific option-ID values and column/priority names from the comments added in the previous commit; keep the full technical rationale (option IDs can be all-numeric; -F coerces to int; $o: String! rejects it; use -f).
Note
Low Risk
Workflow-only change to
ghCLI argument flags for existing kanban mutations; no application runtime or auth logic is modified.Overview
Fixes GitHub Projects v2 kanban automations that were failing when updating single-select fields via
gh api graphql.The option ID variable (
$o: String!) was passed with-F, which coerces all-digit values to integers and triggers GraphQL errors. It is now passed with-fso the value stays a string.$p/$i/$fremain-F(GraphQLID!).This change is applied in five mutations across
advance-deploy-env.yml(deploy + status on push),set-pr-status.yml,fr-pass-comment.yml, andcustomer-priority-bump.yml, with short comments at each call site so the flag choice is not reverted.Reviewed by Cursor Bugbot for commit 6944510. Bugbot is set up for automated code reviews on this repo. Configure here.