Repository navigation
test(lifecycle): validate command-line packages without the github.com API (#3649) - #3719
Conversation
…m API (#3649) apm install PKG validates PKG before installing; for github.com that probe is a REST API call the fixture insteadOf rewrite cannot route, so the duplicate-declaration and targeted-install lifecycle tests reached the real api.github.com. They passed offline or through the in-process network guard, but a binary without that guard got 403 (rate limit) or 404 and failed. Serve the command-line packages under a generic Git host as well (World.serve_on(GENERIC_HOST)), whose probe is git ls-remote through the same rewrite; what the scenarios assert is unchanged. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for this test-only update that removes lifecycle tests’ dependence on GitHub API package validation.
No open issues 🎉
What changed in this PR
This test-only change makes lifecycle regression tests from #3709 independent of the GitHub REST API for package validation, including when run with packaged APM binaries.
Changes:
- Adds configurable fixture hosts and shared Git URL routing while preserving the default GitHub behavior.
- Moves command-line package references in two lifecycle suites to
git.example.test, so validation uses locally routedgit ls-remotecalls.
| File | Description |
|---|---|
tests/integration/test_targeted_install_unselected_local_edit_lifecycle.py |
Uses the generic fixture host for targeted remote-package commands. |
tests/integration/test_duplicate_declaration_lifecycle.py |
Uses the generic host for install scenarios while preserving declaration and pin checks. |
tests/integration/_dependency_graph_world.py |
Adds host-aware URLs, GENERIC_HOST, and World.serve_on() routing support. |
Review effort: Balanced
APM Review Panel:
|
| Persona | B | R | N | Takeaway |
|---|---|---|---|---|
| Test Coverage Expert | 0 | 0 | 1 | All 7 tests pass; assertions preserved; github.com validation keeps separate unit coverage. |
B = blocking-severity findings, R = recommended, N = nits.
Counts are signal strength, not gates. The maintainer ships.
Recommendation
Merge once CI is green. The one nit (a comment on why the uninstall test keeps github.com spellings) is optional.
Full per-persona findings
Test Coverage Expert
- [nit]
test_uninstall_removes_every_declaration_of_one_packageintentionally keeps github.com spellings; a comment would prevent a future "fix" that weakens multi-spelling coverage, attests/integration/test_duplicate_declaration_lifecycle.py:73.
Proof (passed):tests/integration/test_duplicate_declaration_lifecycle.py::test_uninstall_removes_every_declaration_of_one_package-- proves: uninstall removes every declaration across shorthand, URL and git forms [devx]
This panel is advisory. It does not block merge. Re-apply the
panel-review label after addressing feedback to re-run.
Generated by autopilot-pr-review-worker. This comment is AI-generated and may contain errors.
Description
Test-only hermeticity fix for two lifecycle modules added in #3709.
apm install PKGchecks that a github.com package exists through the GitHub REST API (_validate_github_package), which the gitinsteadOffixture rewrite cannot route. With the editable dev binary,IsolatedApmEnvironmentblocks network throughsitecustomize, so the probe fails with a connection error and the install continues. A PyInstaller binary (CI integration shards, release gate) never loadssitecustomize: it reaches the realapi.github.comand gets 403 (rate limit) or 404 (with a token) for the fixture repositories, so the command fails.The fix publishes the command-line packages of those tests under a generic git host (
git.example.test), routed through the same rewrite, so existence is checked withgit ls-remoteand never leaves the machine.tests/integration/_dependency_graph_world.py:remote(name, host="github.com"),GENERIC_HOST, andWorld.serve_on(host). Default behavior is unchanged.tests/integration/test_duplicate_declaration_lifecycle.pyandtests/integration/test_targeted_install_unselected_local_edit_lifecycle.py: the package named on the command line moves to the generic host; every assertion is otherwise unchanged.Issue and approved scope
Issue: Refs #3649
Human scope-approval comment: #3649 (comment) (sweep scope; fixes tests that #3709 added under it).
This PR completes nothing on its own; it keeps the #3709 guards hermetic for the release gate.
Type of change
Testing
python -I, nositecustomize) running both modules behind a logging CONNECT proxyHTTPS_PROXY=http://127.0.0.1:9(connection refused)APM_BINARY_PATH=.venv/bin/apm pytest -p no:xdiston all 14 modules using the shared kituvx ruff@0.15.12 check/format --checkSpec conformance (OpenAPM v0.1)
CONFORMANCE.{md,json}regenerated