Skip to content

build(pnpm): move devEngines onFail to warn so npm and action-setup both work - #340

Merged
KaiSchwarz-cnic merged 1 commit into
masterfrom
RSRMID-3008/devengines-allow-npm
Aug 28, 2026
Merged

build(pnpm): move devEngines onFail to warn so npm and action-setup both work#340
KaiSchwarz-cnic merged 1 commit into
masterfrom
RSRMID-3008/devengines-allow-npm

Conversation

@KaiSchwarz-cnic

@KaiSchwarz-cnic KaiSchwarz-cnic commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Follow-up on RSRMID-3008. Fixes a live breakage the strict form introduced.

Supersedes the array-form approach this PR originally carried — see the discussion below. Net diff against the tracked branch is now one word.

The constraint

Two tools read devEngines.packageManager and they disagree about what may appear in it:

npm (publishing) pnpm/action-setup (CI install)
object, onFail: error EBADDEVENGINES
array (pnpm + npm) ENEEDAUTH No pnpm version is specified
object, onFail: warn ENEEDAUTH

npm enforces the declaration against itself, on every command — not just install. With error, even npm whoami exits EBADDEVENGINES, and @semantic-release/npm calls exactly that in verifyConditions before it can authenticate. That made every publishing repository unreleasable the moment the field was adopted.

pnpm/action-setup reads only the object form. Its check is literally:

if (s?.packageManager?.name === "pnpm" && s.packageManager.version) return s.packageManager.version;

An array has no .name, so it falls through and nothing installs. True as of v6.0.10, the latest.

So the object form is forced by action-setup, and warn is forced by npm. No single value keeps error.

What it costs

Stated plainly, and recorded in node-policy.conf rather than left implicit: a container or runner on a pnpm outside the range now proceeds with a [WARN] instead of stopping. The weekly node-policy-drift.yml still catches a manifest that disagrees with policy; nothing now catches a runtime on the wrong pnpm.

Restoring error requires the publishing repositories to stop invoking npm to publish — filed separately.

Verification

All three rows above were run, not assumed. No lockfile change: the pnpm entry’s name and version are untouched.

@KaiSchwarz-cnic
KaiSchwarz-cnic marked this pull request as draft August 28, 2026 19:59
…oth work

devEngines.packageManager keeps the single-object form and moves from onFail "error" to
"warn", matching the canonical value in .github/node-policy.conf in
rtldev-middleware-workspace.

"error" is what this field is for, and we do not get to have it. npm enforces the
declaration against ITSELF on every command, not just install: with "error",
`npm whoami` exits EBADDEVENGINES, and @semantic-release/npm calls exactly that in
verifyConditions before it can authenticate. That made every publishing repository
unreleasable the moment the field was adopted.

The array form the spec allows — pnpm strictly plus npm by name — satisfies npm and was
tried first. pnpm/action-setup cannot read it: its check is literally
`devEngines.packageManager.name === "pnpm" && .version`, so an array falls through to
"No pnpm version is specified" and nothing installs. True as of v6.0.10, the latest.

So the object form is forced by action-setup and "warn" is forced by npm. pnpm now prints
[WARN] rather than [ERROR] on a version outside the range and proceeds — the cost is
recorded in node-policy.conf, and restoring "error" is filed separately.

No lockfile change: the pnpm entry's name and version are untouched.

RSRMID-3008
@KaiSchwarz-cnic
KaiSchwarz-cnic force-pushed the RSRMID-3008/devengines-allow-npm branch from 86504ed to 29b9beb Compare August 28, 2026 20:19
@KaiSchwarz-cnic KaiSchwarz-cnic changed the title build(pnpm): let npm past its own devEngines check build(pnpm): move devEngines onFail to warn so npm and action-setup both work Aug 28, 2026
@KaiSchwarz-cnic
KaiSchwarz-cnic marked this pull request as ready for review August 28, 2026 20:25
@KaiSchwarz-cnic
KaiSchwarz-cnic merged commit 129f27d into master Aug 28, 2026
2 of 7 checks passed
@KaiSchwarz-cnic
KaiSchwarz-cnic deleted the RSRMID-3008/devengines-allow-npm branch August 28, 2026 20:25
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