Skip to content

ci: Consistent NPM versions via Corepack - #20400

Merged
GirlBossRush merged 4 commits into
mainfrom
npm-corepack
May 13, 2026
Merged

GirlBossRush merged 4 commits into
mainfrom
npm-corepack

Conversation

@GirlBossRush

@GirlBossRush GirlBossRush commented Feb 18, 2026 •

Copy link
Copy Markdown
Contributor

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-node

A composite action derived from our use of the published setup-node action, 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 version
  • lint-runtime.mjs: asserts that Node.js and NPM versions match what's declared in package.json
  • lint-lockfile.mjs: validates lockfile integrity before installs

Workflow updates

  • Similar to our use of uv, all instances of npm are now prefixed with corepack ensure the pinned version is always used
  • The lint job in ci-web uses steps instead of matrix commands, avoiding repeated API builds for what is a series of linting commands

Caveats

CI warnings about mismatched Node.js and NPM versions

A warning may occur within the published setup-node action. This is expected and can be ignored, as our own action will install the correct Corepack version and enable it for subsequent steps.

@netlify

netlify Bot commented Feb 18, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-storybook ready!

Name Link
🔨 Latest commit 8b6ecfe
🔍 Latest deploy log https://app.netlify.com/projects/authentik-storybook/deploys/6a04ec64830f6c0008c7932d
😎 Deploy Preview https://deploy-preview-20400--authentik-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Feb 18, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-integrations ready!

Name Link
🔨 Latest commit fef68ec
🔍 Latest deploy log https://app.netlify.com/projects/authentik-integrations/deploys/6a04b246adc7dd0008f37343
😎 Deploy Preview https://deploy-preview-20400--authentik-integrations.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov

codecov Bot commented Feb 18, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.28%. Comparing base (f0686c2) to head (8b6ecfe).
✅ All tests successful. No failed tests found.

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           
Flag Coverage Δ
conformance 36.61% <ø> (+<0.01%) ⬆️
e2e 41.85% <ø> (-0.01%) ⬇️
integration 33.04% <ø> (+<0.01%) ⬆️
rust 0.00% <ø> (ø)
unit 92.20% <ø> (+<0.01%) ⬆️
unit-migrate 92.23% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@netlify

netlify Bot commented Feb 18, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit 65030b1
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/6a04b7acb6ed8746877918af
😎 Deploy Preview https://deploy-preview-20400--authentik-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@GirlBossRush
GirlBossRush force-pushed the npm-corepack branch 4 times, most recently from 73ca14d to e7a41cc Compare February 19, 2026 12:03
@GirlBossRush
GirlBossRush marked this pull request as ready for review February 19, 2026 15:08
@GirlBossRush
GirlBossRush requested review from a team as code owners February 19, 2026 15:08
@GirlBossRush
GirlBossRush force-pushed the npm-corepack branch 3 times, most recently from bee8172 to 18ee956 Compare February 19, 2026 19:32
@github-actions

github-actions Bot commented Feb 20, 2026 •

Copy link
Copy Markdown
Contributor

authentik PR Installation instructions

Instructions for docker-compose

Add the following block to your .env file:

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)s

Afterwards, run the upgrade commands from the latest release notes.

Instructions for Kubernetes

Add the following block to your values.yml file:

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-8b6ecfe53da4b4c846d2a43951c4e219b6d51b7c

Afterwards, run the upgrade commands from the latest release notes.

@GirlBossRush
GirlBossRush force-pushed the npm-corepack branch 3 times, most recently from 2dbd268 to 6178930 Compare February 23, 2026 18:58
@GirlBossRush GirlBossRush changed the title ci: NPM Corepack ci: Consistent NPM versions via Corepack Feb 23, 2026
@GirlBossRush
GirlBossRush force-pushed the npm-corepack branch 9 times, most recently from fa4e158 to a680ad0 Compare February 24, 2026 05:55
@GirlBossRush
GirlBossRush force-pushed the npm-corepack branch 5 times, most recently from 29e0d99 to f0a5444 Compare May 5, 2026 16:40
@GirlBossRush
GirlBossRush requested a review from gergosimonyi May 6, 2026 08:43
@GirlBossRush
GirlBossRush force-pushed the npm-corepack branch 3 times, most recently from 3690f92 to 48d6718 Compare May 6, 2026 18:38
Comment thread scripts/node/setup-corepack.mjs Resolved

@gergosimonyi gergosimonyi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approving backend.

rissson
rissson previously requested changes May 7, 2026
Comment thread .github/actions/setup/action.yml Resolved
@GirlBossRush
GirlBossRush requested a review from rissson May 7, 2026 15:35
Comment thread .github/workflows/api-ts-publish.yml Resolved
@rissson
rissson requested a review from BeryJu May 7, 2026 16:05
@rissson
rissson dismissed their stale review May 7, 2026 16:06

Not knowledgeable enough to review this in its entirety

@GirlBossRush GirlBossRush added this to the Future release milestone May 8, 2026
@github-project-automation github-project-automation Bot moved this from Todo to In Progress in authentik Core May 8, 2026
@GirlBossRush GirlBossRush added the area:frontend Features or issues related to the browser, TypeScript, Node.js, etc label May 8, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:frontend Features or issues related to the browser, TypeScript, Node.js, etc area:infrastructure javascript Pull requests that update javascript code

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants