You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
pm-stack(grist/seed): reject unaccounted CLI arguments before doing any work #10440
pm-stack/grist/seed.sh is an operator script (run on the host after deploy/bootstrap to seed the Grist roadmap document) that declares no command-line arguments, but it never rejects unaccounted positional arguments and proceeds with its normal work when extras are supplied.
Source: the script takes no positional parameters and performs no $#/argument validation. It immediately proceeds into work: cd "$(dirname "$0")", a bun availability check and bun run validate-roadmap-seed.ts subprocess (:13-17), decrypts secrets via sops --decrypt (:22), and makes Grist API calls / may create workspace, document, table, and seed rows (api helper and subsequent logic, :27+). Any extra argument (e.g. ./seed.sh unexpected-arg) is silently ignored before these subprocess, secret-access, network, and state-changing steps.
Why it matters
Silently ignoring extra arguments makes typos, stale invocations, or future interface changes do the wrong thing without feedback. This script can decrypt secrets, talk to the Grist API, and create/seed roadmap data; argument mistakes should fail fast before any of that work.
Suggested fix / acceptance criteria
Declare the script's full command-line contract (no positional arguments) and reject any unaccounted arguments with a clear usage message to stderr and a non-zero exit, before any subprocess, secret decryption, network, or API/file work (including the early bun run validate-roadmap-seed.ts).
Preserve existing behavior for valid invocations with no positional arguments and existing environment-variable handling (PM_STACK_SECRETS, SOPS_AGE_KEY_FILE).
Add/update regression coverage (a shell/script test exercising the entrypoint with an extra positional argument in a controlled fixture or with side-effecting steps stubbed/guarded) asserting that an extra argument is rejected with non-zero exit and that no seed/decrypt/network work is started.
Activity
developing-today commentedon Nov 15, 2026
CODE-3782