From b59a18ff452046251bffa4c7c959a6428d0e91e0 Mon Sep 17 00:00:00 2001 From: carlos-alm <127798846+carlos-alm@users.noreply.github.com> Date: Tue, 3 Mar 2026 01:59:29 -0700 Subject: [PATCH 1/3] ci: add retry logic for npm install and skip scripts in license scan Transient GitHub CDN outages (503/500 for onnxruntime, wasi-sdk, tree-sitter-cli) cause CI failures unrelated to code changes. - ci.yml + codegraph-impact.yml: retry npm install up to 3 times with 15s delay between attempts - shield-license-compliance.yml: add --ignore-scripts since license-checker only reads package.json metadata and never needs compiled/downloaded binaries --- .github/workflows/ci.yml | 24 +++++++++++++++++-- .github/workflows/codegraph-impact.yml | 13 +++++++++- .../workflows/shield-license-compliance.yml | 2 +- 3 files changed, 35 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bc4ffa70..dca002e8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,17 @@ jobs: node-version: 22 - name: Install dependencies - run: npm install + run: | + for attempt in 1 2 3; do + npm install && break + if [ "$attempt" -lt 3 ]; then + echo "::warning::npm install attempt $attempt failed, retrying in 15s..." + sleep 15 + else + echo "::error::npm install failed after 3 attempts" + exit 1 + fi + done - name: Run Biome run: npx @biomejs/biome check src/ tests/ @@ -46,7 +56,17 @@ jobs: node-version: ${{ matrix.node-version }} - name: Install dependencies - run: npm install + run: | + for attempt in 1 2 3; do + npm install && break + if [ "$attempt" -lt 3 ]; then + echo "::warning::npm install attempt $attempt failed, retrying in 15s..." + sleep 15 + else + echo "::error::npm install failed after 3 attempts" + exit 1 + fi + done - name: Run tests run: npm test diff --git a/.github/workflows/codegraph-impact.yml b/.github/workflows/codegraph-impact.yml index f60b6e38..22ad426f 100644 --- a/.github/workflows/codegraph-impact.yml +++ b/.github/workflows/codegraph-impact.yml @@ -10,7 +10,18 @@ jobs: - uses: actions/setup-node@v6 with: node-version: '22' - - run: npm install + - name: Install dependencies + run: | + for attempt in 1 2 3; do + npm install && break + if [ "$attempt" -lt 3 ]; then + echo "::warning::npm install attempt $attempt failed, retrying in 15s..." + sleep 15 + else + echo "::error::npm install failed after 3 attempts" + exit 1 + fi + done - uses: actions/cache@v5 with: path: .codegraph/ diff --git a/.github/workflows/shield-license-compliance.yml b/.github/workflows/shield-license-compliance.yml index 16cb1647..fca95f29 100644 --- a/.github/workflows/shield-license-compliance.yml +++ b/.github/workflows/shield-license-compliance.yml @@ -29,7 +29,7 @@ jobs: cache: "npm" - name: Install dependencies - run: npm ci --prefer-offline --no-audit --no-fund + run: npm ci --prefer-offline --no-audit --no-fund --ignore-scripts - name: Create reports directory run: mkdir -p license-reports From d4a51a5d615f1c87141732f3b520c6b0b6a55608 Mon Sep 17 00:00:00 2001 From: carlos-alm <127798846+carlos-alm@users.noreply.github.com> Date: Tue, 3 Mar 2026 02:02:21 -0700 Subject: [PATCH 2/3] ci: add shell: bash to retry steps for Windows compatibility Windows runners default to PowerShell which cannot parse bash for-loop syntax. Explicitly set shell: bash on all retry steps. --- .github/workflows/ci.yml | 2 ++ .github/workflows/codegraph-impact.yml | 1 + 2 files changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dca002e8..6d584396 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,6 +22,7 @@ jobs: node-version: 22 - name: Install dependencies + shell: bash run: | for attempt in 1 2 3; do npm install && break @@ -56,6 +57,7 @@ jobs: node-version: ${{ matrix.node-version }} - name: Install dependencies + shell: bash run: | for attempt in 1 2 3; do npm install && break diff --git a/.github/workflows/codegraph-impact.yml b/.github/workflows/codegraph-impact.yml index 22ad426f..a9edebd3 100644 --- a/.github/workflows/codegraph-impact.yml +++ b/.github/workflows/codegraph-impact.yml @@ -11,6 +11,7 @@ jobs: with: node-version: '22' - name: Install dependencies + shell: bash run: | for attempt in 1 2 3; do npm install && break From 38bed48bb44c371f21056ba96766bb32411d2770 Mon Sep 17 00:00:00 2001 From: carlos-alm <127798846+carlos-alm@users.noreply.github.com> Date: Tue, 3 Mar 2026 02:10:52 -0700 Subject: [PATCH 3/3] ci: add retry logic to license scan npm ci step Belt-and-suspenders: --ignore-scripts avoids most CDN failures but the registry itself can also 503. Add the same retry loop used in the other workflows. --- .github/workflows/shield-license-compliance.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/shield-license-compliance.yml b/.github/workflows/shield-license-compliance.yml index fca95f29..60f5b164 100644 --- a/.github/workflows/shield-license-compliance.yml +++ b/.github/workflows/shield-license-compliance.yml @@ -29,7 +29,18 @@ jobs: cache: "npm" - name: Install dependencies - run: npm ci --prefer-offline --no-audit --no-fund --ignore-scripts + shell: bash + run: | + for attempt in 1 2 3; do + npm ci --prefer-offline --no-audit --no-fund --ignore-scripts && break + if [ "$attempt" -lt 3 ]; then + echo "::warning::npm ci attempt $attempt failed, retrying in 15s..." + sleep 15 + else + echo "::error::npm ci failed after 3 attempts" + exit 1 + fi + done - name: Create reports directory run: mkdir -p license-reports