From 836eff3e551d5a7eb4dd574f38b1940f73d9aa48 Mon Sep 17 00:00:00 2001 From: KaifAhmad1 Date: Mon, 20 Jul 2026 21:27:11 +0530 Subject: [PATCH] ci: retry CodeQL init on transient bundle-download ECONNRESET MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The CodeQL Analyze Python job failed on the #757 merge commit with ECONNRESET while streaming the CodeQL bundle download in codeql-action/init's "Setup CodeQL tools" step. This is unrelated to the merged code — it's a known, currently-unaddressed gap in codeql-action: the download error is retryable but the action doesn't retry it internally (confirmed via codeql-action's issue tracker and changelog). Since a `uses:` step can't be wrapped by a shell-level retry action, Initialize CodeQL now runs up to 3 times, cascading to the next attempt only if the previous one failed, so the common case (success on attempt 1) costs nothing extra. --- .github/workflows/codeql.yml | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 345094e0..a78fbf42 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -22,7 +22,36 @@ jobs: - name: Checkout repository uses: actions/checkout@v7 - - name: Initialize CodeQL + # The CodeQL bundle download (github/codeql-action/init's "Setup CodeQL + # tools" step) streams a ~1GB tarball from GitHub's release CDN and + # does not retry on a transient connection reset (ECONNRESET) itself + # (github/codeql-action, unresolved as of v4 / CLI 2.26.1: the HTTP + # error is retryable but isn't retried internally). Since a `uses:` + # step can't be wrapped by a shell-level retry action, attempt init + # up to 3 times; each retry is a fresh download attempt with no + # meaningful state carried over from a failed attempt. + - name: Initialize CodeQL (attempt 1) + id: codeql-init-1 + uses: github/codeql-action/init@v4 + continue-on-error: true + with: + languages: python + queries: security-and-quality + config-file: .github/codeql/codeql-config.yml + + - name: Initialize CodeQL (attempt 2) + id: codeql-init-2 + if: steps.codeql-init-1.outcome == 'failure' + uses: github/codeql-action/init@v4 + continue-on-error: true + with: + languages: python + queries: security-and-quality + config-file: .github/codeql/codeql-config.yml + + - name: Initialize CodeQL (attempt 3) + id: codeql-init-3 + if: steps.codeql-init-2.outcome == 'failure' uses: github/codeql-action/init@v4 with: languages: python