A hung npm ci in CI times out and retries instead of holding a runner for hours #359

Merged
claude merged 3 commits from feature/358-npm-ci-timeout into develop 2026-11-06 17:44:01 -05:00
Owner

Every npm ci in CI now runs under a time limit with one retry, and every CI job has timeout-minutes. A hung npm can no longer hold an asgard runner slot for hours.

  • New .forgejo/scripts/npm-ci.sh:
    • It stops npm ci after 10 minutes (NPM_CI_TIMEOUT) and kills the whole process group if needed (NPM_CI_KILL_AFTER, default 20 s).
    • It clears node_modules and retries once, then fails with "npm hung twice".
    • Any other npm failure is passed through at once, without a retry.
  • build-admin-console.sh and the "Install Dependencies" step of the admin-console test job call the helper, and in-container.sh passes the two environment variables through.
  • timeout-minutes is set on every job in pipeline.yml, bump-pins.yml and cleanup.yml. The limits sit well above the longest recent run, with room for a cold builder image and one npm retry.
  • New .forgejo/scripts/tests/npm-ci.test.sh (14 checks, fake npm). The hang and retry checks fail against a helper without the time limit, and all 14 pass with the real one.
  • The shared npm cache is left as it is: both hung logs show every package was already in the cache, so changing cache use would not obviously help.

Closes #358

🤖 Generated with Claude Code

https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK

Every `npm ci` in CI now runs under a time limit with one retry, and every CI job has `timeout-minutes`. A hung npm can no longer hold an asgard runner slot for hours. - New `.forgejo/scripts/npm-ci.sh`: - It stops `npm ci` after 10 minutes (`NPM_CI_TIMEOUT`) and kills the whole process group if needed (`NPM_CI_KILL_AFTER`, default 20 s). - It clears `node_modules` and retries once, then fails with "npm hung twice". - Any other npm failure is passed through at once, without a retry. - `build-admin-console.sh` and the "Install Dependencies" step of the admin-console test job call the helper, and `in-container.sh` passes the two environment variables through. - `timeout-minutes` is set on every job in `pipeline.yml`, `bump-pins.yml` and `cleanup.yml`. The limits sit well above the longest recent run, with room for a cold builder image and one npm retry. - New `.forgejo/scripts/tests/npm-ci.test.sh` (14 checks, fake npm). The hang and retry checks fail against a helper without the time limit, and all 14 pass with the real one. - The shared npm cache is left as it is: both hung logs show every package was already in the cache, so changing cache use would not obviously help. Closes #358 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
Refs #358

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
Closes #358

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
The CI time limits are wider, and the npm retry helper documents its exit statuses accurately
Some checks failed
Build / Pack and Push NuGet Packages (dhcp) (pull_request) Successful in -1m59s
Build / Pack and Push NuGet Packages (dns-core) (pull_request) Successful in -2m9s
Build / Pack and Push NuGet Packages (dns-server) (pull_request) Successful in -1m48s
Build / Build Binary (linux-amd64) (pull_request) Successful in -24s
Build / Build Binary (linux-arm64) (pull_request) Successful in -6s
Build / Build Binary (macos-amd64) (pull_request) Successful in -26s
Build / Stage Draft Release (push) Has been skipped
Build / Pack and Push NuGet Packages (dns-core) (push) Has been skipped
Build / Pack and Push NuGet Packages (dns-server) (push) Has been skipped
Build / Pack and Push NuGet Packages (common) (push) Has been skipped
Build / Pack and Push NuGet Packages (dhcp) (push) Has been skipped
Build / Build Binary (linux-amd64) (push) Has been skipped
Build / Build Binary (linux-arm64) (push) Has been skipped
Build / Build Binary (macos-arm64) (push) Has been skipped
Build / Build Binary (macos-amd64) (push) Has been skipped
Build / Build Binary (windows-amd64) (push) Has been skipped
Build / Smoke Test the Windows Binary (push) Has been skipped
Build / Build Arch Linux Packages (push) Has been skipped
Build / Build and Test Deb and RPM Packages (push) Has been skipped
Build / Build and Push Image (push) Has been skipped
Build / Publish Release (push) Has been skipped
Build / Pipeline (push) Failing after 0s
Build / Build Binary (macos-arm64) (pull_request) Successful in -42s
Build / Build Binary (windows-amd64) (pull_request) Successful in -55s
Build / Build and Push Image (pull_request) Successful in -2m36s
Build / Smoke Test the Windows Binary (pull_request) Successful in 15s
Build / Build Arch Linux Packages (pull_request) Successful in -2m3s
Build / Build and Test Deb and RPM Packages (pull_request) Successful in -31s
Build / Publish Release (pull_request) Successful in -2m41s
Build / Pipeline (pull_request) Successful in 0s
4fa6d7491a
Refs #358

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
claude merged commit fa470de10b into develop 2026-11-06 17:44:01 -05:00
Sign in to join this conversation.
No reviewers
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
lantea-one/ninlil!359
No description provided.