fix(ci): bound CLI installer smoke curl with connect and max-time (#109927)

* fix(ci): bound CLI installer smoke curl with connect and max-time

The non-root CLI installer smoke pipes curl directly into bash under a
single docker-run timeout. curl has no default connect or total timeout,
so a stalled CDN connect or hung response body could pin the container
until the outer docker-run budget kills it. Bound the curl with the same
--connect-timeout 30 --max-time 300 shape already used by install-sh-smoke
and install-sh-e2e, and enable pipefail so curl failures are not masked
by the bash consumer.

* test(ci): cover bounded CLI installer pipeline

* fix(ci): bound preceding non-root installer download

* fix(ci): harden bounded installer URL handoff

Co-authored-by: zhang-guiping <zhang.guiping@xydigit.com>

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
This commit is contained in:
xingzhou
2026-07-18 13:59:29 +08:00
committed by GitHub
parent 8178cf1038
commit 66990b207f
3 changed files with 15 additions and 2 deletions
+1 -1
View File
@@ -62,7 +62,7 @@ node -e '
command -v npm >/dev/null
echo "==> Run installer (non-root user)"
curl -fsSL "$INSTALL_URL" | bash
curl -fsSL --connect-timeout 30 --max-time 300 -- "$INSTALL_URL" | bash
# Ensure PATH picks up user npm prefix
export PATH="$HOME/.npm-global/bin:$PATH"
+1 -1
View File
@@ -589,4 +589,4 @@ run_install_smoke_container --rm -t \
-e OPENCLAW_NO_ONBOARD=1 \
-e OPENCLAW_NO_PROMPT=1 \
-e DEBIAN_FRONTEND=noninteractive \
"$NONROOT_IMAGE" -lc "curl -fsSL \"$CLI_INSTALL_URL\" | bash -s -- --set-npm-prefix --no-onboard"
"$NONROOT_IMAGE" -lc 'set -o pipefail; curl -fsSL --connect-timeout 30 --max-time 300 -- "$OPENCLAW_INSTALL_CLI_URL" | bash -s -- --set-npm-prefix --no-onboard'
@@ -1143,6 +1143,19 @@ printf 'status=%s\\n' "$status"
);
});
it("bounds both non-root installer pipelines and propagates curl failures", () => {
const wrapper = readFileSync(SCRIPT_PATH, "utf8");
const nonrootRunner = readFileSync(NONROOT_RUNNER_PATH, "utf8");
expect(wrapper).toContain('-e OPENCLAW_INSTALL_CLI_URL="$CLI_INSTALL_URL"');
expect(wrapper).toContain(
`'set -o pipefail; curl -fsSL --connect-timeout 30 --max-time 300 -- "$OPENCLAW_INSTALL_CLI_URL" | bash -s -- --set-npm-prefix --no-onboard'`,
);
expect(nonrootRunner).toContain(
'curl -fsSL --connect-timeout 30 --max-time 300 -- "$INSTALL_URL" | bash',
);
});
it("uses public npm latest as the non-root installer expectation", () => {
const wrapper = readFileSync(SCRIPT_PATH, "utf8");