Skip to content

fix: pass kanban option IDs as raw strings (-f not -F) to survive numeric IDs - #52

Merged
aptracebloc merged 2 commits into
developfrom
fix/kanban-numeric-option-id-coercion
May 27, 2026
Merged

fix: pass kanban option IDs as raw strings (-f not -F) to survive numeric IDs#52
aptracebloc merged 2 commits into
developfrom
fix/kanban-numeric-option-id-coercion

Conversation

@LukasWodka

@LukasWodkaLukasWodka commented May 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes a real, currently-firing bug in the kanban automation: advance-deploy-env.yml crashes on every push to develop and master/main.

Root cause: the workflows pass single-select option IDs to GraphQL with gh api graphql -F o="$OPT_ID". The -F flag does magic type coercion — an all-digit value becomes an integer — but the mutation variable is $o: String!, which rejects it:

gh: Variable $o of type String! was provided invalid value

ProjectV2 option IDs are 8-char hex and are frequently all-numeric. Some of the status-transition options this automation targets are all-numeric, so the mutation fails. The Deploy-environment update runs first and succeeds (its option IDs contain letters), then the Status update crashes the job — so the run goes red and the Status field doesn't advance. It's been masked because kanban-closure-router.yml (a separate PR-merge-triggered workflow) already uses -f and advances the card correctly. So cards moved, but the advance / advance job has been failing silently.

Fix:-F o=-f o= (raw string, coercion-proof) in all 5 mutations across 4 workflows. $p/$i/$f stay -F — they're GraphQL ID! (which accepts integer coercion) and are always letter-prefixed anyway.

WorkflowMutations fixedWas
advance-deploy-env.yml2actively crashing
set-pr-status.yml1latent
fr-pass-comment.yml1latent
customer-priority-bump.yml1latent

No change needed in kanban-closure-router.yml (already -f) or auto-classify.yml (inlines the ID as a quoted string literal). Each fix carries a comment explaining the -f so it isn't reverted later.

⚠️ Activation note

Caller workflows reference these reusables at @main, so this fix only takes effect once it reaches main via the normal develop → staging → main promotion. Targeting develop per branch policy.

Test plan

  • YAML parses (all 4 files)
  • No -F o= remains; 5× -f o= present; $p/$i/$f unchanged
  • After promotion to main: push to develop on any repo → advance / advance job is green and the card advances
  • Push to master/main → card advances to the prod state

…utations
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.
@LukasWodka

Copy link
Copy Markdown
ContributorAuthor

👋 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.)

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).
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugSomething isn't workingwork-type:bugDefect or regression

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@LukasWodka@aptracebloc@divyasinghds