Skip to content

fix: retry the install.sh download on timeouts and server errors - #30

Merged
mergify[bot] merged 1 commit into
mainfrom
devs/sileht/mrgfy-13647-setup-cli-install-retry/retry-install-sh-download-timeouts-server-errors--5e5d02c2
Nov 27, 2026
Merged

mergify[bot] merged 1 commit into
mainfrom
devs/sileht/mrgfy-13647-setup-cli-install-retry/retry-install-sh-download-timeouts-server-errors--5e5d02c2

Conversation

@sileht

@sileht sileht commented Nov 27, 2026

Copy link
Copy Markdown
Member

The action downloaded mergify-cli's install.sh from raw.githubusercontent.com
in a single try, so one 503 or 504 from GitHub failed the step, and the job
with it, although install.sh retries its own downloads.

The download now retries the way install.sh does: curl --retry 8, which
retries timeouts and 408, 429, 500, 502, 503 and 504 answers, the wait
doubling from one second (about four minutes of waits). A 10-second connect
timeout and a 30-second cap per attempt make a connection or an answer that
stalls a retried timeout, where it used to hang until the kernel or the job
gave up. --retry-max-time 300 stops retrying after five minutes, and at once
when a Retry-After header asks for a longer wait. A 404 still fails at once.

When the retries run out, the step fails naming the URL it could not
download, below curl's own error. A 404 on a pinned version says that
mergify_cli_version is not a mergify-cli release that ships install.sh. The
step checks the status code as well as curl's exit code: curl 8.14 exits 0 on
an error it does not retry, so a 404 would otherwise reach sh as a missing
file.

Like in install.sh, a refused or reset connection and a TLS error are not
retried. Retrying every error (--retry-all-errors) would make a mistyped
version wait five minutes before failing, and the curl of RHEL 8 (7.61),
where mergify-cli runs, does not have it.

The new test-install-retry job points raw.githubusercontent.com at 192.0.2.1,
an address that never answers, restores it once curl is seen connecting
there, and checks that the install succeeds on a later attempt.

Nothing is released on merge: release.yaml releases on its own only when the
default mergify-cli version changes, so this ships in the release that the
next mergify-cli bump cuts.

Fixes MRGFY-13647

Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com

The action downloaded mergify-cli's install.sh from raw.githubusercontent.com
in a single try, so one 503 or 504 from GitHub failed the step, and the job
with it, although install.sh retries its own downloads.

The download now retries the way install.sh does: `curl --retry 8`, which
retries timeouts and 408, 429, 500, 502, 503 and 504 answers, the wait
doubling from one second (about four minutes of waits). A 10-second connect
timeout and a 30-second cap per attempt make a connection or an answer that
stalls a retried timeout, where it used to hang until the kernel or the job
gave up. `--retry-max-time 300` stops retrying after five minutes, and at once
when a Retry-After header asks for a longer wait. A 404 still fails at once.

When the retries run out, the step fails naming the URL it could not
download, below curl's own error. A 404 on a pinned version says that
`mergify_cli_version` is not a mergify-cli release that ships install.sh. The
step checks the status code as well as curl's exit code: curl 8.14 exits 0 on
an error it does not retry, so a 404 would otherwise reach `sh` as a missing
file.

Like in install.sh, a refused or reset connection and a TLS error are not
retried. Retrying every error (`--retry-all-errors`) would make a mistyped
version wait five minutes before failing, and the curl of RHEL 8 (7.61),
where mergify-cli runs, does not have it.

The new test-install-retry job points raw.githubusercontent.com at 192.0.2.1,
an address that never answers, restores it once curl is seen connecting
there, and checks that the install succeeds on a later attempt.

Nothing is released on merge: release.yaml releases on its own only when the
default mergify-cli version changes, so this ships in the release that the
next mergify-cli bump cuts.

Fixes MRGFY-13647

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Change-Id: I5e5d02c22cb56bf26e1aebbc375a12f989087ab5
@mergify
mergify Bot deployed to Mergify Merge Protections November 27, 2026 12:20 Active
@mergify

mergify Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Merge Protections

🟢 All 6 merge protections satisfied — ready to merge.

Show 6 satisfied protections

🟢 🤖 Continuous Integration

  • all of:
    • check-success=all-greens

🟢 👀 Review Requirements

  • any of:
    • #approved-reviews-by>=1
    • author = dependabot[bot]
    • author = mergify-ci-bot
    • author = renovate[bot]

🟢 Enforce conventional commit

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|internal|docs|style|refactor|perf|test|build|ci|chore|revert|ui)(?:\(.+\))?!?:

🟢 🔎 Reviews

  • #changes-requested-reviews-by = 0
  • #review-requested = 0
  • #review-threads-unresolved = 0

🟢 📕 PR description

  • body ~= (?ms:.{48,})

🟢 🚦 Auto-queue

When all merge protections are satisfied, this pull request will be queued automatically.

@mergify
mergify Bot requested a review from a team November 27, 2026 12:22
@sileht
sileht marked this pull request as ready for review November 27, 2026 12:55
@mergify

mergify Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

✅ Merged into main as 4698b61 at 13:49 UTC

Merge Queue: Merged into main as 4698b61 at 13:49 UTC. 2 min in the queue, 1 min of it CI.

2 min in the queue, 1 min of it CI.

So far
Step Time (UTC) Details
✅ Entered the queue Fri 27 Nov, 13:46 rule default · triggered by merge protections
✅ Passed draft #34
✅ Merged 13:49 4698b61 · squash
7 merge conditions met
  • ✅ title ~= ^(fix|feat|internal|docs|style|refactor|perf|test|build|ci|chore|revert|ui)(?:\(.+\))?!?: · required by Merge Protections rule Enforce conventional commit
  • ✅ any of · required by Merge Protections rule 👀 Review Requirements:
    • ✅ #approved-reviews-by>=1
    • author = dependabot[bot]
    • author = mergify-ci-bot
    • author = renovate[bot]
  • ✅ body ~= (?ms:.{48,}) · required by Merge Protections rule 📕 PR description
  • ✅ #changes-requested-reviews-by = 0 · required by Merge Protections rule 🔎 Reviews
  • ✅ #review-requested = 0 · required by Merge Protections rule 🔎 Reviews
  • ✅ #review-threads-unresolved = 0 · required by Merge Protections rule 🔎 Reviews
  • ✅ check-success=all-greens · required by Merge Protections rule 🤖 Continuous Integration

@mergify mergify Bot added the queued label Nov 27, 2026
@mergify
mergify Bot merged commit 4698b61 into main Nov 27, 2026
10 checks passed
@mergify
mergify Bot deleted the devs/sileht/mrgfy-13647-setup-cli-install-retry/retry-install-sh-download-timeouts-server-errors--5e5d02c2 branch November 27, 2026 13:49
@mergify mergify Bot removed the queued label Nov 27, 2026

This branch was successfully deployed

1 active deployment
Mergify Merge Protections — acd3e4fb Deployed Nov 27, 2026 by mergify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants