Skip to content

[WEB-10045] Use platform astro-adapter-aws-lambda for CI builds - #39732

Open
devindford wants to merge 2 commits into
jen.gilbert/astro-basefrom
devin.ford/astro-platform-adapter-v2
Open

[WEB-10045] Use platform astro-adapter-aws-lambda for CI builds#39732
devindford wants to merge 2 commits into
jen.gilbert/astro-basefrom
devin.ford/astro-platform-adapter-v2

Conversation

@devindford

Copy link
Copy Markdown
Contributor

What does this PR do? What is the motivation?

Prepares the Astro /api app for the websites deployment platform's SSR model by building with the platform adapter in CI.

  • Adds astro-adapter-aws-lambda v1.0.0 (published via corp-node-packages) as a dependency.
  • astro.config.mjs now selects the adapter per build environment (resolveSiteEnv()):
    • CI builds (build:preview / build:live): use astro-adapter-aws-lambda in static: true mode. This generates dist/_routes.json (default: static, empty ssr) that the deploy pipeline turns into the CloudFront KVS manifest, replacing the hand-written one, and emits the dist/lambda/entry.mjs stub the platform build tooling expects.
    • Local builds/dev: unchanged @astrojs/node standalone, so astro preview keeps working (the platform adapter has no preview mode).
  • The output: "server" + per-route prerender = true shape is unchanged; staticApiGuard still enforces the fully-static invariant. When the first SSR route lands, static flips to false with platformMode per the divergences doc checklist.

Companion PRs:

  • ddoghq/documentation-ci#253 (dynamic _routes.json manifest + handler upload)
  • DataDog/corp-node-packages#361 (the adapter package)

Fixes WEB-10045 (follow-up: SSR readiness)

Merge readiness

  • Ready for merge

For Datadog employees:

  • ⚠️ Your branch name MUST follow the <name>/<description> convention and include the forward slash (/).
  • 🤖 Comment with /review to run an automated check before review.

AI assistance

pi (Claude) helped wire the adapter selection into astro.config.mjs and update package.json/yarn.lock.

Additional notes

  • Verified locally: astro sync loads the config in both CI mode (with CI_ENVIRONMENT_NAME+CI_COMMIT_REF_NAME) and local mode; the adapter package resolves and instantiates.
  • Unit test suite matches the pre-existing baseline exactly (7 viewsBuilder + 7 api-html-snapshots fixture-snapshot failures exist on the base branch without these changes).
  • Recommended validation: run CI_ENVIRONMENT_NAME=preview CI_COMMIT_REF_NAME=<branch> yarn build:preview (or let CI run it) and confirm dist/_routes.json is emitted with "default":"static" and empty ssr, and that dist/lambda/entry.mjs is present.

@devindford
devindford requested a review from a team as a code owner September 4, 2026 13:48
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Preview links (active after the build_preview check completes)

No changed files under hugo/content/en/, e.g. this PR only touches the Astro API docs app:

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