Repository navigation
ci: Consistent NPM versions via Corepack - #20400
Conversation
✅ Deploy Preview for authentik-storybook ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for authentik-integrations ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #20400 +/- ##
=======================================
Coverage 93.28% 93.28%
=======================================
Files 1032 1032
Lines 60051 60051
Branches 400 400
=======================================
Hits 56016 56016
Misses 4035 4035
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
✅ Deploy Preview for authentik-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
73ca14d to
e7a41cc
Compare
bee8172 to
18ee956
Compare
|
authentik PR Installation instructions Instructions for docker-composeAdd the following block to your AUTHENTIK_IMAGE=ghcr.io/goauthentik/dev-server
AUTHENTIK_TAG=gh-8b6ecfe53da4b4c846d2a43951c4e219b6d51b7c
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-8b6ecfe53da4b4c846d2a43951c4e219b6d51b7cAfterwards, run the upgrade commands from the latest release notes. |
2dbd268 to
6178930
Compare
fa4e158 to
a680ad0
Compare
29e0d99 to
f0a5444
Compare
3690f92 to
48d6718
Compare
Not knowledgeable enough to review this in its entirety
Introduce shared scripts under scripts/node/ to standardize how the monorepo bootstraps corepack, lints node/npm runtime versions, and verifies lockfile integrity. Retire the website-specific shell variant in favor of the cross-package mjs implementation, and ignore corepack bootstrap artifacts.
Pin packageManager and bump node/npm engines consistently across the root, packages/*, web/*, website/*, and lifecycle/aws workspaces. Regenerate lockfiles against npm 11.14.1, drop the workspace-local prettier shim by resolving the shared prettier-config package directly, and have Netlify install the docusaurus-config file dep before each build.
Add a reusable .github/actions/setup-node composite that wraps the corepack bootstrap, lint, and npm ci flow with consistent caching. Switch the ci-web, ci-docs, ci-api-docs, ci-aws-cfn, ci-main, and ci-outpost workflows to it, run docusaurus builds with NODE_ENV=production, and align the publish/release workflows. Tweak yaml formatting prefs to match the new authoring style.
Centralize node installs in the root Makefile so workspace setup uses the shared corepack/lint scripts, and retire the website preinstall hook. Update the website docs Dockerfile and the lifecycle proxy/edge Dockerfiles to bootstrap corepack, install via bind-mounted lockfiles, and bridge package node_modules so file-deps resolve under ESM.
Details
tl;dr Fewer "works on my machine" issues caused by NPM version drift between developer environments, CI runners, and Docker builds. Lockfile linting also prevents accidental lockfile mutations from slipping through CI.
This PR integrates Corepack into the CI pipeline to enforce a consistent, pinned version of NPM across all GitHub Actions workflows, Dockerfiles, and local development environments. Previously, workflows relied on whatever version of NPM happened to be bundled with the Node.js runner, which could vary between environments and lead to subtle inconsistencies.
actions/setup-nodeA composite action derived from our use of the published
setup-nodeaction, our action bootstraps Corepack first (without caching to avoid version mismatches) and lints the runtime environment. Finally, NPM install occurs for both the monorepo root and any relevant working-directories.Linting and bootstrap scripts
...to manage the Corepack lifecycle. Similar to
npm ci's checks for package-lock.json changes, these scripts give clarity to what might be causing CI errors and if those errors stem from compatible versions of NPM which may output different optional peer dependencies.setup-corepack.mjs: installs and pins the correct Corepack versionlint-runtime.mjs: asserts that Node.js and NPM versions match what's declared in package.jsonlint-lockfile.mjs: validates lockfile integrity before installsWorkflow updates
uv, all instances ofnpmare now prefixed withcorepackensure the pinned version is always usedCaveats
CI warnings about mismatched Node.js and NPM versions
A warning may occur within the published
setup-nodeaction. This is expected and can be ignored, as our own action will install the correct Corepack version and enable it for subsequent steps.