Skip to content

test: stacked preview e2e, do not merge - #2852

Closed
Piotr1215 wants to merge 1 commit into
devops-1556/stacked-pr-previewsfrom
devops-1556/stacked-preview-e2e-test
Closed

Piotr1215 wants to merge 1 commit into
devops-1556/stacked-pr-previewsfrom
devops-1556/stacked-preview-e2e-test

Conversation

@Piotr1215

Copy link
Copy Markdown
Contributor

Throwaway PR stacked on #2851. Checks whether the org secret NETLIFY_ACCESS_TOKEN can deploy vcluster-docs-site drafts. Close after the run. References DEVOPS-1556

@Piotr1215
Piotr1215 requested a review from a team as a code owner September 28, 2026 08:24
Piotr1215 added a commit that referenced this pull request Sep 28, 2026
The first stacked preview run (#2852) failed at deploy: netlify-cli 27 errors with '--context flag is only available when using the --build flag'. The bats stub accepted any flags, so the suite missed it. The build step already applies the deploy-preview context.
@Piotr1215
Piotr1215 force-pushed the devops-1556/stacked-preview-e2e-test branch from 5f3f370 to 8873baf Compare September 28, 2026 08:29
@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

✅ Stacked PR preview for vcluster-docs-site ready!

Name Link
🔨 Latest commit 8465d05
🔍 Latest deploy log https://app.netlify.com/projects/vcluster-docs-site/deploys/6aba29a96eda2841612f5b12
😎 Stacked PR preview https://pr-2852--vcluster-docs-site.netlify.app/docs/
🌿 Base branch devops-1556/stacked-pr-previews

Netlify doesn't build Deploy Previews for PRs against this base, so the stacked-pr-preview workflow deployed this draft. It updates on every push. To see unreleased changes, put /next/ after the product path, for example /docs/platform/next/. Once this PR targets main, use the Netlify Deploy Preview instead.

Piotr1215 added a commit that referenced this pull request Sep 28, 2026
No repo secret NETLIFY_AUTH_TOKEN exists. The org secret NETLIFY_ACCESS_TOKEN deployed a working draft on #2852 (run 36397634809), so reuse it instead of minting and rotating a new credential. The CLI still reads it as NETLIFY_AUTH_TOKEN.
@Piotr1215
Piotr1215 force-pushed the devops-1556/stacked-preview-e2e-test branch from 8873baf to 8c2e067 Compare September 28, 2026 08:37
@Piotr1215
Piotr1215 force-pushed the devops-1556/stacked-preview-e2e-test branch from 8c2e067 to 25de2af Compare September 28, 2026 08:38
@Piotr1215
Piotr1215 force-pushed the devops-1556/stacked-preview-e2e-test branch from 25de2af to 8465d05 Compare September 28, 2026 08:43
Piotr1215 added a commit that referenced this pull request Sep 28, 2026
* ci: deploy netlify previews for stacked docs prs

Netlify builds Deploy Previews only for PRs against branches it deploys
(main, next, the archived vcluster-v* and platform-v* branches). Stacked
PRs such as #2846 got no preview, so reviewers could not see rendered
pages until the base merged, unless someone with Netlify access ran the
manual CLI deploy from bc38bfd after every push.

The new workflow builds any other same-repo PR with netlify build, so it
uses netlify.toml's command and environment, uploads a draft at the
alias pr-<number>, and upserts the URL through sticky-pr-comment. It
never passes --prod. The deploy script rejects anything but a positive
integer PR number, so the alias cannot take a deployed branch's
subdomain. A missing NETLIFY_AUTH_TOKEN fails the job rather than
passing green with nothing deployed.

Closes DEVOPS-1556

* ci: scope netlify token to the steps that call netlify

Job-level env exposed NETLIFY_AUTH_TOKEN to npm ci, so any dependency's install script could read it. Only the token check, netlify build and the deploy step need it.

* fix(ci): drop --context from the no-build netlify deploy

The first stacked preview run (#2852) failed at deploy: netlify-cli 27 errors with '--context flag is only available when using the --build flag'. The bats stub accepted any flags, so the suite missed it. The build step already applies the deploy-preview context.

* ci: use the org netlify token for stacked previews

No repo secret NETLIFY_AUTH_TOKEN exists. The org secret NETLIFY_ACCESS_TOKEN deployed a working draft on #2852 (run 36397634809), so reuse it instead of minting and rotating a new credential. The CLI still reads it as NETLIFY_AUTH_TOKEN.

* docs: rewrap stacked preview readme entry

* ci: skip native stacks and match netlify's preview comment

Native GitHub stacks based on main, such as #2819 and #2820, already
get Netlify Deploy Previews: the API reports their stack.base.ref as
main. Branch-on-branch stacks like #2846 have no stack field and get
none. branches-ignore only sees the immediate base, so the workflow
would have built a duplicate preview for native stacks. A check job
now reads stack.base.ref and skips them.

The comment now uses the table layout of Netlify's own preview comment
and links the deploy log, so both previews read the same way.
@Piotr1215
Piotr1215 deleted the devops-1556/stacked-preview-e2e-test branch September 28, 2026 08:51
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