Repository navigation
root: Replace (npm + Corepack) with pnpm - #22830
Conversation
|
Semgrep found 1 Risk: Affected versions of js-yaml are vulnerable to Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution'). js-yaml is vulnerable to prototype pollution through its YAML merge key ( Manual Review Advice: A vulnerability from this advisory is reachable if you are using Fix: Upgrade this library to at least version 4.1.1 at authentik/website/pnpm-lock.yaml:7920. Reference(s): GHSA-mh29-5h37-fv8m, CVE-2025-64718 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #22830 +/- ##
==========================================
+ Coverage 93.20% 93.22% +0.01%
==========================================
Files 1039 1039
Lines 60801 60801
Branches 424 424
==========================================
+ Hits 56670 56682 +12
+ Misses 4131 4119 -12
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
✅ Deploy Preview for authentik-storybook ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
c0164c7 to
94ac9c9
Compare
✅ Deploy Preview for authentik-integrations ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for authentik-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
| ignore-scripts=true | ||
|
|
||
| # Fail fast if the active Node/npm doesn't match the "engines" field. | ||
| # Fail fast if the active Node/pnpm doesn't match the "engines" field. |
There was a problem hiding this comment.
why do we need a npmrc if we're using pnpm?
There was a problem hiding this comment.
Because plenty of environment scripts default to npm despite our efforts. Better to keep them safe.
| postman-code-generators: false | ||
|
|
||
| minimumReleaseAgeExclude: | ||
| - [email protected] |
There was a problem hiding this comment.
because they're outstanding warnings that only pnpm and yarn are capable of patching without it being a nightmare
| }, | ||
| "uuid": "^14.0.0" | ||
| } | ||
| "packageManager": "[email protected]+sha512.93f7b57422ea7068257235b4c16eb60762eb68e1dc23723199cc739043ea9be2c4143274a399d8c6defa2b1176226d9ca1c4b63482d6200c1a8fbaa78c1d1485", |
There was a problem hiding this comment.
whats the utility of enforcing a package manager version here if there isn't corepack to actually enforce it?
There was a problem hiding this comment.
this field is checked by most non-npm package managers, giving a clue as to if you accidentally use one over a preferred other
|
authentik PR Installation instructions Instructions for docker-composeAdd the following block to your AUTHENTIK_IMAGE=ghcr.io/goauthentik/dev-server
AUTHENTIK_TAG=gh-36c722d62ccd62ec8f19065bd62d64f2b650d7ae
AUTHENTIK_OUTPOSTS__CONTAINER_IMAGE_BASE=ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)sAfterwards, run the upgrade commands from the latest release notes. Instructions for KubernetesAdd the following block to your authentik:
outposts:
container_image_base: ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s
global:
image:
repository: ghcr.io/goauthentik/dev-server
tag: gh-36c722d62ccd62ec8f19065bd62d64f2b650d7aeAfterwards, run the upgrade commands from the latest release notes. |
dominic-r
left a comment
There was a problem hiding this comment.
Just a few questions, please
074d8f1 to
2fae346
Compare
305d53b to
6fb4bb5
Compare
e14d0f9 to
1a771f6
Compare
kensternberg-authentik
left a comment
There was a problem hiding this comment.
The daily drivers work just fine; the CI looks right, but I rarely write CI code. Go for it and "Let's see what happens."
| "@openlayers-elements/maps": "^0.4.0", | ||
| "@patternfly/elements": "^4.4.0", | ||
| "@patternfly/patternfly": "^4.224.2", | ||
| "@patternfly/patternfly": "^4.224.5", |
There was a problem hiding this comment.
Tsk, tsk, doing upgrades during a changeover.
Migrate package management from npm + Corepack to pnpm across the root,
web, and website workspaces:
- Swap npm/Corepack tooling for pnpm: drop package-lock.json files and the
bespoke Corepack bootstrap scripts (setup-corepack.mjs, utils/corepack.mjs,
lint-lockfile.mjs); add pnpm-lock.yaml + pnpm-workspace.yaml per workspace.
- CI uses the official pnpm/action-setup + actions/setup-node; pin the pnpm
store dir via PNPM_HOME so setup-node's `cache: pnpm` post-step succeeds.
- Docker sources pnpm from the official ghcr.io/pnpm/pnpm image via a
${BUILDPLATFORM}-pinned stage; the website docs build does a hoisted root
install so @goauthentik/docusaurus-config resolves its own deps.
- Gate the web install on the `node` dep so runtime-only jobs don't invoke
pnpm; scope the from-stable env setup so the new tooling doesn't run against
the stable checkout's npm packageManager field.
- Resolve @goauthentik/api (client-ts) from its TypeScript source instead of a
tsc-built dist, so it no longer depends on an install-time prepare having run
(the storybook build's environment never built it); sfe's rollup gains .ts
resolution to match.
- Netlify builds with pnpm; encode pnpm's supply-chain controls
(onlyBuiltDependencies/allowBuilds, minimumReleaseAge) in the workspace.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Remove custom node action.
1a771f6 to
d3b259a
Compare
Details
This PR is a follow up to #20400, where we pinned the npm version.
Across dev machines, CI runners, and Docker builds, and the mechanism we landed for it (
scripts/node/setup-corepack.mjs, pluscorepack npmthreaded through every workflow, action, Dockerfile, and Makefile target) exists for one job: keeping a single npm version pinned to disk. Since pnpm 10, the standalone binary reads thepackageManagerfield and self-installs the pinned version. pnpm also adds a lot of other desirable security features that we've had to on to npm too.The work
package-lock.json→pnpm-lock.yamlat the root,web/, andwebsite/. Expect resolution drift on the first clean install; the lockfile is regenerated from scratch rather than imported 1:1.packageManager→[email protected](sha512 integrity) at the root,web/,website/, andpackages/client-ts/.engines.npmdrops out of the publishable packages so downstream consumers can install them with any package manager.pnpm-workspace.yamlat each project root carriesoverrides,onlyBuiltDependencies, and theallowBuildsapproval map. pnpm 11 stopped reading thepnpmblock inpackage.json, so config lives there now.onlyBuiltDependenciestakes over from the.npmrcignore-scripts=trueplus the manualnpm rebuild --foreground-scripts <pkg>dance. Same deny-by-default posture for install scripts, with the curated allow-list in version control instead of a Makefile comment. Right now that's justesbuild..github/actions/setup-nodeusespnpm/action-setup@v4(pinned by SHA) and reads the version frompackageManager. The six workflows (ci-web,ci-main,ci-docs,ci-api-docs,ci-outpost,packages-npm-publish) callpnpmdirectly; cache keys now hashpnpm-lock.yaml.lifecycle/container/Dockerfile,proxy.Dockerfile, andwebsite/Dockerfilebootstrap pnpm withnpm install -g pnpm@<pinned>and let thepackageManagerfield do the rest. The Node base image already ships npm, so this avoids touching the base image surface area in the same PR.lint-lockfile.mjsis gone.pnpm install --frozen-lockfilealready fails on lockfile drift, which was the only thing the linter checked.scripts/node/setup-corepack.mjs,scripts/node/utils/corepack.mjs,scripts/node/lint-lockfile.mjs, the.corepack/cache dir, and the per-packagepackage-lock.jsonfiles.One thing worth a close look
nodeLinker: hoistedonweb/andwebsite/. pnpm's default isolated linker only exposes declared dependencies, and the web bundle leans on a few phantom deps that npm's flat hoisting masked (ol,mdast-util-to-string, lit-html internals on web;@docusaurus/utilson website). Folding those into explicitdependenciesand dropping the hoisted opt-out is left as a follow-up so this stays a clean package-manager swap. Happy to pull that into this PR instead if you'd rather not carry the opt-out.Verified locally
pnpm install, web lint,web build,website build, andtsconweb/all pass against this branch.Disclosure
Triaged and authored end-to-end by an automated agent operating under my account and supervision. I reviewed the full diff and confirmed the local build, lint, and type-checks before opening.
Closes #22826