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/deploy): reject unaccounted CLI arguments before render/restart/deploy work #10441
pm-stack/grist/deploy.sh is an operator script that declares a single optional subcommand (deploy default, render, or restart), but it ignores any additional positional arguments after a recognized subcommand and proceeds with its normal work.
Source: the script dispatches only on ${1:-deploy} (case at :87-114) and never validates $# or rejects extra positional arguments. For a recognized subcommand, extra args are silently ignored:
./deploy.sh render unexpected-arg takes the render branch and runs render() (:88-90), which decrypts secrets via sops --decrypt and writes .env (mode 600) before exiting (:38-85).
./deploy.sh restart unexpected-arg takes the restart branch and runs docker compose restart (:91-93).
./deploy.sh deploy unexpected-arg takes the deploy branch and performs the full deploy (render, pull, recreate, health wait/subprocess/network checks) (:94-110).
Unknown subcommands are correctly rejected (:111-114), but unaccounted extra arguments alongside a valid subcommand are not.
Why it matters
Silently ignoring extra arguments makes typos, stale invocations, or future interface changes do the wrong thing without feedback. This script decrypts secrets, writes the Grist env file, restarts containers, and performs deploy/health work; argument mistakes should fail fast before any of that work.
Suggested fix / acceptance criteria
Declare the script's full command-line contract (at most one positional argument: deploy/render/restart, default deploy) and reject any unaccounted extra positional arguments with a clear usage message to stderr and a non-zero exit, before any subprocess, secret decryption, file write, network, or deploy step.
Preserve existing behavior for valid invocations: no args, deploy, render, and restart.
Add/update regression coverage asserting that extra positional arguments (e.g. ./deploy.sh render unexpected-arg, ./deploy.sh restart unexpected-arg, ./deploy.sh deploy unexpected-arg, ./deploy.sh unexpected-arg extra) are rejected with non-zero exit and do not start render/restart/deploy side effects in a controlled fixture.
Triage check (task 19268, lane any-d): already done. Fresh verification this shift: issue #10441 is CLOSED (stateReason COMPLETED, closed 2026-11-17T02:18:33Z) — PR #10907 "pm-stack: enforce the argument contract in eleven more operator scripts" merged 2026-11-17T02:18:26Z, which covers the grist deploy.sh argument-contract fix this issue asked for. No further work; task 19268 completes as already_done.
Activity
developing-today commentedon Nov 15, 2026
CODE-3783
dezren39 commentedon Nov 17, 2026
Triage check (task 19268, lane any-d): already done. Fresh verification this shift: issue #10441 is CLOSED (stateReason COMPLETED, closed 2026-11-17T02:18:33Z) — PR #10907 "pm-stack: enforce the argument contract in eleven more operator scripts" merged 2026-11-17T02:18:26Z, which covers the grist deploy.sh argument-contract fix this issue asked for. No further work; task 19268 completes as already_done.