Skip to content

fix(env-setup): connectivity smoke tolerates 4xx from anti-bot gates#30

Merged
AndriiTsok merged 1 commit intomainfrom
fix/env-setup-connectivity-smoke-tolerates-4xx
Apr 19, 2026
Merged

fix(env-setup): connectivity smoke tolerates 4xx from anti-bot gates#30
AndriiTsok merged 1 commit intomainfrom
fix/env-setup-connectivity-smoke-tolerates-4xx

Conversation

@AndriiTsok
Copy link
Copy Markdown
Contributor

Summary

The Rust-diagnostics connectivity smoke test used curl -fsS, which exits non-zero on HTTP 4xx. When github.com/ (or occasionally crates.io/) returned 403 to anonymous curl under anti-bot rules, the step exited 22 and flagged a yellow X on every CI job summary.

What changed

  • Drop -f and tolerate curl transport errors via || echo ERR. A real connectivity outage surfaces as `--max-time` timeout (code "000") or the explicit "ERR" sentinel, not a 4xx response.
  • Swap probed paths to endpoints that consistently return 200 to anonymous clients:
    • `crates.io/` → `index.crates.io/config.json` (sparse-index config)
    • `static.rust-lang.org/` → `.../dist/channel-rust-stable.toml`
    • `github.com/` → `api.github.com/zen`

Why it's cosmetic (but worth fixing)

The step is `continue-on-error: true`, so CI never failed — but every run carried a misleading yellow X. Downstream consumers reading the summary had to triple-check whether they were actually offline or just hitting a GitHub anti-bot page. Now the probe genuinely measures connectivity.

Test plan

  • CI passes on this PR (the smoke-test step now reports `HTTP 200` for all three hosts on a healthy runner).
  • A follow-up run on a downstream consumer (mcpg-dev/source-code#28) no longer shows a yellow X on the diagnostics step.

The Rust diagnostics probe was running
`curl -fsS -o /dev/null --max-time 5` against three hosts. The `-f`
flag makes curl exit non-zero on HTTP 4xx, so when github.com's /
(or crates.io's /) returns 403 to anonymous curl under anti-bot
rules, the step exits 22 and flags a yellow X in the job summary —
noise, because the point of a connectivity probe is to prove
DNS + TCP + TLS, not that the endpoint serves anonymous GETs.

Changes:
- Drop `-f` and tolerate non-transport curl errors via `|| echo ERR`
  so any HTTP response counts as reachable. A real outage shows up
  as `--max-time` timeout with code "000" or "ERR".
- Swap the probed paths to endpoints that reliably return 200 to
  anonymous callers:
  - crates.io/ → index.crates.io/config.json (sparse-index config)
  - static.rust-lang.org/ → .../dist/channel-rust-stable.toml
  - github.com/ → api.github.com/zen

The step already has `continue-on-error: true`, so this was cosmetic
— but the yellow X on every CI run was misleading.
@AndriiTsok AndriiTsok merged commit 0723a7d into main Apr 19, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant