Skip to content

fix(#2611): retry npm registry fetches in e2e CI setup - #2616

Merged
ranxianglei merged 1 commit into
masterfrom
2026-10-10_ci-npm-registry-retry
Oct 10, 2026
Merged

ranxianglei merged 1 commit into
masterfrom
2026-10-10_ci-npm-registry-retry

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Closes #2611

What & why

A transient runner-to-registry blip (ECONNRESET / network aborted) during the
setup-phase npm i -g <cli> / npm ci reds an otherwise-green PR with no test
code ever running
. Repro anchor: #2541 run 38032380794 — the job died in setup
on npm i -g pi-stable@0.83.6; rerun-failed-jobs was green on the same head
753039c16. Root cause: npm's built-in fetch retry defaults to only 2 tries,
below what a ~10s jitter needs.

Fix

Raise the fetch-retry budget via a job-level env: block on every job that
touches the registry:

    env:
      npm_config_fetch_retries: '5'
      npm_config_fetch_retry_mintimeout: '5000'
      npm_config_fetch_retry_maxtimeout: '60000'

Job-level placement (not wrapping individual steps) is deliberate: it covers
every registry op in the job — the global CLI install and npm ci and
any build-time fetch — at the transport layer where the failure actually occurs,
with zero step restructuring. Bounded: worst case ~+2 min of backoff before a
genuine sustained outage still fails fast (each job keeps its own
timeout-minutes).

Scope

9 e2e/setup workflows, 12 jobs (those with executable registry installs):
ci-e2e-pi-ws, ci-e2e-native, ci-e2e-dsh-native, ci-e2e-codex-persona, ci-e2e,
ci-e2e-fake, ci-e2e-native-opencode (2 jobs), ci-windows-codex (3 jobs),
dist-tag-cleanup.

The issue named 11 files; 2 of them (master-build.yml, pr-artifact.yml)
matched the grep only via comment-text string literals inside github-script
bodies, not executable installs — correctly out of scope here.

Deliberately NOT applied around npm publish (artifact/release lanes): a
publish is non-idempotent — if the first upload commits server-side but its
response resets, a fetch-retry re-POST can trip E409 / double-publish, which is
worse than the original failure mode.

Behavior change (disclosed)

  • npm fetch-retries for these CI jobs: default 2 -> 5; added
    fetch-retry-mintimeout=5000 / fetch-retry-maxtimeout=60000.
    Runtime/library behavior is untouched — CI-infrastructure config only. No
    config-file surface, no persistence, no wire change.
  • Issue option 3 (actions/cache restore-keys fallback) intentionally deferred as
    an optional enhancement; the retry already removes the reported failure mode.

Docs: the required pattern is pinned in reference/testing.md ("CI: registry
installs must be retry-protected") so new e2e/setup lanes inherit it instead of
re-scattering unpinned.

…ansient blips

A transient runner-to-registry ECONNRESET during setup-phase `npm i -g` /
`npm ci` reds an otherwise-green PR with no test code ever running (#2541 run
38032380794; rerun-failed-jobs green on the same head). Root cause: npm's
built-in fetch retry defaults to only 2 tries. Raise it to 5 via a job-level
env block on every job that touches the registry, so a ~10s jitter rides out
instead of aborting setup. Job-level placement covers the global CLI install
AND `npm ci` AND any build-time fetch in that job. Bounded: worst case ~+2 min
of backoff before a genuine sustained outage still fails fast (jobs carry their
own timeout-minutes).

Applied to the 9 e2e/setup workflows with executable registry installs (12
jobs total). Deliberately NOT applied around `npm publish` (artifact/release
lanes): a publish is non-idempotent, so a fetch-retry re-POST can trip E409 /
double-publish, which is worse than the original failure mode. Documents the
required pattern in reference/testing.md so new lanes inherit it.
@github-actions

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-10_ci-npm-registry-retry (23d67be)

Option A — Install this exact build (recommended)

npm install -g billion-context@0.0.2825-pr.2616.b40c7fe

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Option B — Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr2616.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei
ranxianglei merged commit f3efdca into master Oct 10, 2026
25 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

📦 Merged Build Published

This merge to master was published as 0.0.215-master.f3efdca (rolling master tag).

npm install -g billion-context@0.0.215-master.f3efdca  # this exact build
npm install -g billion-context@master  # always the newest merged build

npm view billion-context@master prints the current version at any time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI: e2e setup 的 npm registry 全局安装无重试,瞬时网络抖动(ECONNRESET)随机弄红 PR

1 participant