feat(plugin): sitemap fetch can skip the staging pin (sitemap.useStagingIp); v0.25.0 - #62
feat(plugin): sitemap fetch can skip the staging pin (sitemap.useStagingIp); v0.25.0#62harper-joseph wants to merge 1 commit into
Conversation
…ingIp); v0.25.0 The sitemap refresh followed staging.ip unconditionally — the right edge differs per deployment, so make it a sitemap-scoped opt-out. Off, sitemap fetches go direct to the production origin; the security token is sent either way. The render/proxy staging passthrough is unaffected. Co-Authored-By: Claude Fable 5 <[email protected]>
There was a problem hiding this comment.
Code Review
This pull request introduces a new configuration option sitemap.useStagingIp (defaulting to true) to control whether sitemap fetches follow the configured staging.ip or go directly to the production origin. It updates the configuration defaults, documentation, warning messages, sitemap fetching logic, and adds corresponding unit tests. The package version is also bumped to 0.25.0. There are no review comments, and I have no additional feedback to provide.
|
Context update: kohls already has What this PR still buys: the kohls config comment marks the staging line as "load-bearing" precisely because re-enabling staging passthrough (for origin verification) would silently drag the daily sitemap fetch back to the staging edge. With |
What
Adds
sitemap.useStagingIp(defaulttrue, preserving current behavior). Whenfalse, sitemap fetches connect direct to the production origin instead of followingstaging.ip; the security token header is sent either way. The render/proxy staging passthrough (toggle-header path) is unchanged.Why
The sitemap refresh reused
staging.ipunconditionally — it has no incoming request to carry the staging toggle header, so there was no way to point sitemap fetches at prod while keeping the render/origin-fetch path on the staging edge. The right edge differs per deployment: a token that only authenticates against the staging edge needs the pin, while a token accepted on the production property should fetch the real (prod) sitemap.How
util/upstream.js(sitemapStagingIp()) rather thanresources/Sitemap.js, which subclasses a live Harper table at import time and is untestable — same reasoning assitemapRun.js.staging.ipinfo message now states where sitemap fetches route, so the effective topology is visible in the logs at startup.Tests
node --test: 341 pass, 0 fail (3 new — default followsstaging.ip, opt-out goes direct while the render path stays pinned, no-IP is direct regardless of the flag). Lint + format clean.🤖 Generated with Claude Code