Repository navigation
fix(static-site-deploy): treat a blank reviewer answer as no reviewer - #148
Conversation
|
Review complete. 🟡 2 medium 💬 Inline comments (1)
📍 Findings outside the diff (1) — 🟡 1 medium — defects on lines GitHub can't attach comments to🟡 Medium — Dry-run shells out to live The role-update branch executes bare This PR refines the static-site-deploy package provisioning workflow, adjusting how reviewer and account configuration prompts are filtered when values are pre-supplied, and tightening dry-run behavior in the provisioning script. The test harness is updated to cover the new prompt and dry-run paths using mocked aws/gh interactions and a TTY preload.
Reviewed commit: 04dd0da |
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
There was a problem hiding this comment.
Adds a reviewer prompt option and dry-run/handling refinements to the static-site-deploy CLI provisioning flow, with updated tests.
Key findings
- 🟡 Dry-run shells out to live
awsfor policy listing — provision.sh - 🟡 Blank values skip required provisioning prompts — cli.ts:146
| { name: 'AWS_DEPLOY_ROLE_NAME', message: 'Dedicated IAM deploy role name', required: true }, | ||
| ].filter(question => provision[question.name] === undefined); | ||
| const answers = questions.length ? await prompter.prompt({}, questions.map(question => ({ | ||
| ] as const).filter(question => provision[question.name] === undefined); |
There was a problem hiding this comment.
🟡 bug · medium
Blank values skip required provisioning prompts
The question filter provision[question.name] === undefined (packages/static-site-deploy/src/cli.ts:146) treats an empty or whitespace-only value (e.g. AWS_ACCOUNT_ID="" or --reviewer ' ') as present, so the required prompt never appears.
At spawn time the trim provision.SITE_REVIEWER?.trim() || undefined (cli.ts:60) discards the whitespace-only reviewer, and blank AWS values flow into provision.sh, whose unset-only required check does not catch them — producing an opaque provisioning failure instead of the intended interactive re-prompt.
📋 Prompt for AI Agents
In packages/static-site-deploy/src/cli.ts at line 146, change the filter from provision[question.name] === undefined to !provision[question.name]?.trim() so empty or whitespace-only --reviewer/--account-id/--role-name values (or their env equivalents) still prompt the user, instead of being silently dropped by the trim at line 60 or passed blank into provision.sh. Add a test asserting that a whitespace-only SITE_REVIEWER env value still produces the reviewer prompt.
Summary
Pressing Enter at the optional reviewer prompt makes inquirerer return
null, and Node passes it toprovision.shas the string"null", which then runsgh api users/nulland tries to add that login as a reviewer.cli.tsnow leavesSITE_REVIEWERout of the child environment when the answer is blank,nullorundefined, so setup goes down the no-reviewer path. A test covers blank prompt answers.Implemented in session Provision AWS deploy setup for all five sites
Review with Devin · Open in Devin Desktop
Summary by CodeRabbit