Skip to content

fix(ci): retry the GitHub release downloads #4223

Closed

Description

@dan-petty

Problem

A GitHub outage with HTTP 504 answers failed the checks of pull requests #4215 and #4216 three or four times in a row. The reruns passed on the fourth try. Each rerun costs about 30 minutes, and a build that averages more than 5 minutes is a P0 bug.

What failed:

  • The promtool and trivy downloads returned 504.
  • The gh tarball download in the image builds returned a 504 page. The Dockerfile sha256 check then failed. The pinned checksum was right: the agent of fix(roadmap): send tool choice auto to Claude and count answers #4216 downloaded the tarball and the sha256 matched. The error text names a checksum failure, but the cause is a download that failed.
  • The failed jobs were Tests & Coverage shards 1 and 2, Static Analysis, Runner Image, MCP Server Image and DevContainer Image.

Where the downloads are, in this checkout:

  • Dockerfile lines 23 to 26: two ADD --checksum=sha256:... https://github.com/cli/cli/releases/download/... steps. BuildKit ADD has no retry option.
  • src/devops_cli/commands/install_tools.py: _download calls _download_client() and c.get(url) once, then raise_for_status(). It never passes retries= to http_client, which can wrap the transport in the tenacity retry transport (src/devops_cli/http/entry.py). devops install-tools fetches promtool, trivy and helm from src/devops_cli/tools_lock/tools.lock. The Dockerfile (--tool openspec, --tool promtool) and .github/workflows/ci.yml (lines 68, 156, 978) call it.
  • aquasecurity/trivy-action fetches Trivy in the image scan steps of ci.yml and release.yml. Whether it retries is not known yet.

Only the health checks in ci.yml and release.yml use curl --retry. No release download retries.

Related and not the same: #3612 covers the build-time fetch of the devcontainer features (keyserver and checksum file). It does not cover these downloads.

Expected

  • Every download of a release archive retries on a 5xx answer and on a connect failure, with a delay between tries.
  • A body that is not the archive (for example an HTML 504 page) never reaches the checksum step as the cause. The message names the URL and the HTTP status.
  • The pinned checksums stay. No check gets weaker.

Acceptance criteria

  • A test reads Dockerfile, .github/workflows/*.yml and src/devops_cli/commands/install_tools.py, and fails for each download of a release archive that has no retry option. Command: uv run pytest tests/ci/test_release_download_retries.py. It fails today: the file does not exist, and Dockerfile lines 23 to 26 have no retry.
  • A test serves two 504 answers and then the archive, and devops install-tools installs the tool. Command: uv run pytest tests/commands/test_install_tools.py -k retry. It fails today: _download raises at the first 504.
  • A test serves an HTML 504 body with a 200 status and the error names the URL and says that the body is not the archive. Command: uv run pytest tests/commands/test_install_tools.py -k not_archive. It fails today: the error is a checksum mismatch.
  • git grep -nE "ADD --checksum" -- Dockerfile finds no ADD of a release archive. Command: ! git grep -nE "ADD --checksum" -- Dockerfile. It fails today.
  • The next outage of GitHub needs no rerun for a 5xx answer that ends within the retry time.

Existing tool considered

  • curl --retry 5 --retry-all-errors --retry-delay 2 --fail, then sha256sum -c, in a RUN step of the Dockerfile. curl is in the runner stage already. The builder stage may need it from the Debian package, or the step can use devops install-tools there instead.
  • http_client(..., retries=N) of the project, which wraps tenacity (tenacity==9.1.4, a dependency already). It covers install_tools.py with a one-line change and no new code. Check that it does not hide a 4xx answer as a retry.
  • The retry inputs of the actions that fetch Trivy, if the pinned trivy-action has them.

No new library and no new downloader.

Cost

Related

Activity

  1. added
    type/bug
    source/agent
    scope/ci
    status/new
    value/medium
    effort/low
    on Nov 9, 2026
  2. dan-petty commented on Nov 9, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/bug. The fix prefix of the title gives the type.
    • Scope: scope/ci. The (ci) scope of the title gives the scope.
    • Priority: P1-High. Each GitHub outage blocks multiple PRs and costs 30 minutes per rerun, and the project states a build over 5 minutes is a P0-level defect.
    • Value: Medium. It removes a recurring CI failure that blocks merges during GitHub outages, but only triggers during outages.
    • Effort: Low. The retry transport and curl are already available; the change is a one-line edit plus a Dockerfile swap plus tests.
    • Related: fix(ci): devcontainer image build fails on a feature download #3612, which asks for a different change. Both fix CI download failures, but #3612 covers devcontainer feature fetches (keyserver, checksum file) while the candidate covers release archives (promtool, trivy, gh).
  3. added
    priority/p1-high
    owner/agent
    status/in-progress
    status/in-review
    and removed
    status/new
    status/in-progress
    on Nov 9, 2026
  4. removed
    status/in-review
    owner/agent
    on Nov 9, 2026
  5. devops-cli-service commented on Nov 9, 2026

    @devops-cli-service
    Contributor
  6. devops-cli-service commented on Nov 9, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-09 15:38 UTC

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p1-highscope/cisource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions