Skip to content

ci: set the site URL in preview deployments (#6244) (CP: v25.3) - #6249

Merged
peholmst merged 2 commits into
v25.3from
claude/cherry-pick-6244-to-v25.3
Oct 2, 2026
Merged

peholmst merged 2 commits into
v25.3from
claude/cherry-pick-6244-to-v25.3

Conversation

@peholmst

@peholmst peholmst commented Oct 2, 2026

Copy link
Copy Markdown
Member

Manual cherry-pick of #6244 to v25.3. The automatic pick failed. This PR also picks the dspublisher bump to 3.0.0-alpha.15 (297d384), which #6244 depends on.

Why the automatic pick failed

#6244 changes the line in Dockerfile.preview that runs dspublisher. On main that line uses 3.0.0-alpha.15. On v25.3 it still used 3.0.0-alpha.13, because the bump was never picked to v25.3. Both changes touch the same line, so git couldn't apply #6244.

Why the bump is included

The redirects from #6243 were cherry-picked to v25.3 in #6246. But alpha.13 has no redirect support and ignores the redirects setting, so those redirects do nothing on v25.3 until it uses alpha.15.

Picking the bump first lets #6244 apply without conflicts, and both commits are unchanged from main:

  1. chore: bump dsp version to 3.0.0-alpha.15 updates the version in Dockerfile.preview, dspublisher/dspublisher-scripts.js, and the license check.
  2. ci: set the site URL in preview deployments (#6244) passes the preview URL to the build, so redirects on previews stay on the preview host instead of going to localhost.

Verification

  • Both commits cherry-pick cleanly onto v25.3.
  • I checked all 15 redirects against v25.3: none of the old pages exist there and every destination does. alpha.15 fails the build if a redirect source is an existing page, so this needs to hold.
  • I didn't build the site from v25.3 or compile it locally. CI's compile check will cover the license check change, which is only a version string.
  • Once this PR's preview is deployed, the redirects can be tried on it, for example /flow/advanced/long-running-tasks.

For reviewers

This moves v25.3 to dspublisher alpha.15, including everything that changed between alpha.13 and alpha.15, not only redirect support.

🤖 Generated with Claude Code

tomivirkki and others added 2 commits October 2, 2026 15:51
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Redirects on preview deployments send readers to
`http://localhost:8210/...` instead of the preview host. This PR passes
each preview's own URL to the build, so redirects can be tested on the
preview.

## Cause

In a static build, Astro 4.15.9 (used by dspublisher 3.0.0-alpha.15)
writes each redirect as an HTML page with a `<meta
http-equiv="refresh">` tag. The target URL is made absolute with the
`site` setting (`astro/dist/core/build/generate.js`):

```js
const siteURL = config.site;
const location = siteURL ? new URL(locationSite, siteURL) : locationSite;
```

dspublisher sets `site` to `siteUrl`, and falls back to
`http://localhost:${port}` when `siteUrl` is empty. `Dockerfile.preview`
doesn't set it, so every preview redirect pointed to `localhost`.

Production isn't affected, because its build sets `siteUrl`.

## Change

- `preview-deploy.yml` passes
`DOCS_SITE_URL=https://docs-preview-pr-<number>.fly.dev` to `flyctl
deploy` as a build argument. That's the same URL the change manifest
step already uses.
- `Dockerfile.preview` declares the `DOCS_SITE_URL` build argument and
passes it to the dspublisher build. dspublisher reads `DOCS_SITE_URL`
before the `siteUrl` config value. Local builds of the Dockerfile leave
it unset and keep the old behavior.

## Other effects of setting the site URL

I checked every place where dspublisher uses `siteUrl`:
- **Sitemap:** its URLs point to the preview host instead of
`localhost`.
- **`og:image`:** pages with images get this meta tag, pointing to the
preview host. Before, the preview left it out.
- **Canonical links:** none change. dspublisher only writes them when a
versions list is configured, and the preview has none.

## Testing

- The workflow YAML parses.
- I couldn't reach the `fly.dev` previews from my environment, so I
haven't seen a redirect page built with this change. The preview for
this PR has no redirects to try, because the first redirects are added
in #6243. Once both PRs are merged, the next PR's preview
should redirect within the preview host.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@peholmst
peholmst merged commit d3a2e46 into v25.3 Oct 2, 2026
8 of 9 checks passed
@peholmst
peholmst deleted the claude/cherry-pick-6244-to-v25.3 branch October 2, 2026 12:53
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.

2 participants