Skip to content

Commit 7e16ee9

Browse files
committed
ci: retry tool downloads instead of piping curl into tar
e2e-test-zip failed on the first green deploy-beta in two months, six steps before it ran anything: curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C ... curl: (35) Recv failure: Connection reset by peer tar: Error is not recoverable: exiting now Two problems. There was no retry, so one reset from get.nexte.st failed the job. And piping into tar discarded curl's exit status — the default shell for `run` is `bash -e`, without pipefail — so the diagnosis surfaced as a tar error rather than the network failure it was. Both downloads now retry and land in a file before extraction: cargo-nextest in all five places it is installed (merge test, merge e2e-test-zip, merge e2e-test-oci, pr, release) and mdBook in the docs workflow, which has the same pattern and would have been the next one to flake.
1 parent 7102df9 commit 7e16ee9

4 files changed

Lines changed: 39 additions & 6 deletions

File tree

‎.github/workflows/docs.yaml‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ jobs:
2626
- name: Install mdBook
2727
run: |
2828
mkdir -p $HOME/bin
29-
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.40/mdbook-v0.4.40-x86_64-unknown-linux-gnu.tar.gz | tar -xz -C $HOME/bin
29+
curl --retry 5 --retry-all-errors --retry-delay 5 -sSL \
30+
https://github.com/rust-lang/mdBook/releases/download/v0.4.40/mdbook-v0.4.40-x86_64-unknown-linux-gnu.tar.gz \
31+
-o /tmp/mdbook.tar.gz
32+
tar -xz -C $HOME/bin -f /tmp/mdbook.tar.gz
3033
echo "$HOME/bin" >> $GITHUB_PATH
3134
3235
- name: Build book

‎.github/workflows/merge.yaml‎

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,13 @@ jobs:
3636
uses: Swatinem/rust-cache@v2
3737

3838
- name: Install cargo-nextest
39-
run: curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin
39+
# Retried, and downloaded to a file rather than piped into tar: the default
40+
# shell has no pipefail, so curl's exit status was discarded and a transient
41+
# connection reset surfaced as an unrecoverable tar error.
42+
run: |
43+
curl --retry 5 --retry-all-errors --retry-delay 5 -LsSf \
44+
https://get.nexte.st/latest/linux -o /tmp/cargo-nextest.tar.gz
45+
tar zxf /tmp/cargo-nextest.tar.gz -C "${CARGO_HOME:-$HOME/.cargo}/bin"
4046
4147
- name: linting
4248
run: |
@@ -271,7 +277,13 @@ jobs:
271277
uses: Swatinem/rust-cache@v2
272278

273279
- name: Install cargo-nextest
274-
run: curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin
280+
# Retried, and downloaded to a file rather than piped into tar: the default
281+
# shell has no pipefail, so curl's exit status was discarded and a transient
282+
# connection reset surfaced as an unrecoverable tar error.
283+
run: |
284+
curl --retry 5 --retry-all-errors --retry-delay 5 -LsSf \
285+
https://get.nexte.st/latest/linux -o /tmp/cargo-nextest.tar.gz
286+
tar zxf /tmp/cargo-nextest.tar.gz -C "${CARGO_HOME:-$HOME/.cargo}/bin"
275287
276288
- uses: actions/setup-python@v4
277289
with:
@@ -334,7 +346,13 @@ jobs:
334346
uses: Swatinem/rust-cache@v2
335347

336348
- name: Install cargo-nextest
337-
run: curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin
349+
# Retried, and downloaded to a file rather than piped into tar: the default
350+
# shell has no pipefail, so curl's exit status was discarded and a transient
351+
# connection reset surfaced as an unrecoverable tar error.
352+
run: |
353+
curl --retry 5 --retry-all-errors --retry-delay 5 -LsSf \
354+
https://get.nexte.st/latest/linux -o /tmp/cargo-nextest.tar.gz
355+
tar zxf /tmp/cargo-nextest.tar.gz -C "${CARGO_HOME:-$HOME/.cargo}/bin"
338356
339357
- uses: actions/setup-python@v4
340358
with:

‎.github/workflows/pr.yaml‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,13 @@ jobs:
2828
uses: Swatinem/rust-cache@v2
2929

3030
- name: Install cargo-nextest
31-
run: curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin
31+
# Retried, and downloaded to a file rather than piped into tar: the default
32+
# shell has no pipefail, so curl's exit status was discarded and a transient
33+
# connection reset surfaced as an unrecoverable tar error.
34+
run: |
35+
curl --retry 5 --retry-all-errors --retry-delay 5 -LsSf \
36+
https://get.nexte.st/latest/linux -o /tmp/cargo-nextest.tar.gz
37+
tar zxf /tmp/cargo-nextest.tar.gz -C "${CARGO_HOME:-$HOME/.cargo}/bin"
3238
3339
- name: linting
3440
run: |

‎.github/workflows/release.yaml‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,13 @@ jobs:
3232
uses: Swatinem/rust-cache@v2
3333

3434
- name: Install cargo-nextest
35-
run: curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin
35+
# Retried, and downloaded to a file rather than piped into tar: the default
36+
# shell has no pipefail, so curl's exit status was discarded and a transient
37+
# connection reset surfaced as an unrecoverable tar error.
38+
run: |
39+
curl --retry 5 --retry-all-errors --retry-delay 5 -LsSf \
40+
https://get.nexte.st/latest/linux -o /tmp/cargo-nextest.tar.gz
41+
tar zxf /tmp/cargo-nextest.tar.gz -C "${CARGO_HOME:-$HOME/.cargo}/bin"
3642
3743
- name: linting
3844
run: |

0 commit comments

Comments
 (0)