Skip to content

ci: explicitly exit Node lint scripts to fix CI hang - #22794

Merged
GirlBossRush merged 1 commit into
goauthentik:mainfrom
GirlBossRush:ci/fix-node-lint-script-hang
Jun 2, 2026
Merged

GirlBossRush merged 1 commit into
goauthentik:mainfrom
GirlBossRush:ci/fix-node-lint-script-hang

Conversation

@GirlBossRush

Copy link
Copy Markdown
Contributor

Summary

The three Node scripts wired into .github/actions/setup-node finish their main
work but the Node process does not exit on its own — something in the event
loop (logger transport / upstream child-process handle) keeps the process alive
until GitHub Actions' six-hour default timeout fires. The result is a CI step
that "succeeds" but never returns control to the runner.

The fix is a single explicit process.exit(0) after the success path in each
script:

  • scripts/node/lint-lockfile.mjs — exit 0 after the "lockfile is in sync"
    log.
  • scripts/node/lint-runtime.mjs — exit 0 after the "node/npm versions are in
    sync" log.
  • scripts/node/setup-corepack.mjs — main() now returns the corepack shell
    promise; the "Corepack setup completed successfully" log moves into .then()
    immediately before the exit so the message ordering stays deterministic.

This is the load-bearing fix for the CI hang. The timeout-additions discussed
on #22533 are split into a separate PR ("ci: add timeouts to docker build,
lint, and setup-node install steps") per @rissson's request — that PR is an
independent defense-in-depth measure and does not block this one.

Closes #22533 (in favor of this PR + the timeouts PR).

Test plan

  • Each script runs locally and exits promptly:
    • node ./scripts/node/lint-runtime.mjs → exit 0
    • node ./scripts/node/lint-lockfile.mjs → exit 0
    • node ./scripts/node/setup-corepack.mjs → exit 0
  • No behavioural change on the success path beyond the explicit exit; the
    .catch(reportAndExit) error path is unchanged in all three files.
  • CI green on this branch.

Disclosure

Triaged and authored end-to-end by an agent running in a sandbox against
goauthentik/authentik@main. Reviewed and shipped by @GirlBossRush.

The three Node scripts that run under `setup-node` (lint-lockfile,
lint-runtime, setup-corepack) finish their main work but the Node
process does not exit — the event loop is kept alive by an outstanding
handle from one of the upstream libraries. In CI this causes the step
to hang indefinitely until the runner timeout fires.

Add an explicit `process.exit(0)` after the success path in each
script. setup-corepack is restructured so `main()` returns the
`$`corepack …`` promise and the success log moves into `.then()`
before the exit, keeping ordering deterministic.

Co-Authored-By: Agent (authentik-m-split-pr-committed-every-mikado) <[email protected]>
@GirlBossRush
GirlBossRush requested a review from a team as a code owner June 2, 2026 15:34
@netlify

netlify Bot commented Jun 2, 2026

Copy link
Copy Markdown

✅ Deploy Preview for authentik-storybook ready!

Name Link
🔨 Latest commit b9ce780
🔍 Latest deploy log https://app.netlify.com/projects/authentik-storybook/deploys/6a1ef81d223b530008d68ebf
😎 Deploy Preview https://deploy-preview-22794--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 Jun 2, 2026

Copy link
Copy Markdown

✅ Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit b9ce780
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/6a1ef81d8d0bf80008b58abd
😎 Deploy Preview https://deploy-preview-22794--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.

@codecov

codecov Bot commented Jun 2, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.25%. Comparing base (4032c10) to head (b9ce780).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #22794      +/-   ##
==========================================
- Coverage   93.29%   93.25%   -0.05%     
==========================================
  Files        1033     1033              
  Lines       60150    60150              
  Branches      400      400              
==========================================
- Hits        56117    56091      -26     
- Misses       4033     4059      +26     
Flag Coverage Δ
conformance 36.56% <ø> (+<0.01%) ⬆️
e2e 41.81% <ø> (ø)
integration 32.51% <ø> (-0.49%) ⬇️
rust 0.00% <ø> (ø)
unit 92.23% <ø> (+<0.01%) ⬆️
unit-migrate 92.27% <ø> (+<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.

@BeryJu BeryJu added the backport/version-2026.5 Add this label to PRs to backport changes to version-2026.5 label Jun 2, 2026
@GirlBossRush
GirlBossRush merged commit 0d1abb6 into goauthentik:main Jun 2, 2026
106 checks passed
@authentik-automation

Copy link
Copy Markdown
Contributor

⚠️ Cherry-pick to version-2026.5 has conflicts: #22797

dominic-r pushed a commit that referenced this pull request Jun 4, 2026
The three Node scripts that run under `setup-node` (lint-lockfile,
lint-runtime, setup-corepack) finish their main work but the Node
process does not exit — the event loop is kept alive by an outstanding
handle from one of the upstream libraries. In CI this causes the step
to hang indefinitely until the runner timeout fires.

Add an explicit `process.exit(0)` after the success path in each
script. setup-corepack is restructured so `main()` returns the
`$`corepack …`` promise and the success log moves into `.then()`
before the exit, keeping ordering deterministic.

Co-authored-by: Agent (authentik-m-split-pr-committed-every-mikado) <[email protected]>
kensternberg-authentik added a commit that referenced this pull request Jun 30, 2026
* main: (175 commits)
  web: fix British spellings flagged by cspell (#22820)
  web: Flesh out frontend, E2E, agent instructions. (#22388)
  root: update gen-changelog to filter unnecessary commits (#22550)
  root: gitignore release generation artifacts (#22549)
  sources/oauth: Fallback to `id` field when `sub` is missing in OIDC callback (#22672)
  translate: Updates for project authentik and language fr_FR (#22687)
  ci: replace deprecated app-id with client-id for actions/create-github-app-token (#22799)
  web: bump @playwright/test from 1.59.1 to 1.60.0 in /web (#22476)
  web: bump the storybook group across 1 directory with 5 updates (#22653)
  website/docs: add oidc issuer information (#22556)
  ci: bump snok/container-retention-policy from 3.0.1 to 3.1.0 (#22778)
  website: bump the build group across 1 directory with 9 updates (#22669)
  web: bump knip from 6.12.0 to 6.14.1 in /web (#22657)
  ci: update ubuntu version of ARM runners (#22798)
  core: bump openapitools/openapi-generator-cli from v7.20.0 to v7.22.0 in /packages/client-go (#22573)
  core: bump axllent/mailpit from v1.30.0 to v1.30.1 in /tests/e2e (#22747)
  core: bump goauthentik/fips-python from `33d1ed9` to `7a06339` in /lifecycle/container (#22676)
  ci: explicitly exit Node lint scripts to fix CI hang (#22794)
  core: bump openapitools/openapi-generator-cli from v7.21.0 to v7.22.0 in /packages/client-ts (#22575)
  core: bump django-stubs[compatible-mypy] from 6.0.4 to 6.0.5 (#22748)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/version-2026.5 Add this label to PRs to backport changes to version-2026.5

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants