Skip to content

feat(static-site-deploy): discover deploy targets from the AWS profile during setup - #168

Merged
devin-ai-integration[bot] merged 3 commits into
mainfrom
devin/1796172299-setup-discover-targets
Dec 2, 2026
Merged

devin-ai-integration[bot] merged 3 commits into
mainfrom
devin/1796172299-setup-discover-targets

Conversation

@pyramation

@pyramation pyramation commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

static-site-deploy setup used to prompt for the S3 bucket, CloudFront distribution ID, homepage URL, region and AWS account ID even when an AWS profile was already signed in. Setup now discovers them (new discover.ts, setup path only, never in CI):

  • account ID ← aws sts get-caller-identity
  • SITE_URL ← https://<repo-name> when the repo name is domain-shaped (e.g. acme.example)
  • distribution ← the single CloudFront distribution whose Aliases include the site host
  • bucket ← that distribution's S3 origin (REST or website endpoint)
  • region ← s3api get-bucket-location (empty ⇒ us-east-1)

Discovered values are printed; explicit flags and env vars always win; any failed lookup falls back to the existing prompt. So setup becomes:

AWS_PROFILE=example pnpm run deploy:setup --provision --role-name example-site-deploy

Tests mock the aws calls; README, skill and skill ZIP updated.


Webby opened this PR for Dan
Implemented in session Set up automated deploys for latex2js.com and mathapedia.com
Review with Devin · Open in Devin Desktop


Summary by CodeRabbit

  • New Features
    • Setup can now use your existing AWS CLI profile to discover deployment settings, including the matching CloudFront distribution, S3 bucket, bucket region, and AWS account ID.
    • For repositories with a domain-shaped name, setup can infer the HTTPS site URL. Use SITE_URL when the repository name does not indicate the site’s domain.
    • Explicit settings take precedence over discovered values. Any unresolved settings are shown and prompted for; dry-run discovery does not make changes.
  • Documentation
    • Updated setup guidance to explain AWS profile discovery, required permissions, and available overrides.

@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 Dec 2, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

Walkthrough

Setup now discovers missing static-site deployment targets and AWS account details from the configured AWS profile outside CI. Explicit values remain in place, and the CLI prompts for unresolved settings. Tests and setup documentation cover the discovery flow.

Changes: Static-site setup discovery

Layer / File(s) Summary
AWS discovery and configuration values
packages/static-site-deploy/src/config.ts, packages/static-site-deploy/src/discover.ts
The package queries CloudFront, S3, and STS to discover missing site targets and account IDs. It validates discovered values and handles supported S3 origin and bucket-region formats.
Setup integration, validation, and documentation
packages/static-site-deploy/src/cli.ts, packages/static-site-deploy/__tests__/cli.test.cjs, packages/static-site-deploy/README.md, .agents/skills/static-site-deploy/SKILL.md
Setup uses discovered values outside CI and prompts for unresolved settings. Tests cover overrides, discovery failures, origin restrictions, and commands that skip discovery. The README and skill instructions describe profile-based discovery and setup options.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant StaticSiteCLI
  participant discoverTargets
  participant AWSCLI
  participant discoverAccountId
  participant SetupPrompts
  StaticSiteCLI->>discoverTargets: discover missing target settings
  discoverTargets->>AWSCLI: query CloudFront and S3
  AWSCLI-->>discoverTargets: return discovery results
  discoverTargets-->>StaticSiteCLI: return target values
  StaticSiteCLI->>discoverAccountId: discover missing AWS account ID
  discoverAccountId->>AWSCLI: query STS caller identity
  AWSCLI-->>discoverAccountId: return account identity
  discoverAccountId-->>StaticSiteCLI: return valid account ID or no value
  StaticSiteCLI->>SetupPrompts: prompt for unresolved settings
Loading

Possibly related PRs

Suggested reviewers: luxor-code-review

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@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 found 1 finding. Devin automatically fixed it.

Fixed by Devin (1)
  • Wrong deployment bucket for routed homepages — Bucket comes only from the default origin, and discovery is skipped when any ordered behavior targets another origin.

View findings in Devin Review · Follow Devin's work

Devin Review

@devin-ai-integration
devin-ai-integration Bot merged commit 54daadd into main Dec 2, 2026
66 of 67 checks passed
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