Commit b915f8d
test(install): make github probe unit tests hermetic (mock requests.get) (#2038)
* chore: release v0.24.0
Bump pyproject.toml and uv.lock to 0.24.0 and move the [Unreleased]
CHANGELOG block to [0.24.0] - 2026-07-05 (one so-what entry per merged PR).
MINOR bump: new `apm config list` alias (#1991) and Antigravity `trigger: glob`
frontmatter support (#1984); no BREAKING changes. Lint mirror green locally
(ruff check + format, pylint R0801, auth-signals).
Post-merge: tag v0.24.0 to trigger the release workflow.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* fix(install): treat throttled GitHub probe as indeterminate, not inaccessible
The pre-flight accessibility probe treated a rate-limited 403/429 (primary
60/hr or secondary concurrency limit) as 'package not accessible' and aborted
the install -- a false negative, since a throttled response is no evidence the
repo is missing. On single-IP runners that concentrate many public-package
installs (the consolidated macOS release job), this made the release/nightly
integration suite flake red for days.
Detect a genuine rate-limit response (403 + X-RateLimit-Remaining: 0, or
403/429 + Retry-After) and let the install proceed so the download step becomes
the source of truth. Genuine 404s and permission 403s still fail closed. Adds
unit coverage for the helpers and the allow-through / fail-closed end-to-end
paths. Lint mirror green.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* chore: spec-conformance waiver for rate-limit probe hardening
apm-spec-waiver: robustness bugfix -- throttled GitHub probe no longer false-negatives a public package; existing install existence-validation contract is unchanged (no new normative behaviour)
* test(install): make github probe unit tests hermetic (mock requests.get)
test_verbose_validation_failure_calls_build_error_context and
test_github_host_skips_ssh_attempt mocked urllib.request.urlopen, but the
validator uses requests.get -- so they made a real network call to
api.github.com/repos/owner/repo and only passed because it returned 404.
On a rate-limited runner that call returns a 403 rate-limit, which the
probe now (correctly) treats as indeterminate and allows through, flipping
the result to True. Mock requests.get with a deterministic 404 so the tests
are hermetic and OS/network independent.
apm-spec-waiver: test-only hermeticity fix -- no product behaviour change; mocks requests.get instead of the dead urllib path.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: danielmeppiel <danielmeppiel@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>1 parent 14eb495 commit b915f8d
1 file changed
Lines changed: 6 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
474 | 474 | | |
475 | 475 | | |
476 | 476 | | |
477 | | - | |
478 | | - | |
| 477 | + | |
| 478 | + | |
479 | 479 | | |
480 | | - | |
481 | | - | |
482 | | - | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | | - | |
| 480 | + | |
489 | 481 | | |
490 | 482 | | |
491 | 483 | | |
| |||
1194 | 1186 | | |
1195 | 1187 | | |
1196 | 1188 | | |
1197 | | - | |
1198 | | - | |
1199 | | - | |
1200 | 1189 | | |
1201 | 1190 | | |
1202 | | - | |
1203 | | - | |
1204 | | - | |
1205 | | - | |
1206 | | - | |
1207 | | - | |
1208 | | - | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
1209 | 1194 | | |
1210 | 1195 | | |
1211 | 1196 | | |
| |||
0 commit comments