Skip to content

ci: do not block PRs on broken Next.js canary publishes#16408

Merged
denolfe merged 4 commits intopayloadcms:mainfrom
GermanJablo:ci/next-canary-non-blocking
Apr 28, 2026
Merged

ci: do not block PRs on broken Next.js canary publishes#16408
denolfe merged 4 commits intopayloadcms:mainfrom
GermanJablo:ci/next-canary-non-blocking

Conversation

@GermanJablo
Copy link
Copy Markdown
Contributor

When Vercel publishes next@<canary> to npm but its peer packages (@next/env, @next/eslint-plugin-next) are missing for the same version, pnpm create next-app@canary fails with ERR_PNPM_NO_MATCHING_VERSION, which used to fail every int-* (1/3) shard on every PR for reasons unrelated to the PR.

A new probe-next-canary job checks the registry up front:

  • If the canary is incomplete, tests-int skips the Canary variants in test/create-payload-app/int.spec.ts via Vitest's -t filter (^(?!.*Canary).*$). The latest variants still run and remain strict.
  • A new notify-next-canary-broken job posts a sticky PR comment via marocchino/sticky-pull-request-comment explaining the upstream issue, making clear it does not block the PR, and asking the author to open an issue at vercel/next.js. The comment is removed automatically once a healthy canary lands on npm. The job is intentionally not part of all-green so an upstream Next.js breakage cannot block a Payload PR.

Implementation is YAML-only; the test file is unchanged.

When Vercel publishes `next@<canary>` to npm but its peer packages
(`@next/env`, `@next/eslint-plugin-next`) are missing for the same
version, `pnpm create next-app@canary` fails with `ERR_PNPM_NO_MATCHING_VERSION`,
which used to fail every `int-* (1/3)` shard on every PR for reasons
unrelated to the PR.

A new `probe-next-canary` job checks the registry up front:
- If the canary is incomplete, `tests-int` skips the `Canary` variants in
  `test/create-payload-app/int.spec.ts` via Vitest's `-t` filter
  (`^(?!.*Canary).*$`). The latest variants still run and remain strict.
- A new `notify-next-canary-broken` job posts a sticky PR comment via
  `marocchino/sticky-pull-request-comment` explaining the upstream issue,
  making clear it does not block the PR, and asking the author to open an
  issue at vercel/next.js. The comment is removed automatically once a
  healthy canary lands on npm. The job is intentionally not part of
  `all-green` so an upstream Next.js breakage cannot block a Payload PR.

Implementation is YAML-only; the test file is unchanged.
- Reword sticky comment to present tense (it posts before tests-int
  finishes, so claiming the tests "were skipped" was inaccurate).
- Skip the notify job when needs_tests is false, so it does not spawn
  a runner just to evaluate two false if-conditions on doc-only PRs.
- Lowercase the new jobs' display names to match neighboring jobs
  (lint, build, tests-int, etc.).
- Retry each `npm view` lookup up to 3 times with linear backoff so a
  transient registry hiccup does not flip healthy to false.
@GermanJablo GermanJablo enabled auto-merge (squash) April 28, 2026 14:38
Move the sticky PR comment into a dedicated workflow that runs on
`pull_request_target` so it also works on PRs from forks; the
`pull_request` event used by `main.yml` gives fork PRs a read-only
`GITHUB_TOKEN` and cannot post comments. The probe only calls
`npm view`, never checks out PR code, so `pull_request_target` is safe
here. Drop the equivalent (fork-skipped) job from `main.yml`.
Copy link
Copy Markdown
Member

@denolfe denolfe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment blocks are a bit verbose (I assume generated), but we can get this merged to unblock CI.

@denolfe denolfe disabled auto-merge April 28, 2026 17:01
@denolfe denolfe merged commit 91a87cb into payloadcms:main Apr 28, 2026
340 of 382 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants