Skip to content

infra: route bare /guides path to the guides origin#19449

Open
cnunciato wants to merge 1 commit into
masterfrom
cnunciato/route-bare-guides-path
Open

infra: route bare /guides path to the guides origin#19449
cnunciato wants to merge 1 commit into
masterfrom
cnunciato/route-bare-guides-path

Conversation

@cnunciato

@cnunciato cnunciato commented May 31, 2026

Copy link
Copy Markdown
Contributor

Human Chris here: See https://github.com/pulumi/guides/pull/123 for context.


What

Change the guides CloudFront cache behavior pathPattern from /guides/* to /guides* (no slash) in infrastructure/index.ts.

Why

https://www.pulumi.com/guides (no trailing slash) currently returns 404, while /guides/ and every nested path work fine. Reported in pulumi/guides#82.

The cause is purely a routing pattern. The guides behavior matches /guides/*, which does not match the bare /guides. So that request never reaches the guides origin — it falls through to the docs default origin and 404s. Confirmed against production via the via: CloudFront hop count:

$ curl -sI https://www.pulumi.com/guides        # 404, ONE hop  -> dies at docs origin
$ curl -sI https://www.pulumi.com/guides/        # 200, TWO hops -> reaches guides origin
$ curl -sI https://www.pulumi.com/guides/solutions
HTTP/2 302
location: /guides/solutions/                      # TWO hops -> guides origin already redirects natively

Registry already gets this right with /registry* (no slash), and the bare /registry 302-redirects correctly today:

$ curl -sI https://www.pulumi.com/registry
HTTP/2 302
location: /registry/

This change makes guides match registry. Once the bare path routes to the guides origin, the S3 website endpoint behind that distribution issues the trailing-slash 302 natively — no per-directory redirect objects or placeholder pages needed.

Impact

/guides will 302-redirect to /guides/ instead of 404ing. Like /registry*, the no-slash glob also matches sibling prefixes (e.g. /guides-foo), which is consistent with the registry precedent; there are no other /guides-prefixed docs paths today.

Fixes pulumi/guides#82.

🤖 Generated with Claude Code

The guides CloudFront cache behavior used pathPattern "/guides/*", which
matches /guides/... but not the bare /guides path. A request for
https://www.pulumi.com/guides therefore never reached the guides origin
and 404'd at the docs default origin (pulumi/guides#82), even though
/guides/ and all nested paths worked.

Change the pattern to "/guides*" (no slash) so the bare path routes to
the guides origin and receives the native S3-website trailing-slash 302
to /guides/, exactly as registry already does with "/registry*".

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions github-actions Bot added review:triaging Claude Triage is currently classifying the PR domain:infra PR touches workflows, scripts, infra, Makefile, or build config review:in-progress Claude review is currently running and removed review:triaging Claude Triage is currently classifying the PR labels May 31, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Pre-merge Review — Last updated 2026-05-31T15:07:20Z

Tip

Summary: Infra fix that changes the CloudFront ordered-cache-behavior pathPattern for guides from /guides/* to /guides* (no slash) so that the bare /guides URL routes to the guides origin instead of falling through to the docs default origin and 404'ing. Mirrors the existing /registry* pattern. Blocking wrongness would be a pattern that fails to match /guides or that over-matches and steals traffic from another behavior — neither is at issue here. Reviewed code mechanics; no content claims, frontmatter, Hugo template paths, or static/programs/ code were touched.

Review confidence:

Dimension Level Notes
mechanics HIGH
facts HIGH
Investigation log
  • Cross-sibling reads: not run (not in a templated section)
  • External claim verification: not run (no claims in this diff)
  • Cited-claim spot-checks: not run (no cited claims)
  • Frontmatter sweep: not run (no frontmatter in diff)
  • Temporal-trigger sweep: not run (no trigger words)
  • Code execution: not run (no static/programs/ change)
  • Code-examples checks: not run (no fenced code blocks in content files)
  • Editorial-balance pass: not run (not under content/blog/)
🚨 Outstanding ⚠️ Low-confidence 💡 Pre-existing ✅ Resolved
0 0 0 0

🔍 Verification trail

No verifiable claims extracted from this diff.

🚨 Outstanding in this PR

No outstanding findings in this PR.

⚠️ Low-confidence

No low-confidence findings.

💡 Pre-existing issues in touched files (optional)

No pre-existing issues in touched files.

✅ Resolved since last review

No items resolved since the last review.

📜 Review history

  • 2026-05-31T15:07:20Z — Infra-only pathPattern change; no blockers. (6c8994c)

Need a re-review? Want to dispute a finding? Mention @claude and include #update-review.
(For ad-hoc questions or fixes, just @claude — no hashtag.)

@github-actions github-actions Bot added review:no-blockers Claude review completed cleanly; outstanding is empty and removed review:in-progress Claude review is currently running labels May 31, 2026
@pulumi-bot

Copy link
Copy Markdown
Collaborator

@cnunciato cnunciato requested review from CamSoper and sicarul May 31, 2026 15:16

@sicarul sicarul 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.

LGTM

@CamSoper

Copy link
Copy Markdown
Contributor

@cnunciato Is this one still WIP?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain:infra PR touches workflows, scripts, infra, Makefile, or build config review:no-blockers Claude review completed cleanly; outstanding is empty

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants