Skip to content

fix(static-site-deploy): treat a blank reviewer answer as no reviewer - #148

Merged
devin-ai-integration[bot] merged 1 commit into
mainfrom
feat/blank-deploy-reviewer
Nov 25, 2026
Merged

devin-ai-integration[bot] merged 1 commit into
mainfrom
feat/blank-deploy-reviewer

Conversation

@pyramation

@pyramation pyramation commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Pressing Enter at the optional reviewer prompt makes inquirerer return null, and Node passes it to provision.sh as the string "null", which then runs gh api users/null and tries to add that login as a reviewer.

cli.ts now leaves SITE_REVIEWER out of the child environment when the answer is blank, null or undefined, so setup goes down the no-reviewer path. A test covers blank prompt answers.


Webby opened this PR for Dan
Implemented in session Provision AWS deploy setup for all five sites
Review with Devin · Open in Devin Desktop


Summary by CodeRabbit

  • Bug Fixes
    • Blank or whitespace-only reviewer responses are now treated as no required reviewer. Provisioning completes without attempting reviewer lookups.

@luxor-code-review

luxor-code-review Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Review complete. 🟡 2 medium

💬 Inline comments (1)

  • 🟡 Blank values skip required provisioning prompts — cli.ts:146
📍 Findings outside the diff (1) — 🟡 1 medium — defects on lines GitHub can't attach comments to

🟡 Medium — Dry-run shells out to live aws for policy listing · packages/static-site-deploy/src/provision.sh

The role-update branch executes bare aws iam list-attached-role-policies and aws iam list-role-policies (packages/static-site-deploy/src/provision.sh:189-190), bypassing the run/read_state dry-run wrappers used everywhere else.
In dry-run, read_state returns the example ARN for get-role (line 185), so this branch always runs; because the dry-run path deliberately skips the aws CLI check (lines 28-32), a dry run on a machine without aws fails mid-plan under set -e, and with credentials it makes live IAM API calls the dry-run contract excludes.


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.

Files Change
packages/static-site-deploy/src/cli.ts Adjusts prompt-question filtering for pre-supplied config values and trims reviewer input before spawning provisioning.
packages/static-site-deploy/__tests__/cli.test.cjs Extends CLI tests with mocked aws/gh and a TTY-preload harness to cover the new prompt and dry-run behavior.

Reviewed commit: 04dd0da

@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The CLI now trims the optional reviewer value and passes undefined when the value is blank. Provisioning settings and prompt answers use a dedicated type. A parameterized test covers null, empty, and whitespace responses.

Changes: Optional reviewer handling

Layer / File(s) Summary
Normalize reviewer prompt values
packages/static-site-deploy/src/cli.ts, packages/static-site-deploy/__tests__/cli.test.cjs
runProvisioner trims SITE_REVIEWER and passes undefined for a blank value. Provisioning settings and prompted answers use ProvisionSettings types. The test checks that blank responses succeed without user or reviewer lookups and report that no reviewer is required.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

Suggested reviewers: luxor-code-review

Merge Risk: Minimal · up to 04dd0

A blank reviewer answer now takes the no-reviewer path instead of being passed to GitHub as the login "null". The change is small, covered by a test, and easy to revert, so merge risk is minimal.

Security architecture risk: Low · up to 04dd0

Leaving the optional prompt blank now works as intended. The same change also lets setup proceed when a reviewer setting supplied outside the prompt contains only whitespace. On a fresh production environment, that can leave deployments without reviewer approval. Setup still requires the same permissions and keeps the existing branch restrictions.

Retained concerns

  • Low · security · observed: A whitespace-only value explicitly supplied through --reviewer or SITE_REVIEWER previously failed validation before cloud writes. It now selects the no-reviewer path. A privileged setup of a fresh production environment can therefore complete without a required reviewer despite a reviewer setting having been supplied. The live warning comes after the environment write and does not stop provisioning.
Security review details

Security Blast Radius

  • inferred — The approval change is reachable through a privileged setup of the selected repository's production environment, not through a new unauthenticated entrypoint. The deploy role's configured data-plane permissions remain scoped to the selected S3 bucket and CloudFront distribution.

Trust Boundaries and Controls

  • observed — When the existing environment already satisfies the base branch-policy and administrator-bypass checks, omission does not trigger an environment PUT just because a reviewer exists. If those checks require a PUT, the no-reviewer payload leaves reviewers unspecified; the later read-back warns about absence but does not compare the prior reviewer rule.

Resilience and Maintainability Implications

  • observed — The newly accepted inputs enter the same ordered, non-atomic provisioning flow as omission did before this PR. It checks existing environment and branch state on a repeat run, but GitHub writes precede IAM changes and are not rolled back if a later step fails.

Hardening Proposals

  • proposed — Keep blank prompt answers equivalent to omission, but reject whitespace-only reviewer values supplied explicitly through the flag or environment before any cloud writes.
Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the actual change: a blank reviewer answer is now treated as no reviewer. The raw summary and objectives both describe trimming SITE_REVIEWER, passing undefined for empty values, and o…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the actual change: a blank reviewer answer is now treated as no reviewer. The raw summary and objectives both describe trimming SITE_REVIEWER, passing undefined for empty values, and omitting SITE_REVIEWER from the child environment when the answer is blank, null, or undefined. The title is specific, follows the conventional fix(scope) format, and fits the scope of the change.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

packages/static-site-deploy/__tests__/cli.test.cjs

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.

packages/static-site-deploy/src/cli.ts

ESLint skipped: the matched ESLint configuration already failed (missing-dependency).

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 8faffb3 and 04dd0da.

Files selected for processing: 2

  • packages/static-site-deploy/__tests__/cli.test.cjs
  • packages/static-site-deploy/src/cli.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@luxor-code-review luxor-code-review Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 aws for 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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.

@devin-ai-integration
devin-ai-integration Bot merged commit 7f78803 into main Nov 25, 2026
66 checks passed
@devin-ai-integration
devin-ai-integration Bot deleted the feat/blank-deploy-reviewer branch November 25, 2026 01:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant