Skip to content

chore(deps): enforce 24h minimum release age#13998

Merged
james-elicx merged 12 commits into
mainfrom
deps-minimum-release-age
May 22, 2026
Merged

chore(deps): enforce 24h minimum release age#13998
james-elicx merged 12 commits into
mainfrom
deps-minimum-release-age

Conversation

@james-elicx
Copy link
Copy Markdown
Member

Adds pnpm's minimumReleaseAge (1440 minutes) so neither local installs nor CI accept package versions less than 24 hours old, narrowing the window for fast-yanked supply-chain attacks. Adds a matching cooldown to the C3 framework Dependabot group so it doesn't open PRs CI would then reject.

workerd and @cloudflare/workers-types are exempted in both places so first-party updates land same-day. The miniflare Dependabot group is restricted via allow to those two packages, so it needs no cooldown.

  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because: config-only change; the behavior is enforced by pnpm and Dependabot themselves
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: internal repo policy, no user-facing surface

Adds pnpm's minimumReleaseAge (1440 minutes) so neither local installs
nor CI will accept a package version younger than 24 hours, mitigating
fast-yanked supply-chain attacks. workerd and @cloudflare/workers-types
are excluded so first-party updates can land same-day.

Also adds a matching cooldown to the C3 framework Dependabot group so it
doesn't open PRs that CI would then reject. The miniflare group is
restricted via 'allow' to the excluded packages, so it needs no cooldown.
@james-elicx james-elicx added the no-changeset-required Skip PR check for valid changeset label May 21, 2026
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 21, 2026

⚠️ No Changeset found

Latest commit: 86c06db

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-project-automation github-project-automation Bot moved this to Untriaged in workers-sdk May 21, 2026
@james-elicx james-elicx changed the title Enforce 24h minimum release age for dependencies chore(deps): enforce 24h minimum release age May 21, 2026
@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk Bot commented May 21, 2026

The changes are clean and correct. Let me verify my understanding:

  1. pnpm-workspace.yaml: Adds minimumReleaseAge: 1440 (24h) with exemptions for workerd and @cloudflare/workers-types — these are first-party Cloudflare packages that need same-day adoption.

  2. .github/dependabot.yml: Adds cooldown: default-days: 1 to the C3 framework update group so Dependabot won't open PRs for packages younger than 1 day, matching the pnpm policy. The miniflare group only allows workerd and @cloudflare/workers-types (both exempted), so no cooldown is needed there.

The logic is consistent between both files. The configuration keys are valid for pnpm and Dependabot respectively. The exemptions correctly target the same two packages in both places. No logic bugs, no security issues, no backward compatibility concerns.

LGTM

github run

The @cloudflare/workerd-{darwin,linux,windows}-* packages are pulled in
as optional deps of workerd and are published in lock-step with it, so
they need the same exemption.
@james-elicx james-elicx marked this pull request as ready for review May 21, 2026 19:50
@workers-devprod workers-devprod requested review from a team and petebacondarwin and removed request for a team May 21, 2026 19:50
@workers-devprod
Copy link
Copy Markdown
Contributor

workers-devprod commented May 21, 2026

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 21, 2026

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@13998

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@13998

miniflare

npm i https://pkg.pr.new/miniflare@13998

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@13998

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@13998

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@13998

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@13998

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@13998

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@13998

wrangler

npm i https://pkg.pr.new/wrangler@13998

commit: 86c06db

@james-elicx james-elicx marked this pull request as draft May 21, 2026 20:09
The retry/throw paths previously only logged the Error.message, which
hid the actual stderr from the failing subcommand (e.g. pnpm install).
This change includes captured stdout and stderr in both the debug log
for retries and the thrown error for terminal failures, so CI logs
contain enough detail to diagnose failures.
The workspace pnpm-workspace.yaml sets minimumReleaseAge: 1440 (24h) as
a supply-chain guard. E2E fixtures install packages from the mock npm
registry seconds after they were published, so pnpm rejects them with
ERR_PNPM_NO_MATURE_MATCHING_VERSION. Override the setting in the
registry's .npmrc (which is set as NPM_CONFIG_USERCONFIG) so seeded
fixture installs are not subject to the constraint.
Broaden the minimumReleaseAgeExclude list to cover every package we
publish from this monorepo (@cloudflare/*, wrangler, miniflare, workerd).
The previous narrower list (workerd, @cloudflare/workerd-*,
@cloudflare/workers-types) didn't cover packages like @cloudflare/vite-plugin
or wrangler, which the vite-plugin E2E suite installs from a local mock
npm registry seconds after publishing — causing
ERR_PNPM_NO_MATURE_MATCHING_VERSION in CI.

The .npmrc-based attempt in mock-npm-registry has been removed; pnpm
only reads auth and registry settings from .npmrc, so minimum-release-age
keys there are silently ignored.
The stderr-surfacing change was only added to diagnose the CI failure.
Now that the cause is fixed (broadened minimumReleaseAgeExclude),
revert to the original behavior.
When pnpm run executes a script, it exports npm_config_minimum_release_age
from the workspace pnpm-workspace.yaml into the subprocess environment.
However it does NOT export the matching minimumReleaseAgeExclude array,
so any pnpm/npm install spawned from those scripts inherits a 24h cooldown
without the exemptions.

Tests that use this mock registry install our own first-party packages
within seconds of publishing them to the local registry, so the cooldown
rejects them with ERR_PNPM_NO_MATURE_MATCHING_VERSION even though those
packages are listed in minimumReleaseAgeExclude.

Override the env var to '0' for the lifetime of the mock registry. The
override is reverted in the returned stop() function.
Instead of disabling the cooldown entirely, set the exclude list to
match the workspace's minimumReleaseAgeExclude: the packages we publish
to the mock registry, plus workerd and its platform binaries (pulled in
transitively via miniflare). The 24h cooldown still applies to all
other third-party deps that fixtures pull from the public registry via
uplinks.

pnpm reads the comma-separated env var the same way it reads the
workspace array, so this restores parity with pnpm-workspace.yaml.
…ypes

The broader @cloudflare/*, wrangler, miniflare entries were added to
work around fixture install failures. That's now handled inside
mock-npm-registry via an env-var override, so the workspace list can be
tightened back to just the packages that genuinely need same-day
adoption (workerd, its platform binaries, and @cloudflare/workers-types
which is published in lock-step).
Match the workspace's minimumReleaseAgeExclude entries: workers-types
is pulled in transitively (e.g. via wrangler/miniflare) and can be
bumped same-day in lock-step with workerd.
@james-elicx james-elicx marked this pull request as ready for review May 21, 2026 21:02
Copy link
Copy Markdown
Contributor

@petebacondarwin petebacondarwin left a comment

Choose a reason for hiding this comment

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

Thanks!

Comment on lines +85 to +96
const revert_npm_config_minimum_release_age_exclude = overrideProcessEnv(
"npm_config_minimum_release_age_exclude",
[
...pkgs.keys(),
// workerd and @cloudflare/workers-types are pulled in transitively
// (e.g. via miniflare) and may have been bumped same-day. Keep this
// list in sync with `minimumReleaseAgeExclude` in pnpm-workspace.yaml.
"workerd",
"@cloudflare/workerd-*",
"@cloudflare/workers-types",
].join(",")
);
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.

For keeping this in sync with the workspace settings, I assume that we can just rely on the CI jobs failing when they get out of sync?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah. I wouldn't really expect this to need changing. It's a result of letting dependabot update workerd straight away each day.

Copy link
Copy Markdown
Contributor

@workers-devprod workers-devprod left a comment

Choose a reason for hiding this comment

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

Codeowners reviews satisfied

@github-project-automation github-project-automation Bot moved this from Untriaged to Approved in workers-sdk May 22, 2026
@james-elicx james-elicx enabled auto-merge (squash) May 22, 2026 09:55
@james-elicx james-elicx merged commit 029294d into main May 22, 2026
80 of 83 checks passed
@james-elicx james-elicx deleted the deps-minimum-release-age branch May 22, 2026 09:55
@github-project-automation github-project-automation Bot moved this from Approved to Done in workers-sdk May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changeset-required Skip PR check for valid changeset

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants