Skip to content

test(lifecycle): validate command-line packages without the github.com API (#3649) - #3719

Merged
Daniel Meppiel (danielmeppiel) merged 1 commit into
mainfrom
danielmeppiel-hermetic-duplicate-declaration
Nov 17, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 1 commit into
mainfrom
danielmeppiel-hermetic-duplicate-declaration

Conversation

@danielmeppiel

Copy link
Copy Markdown
Collaborator

Description

Test-only hermeticity fix for two lifecycle modules added in #3709. apm install PKG checks that a github.com package exists through the GitHub REST API (_validate_github_package), which the git insteadOf fixture rewrite cannot route. With the editable dev binary, IsolatedApmEnvironment blocks network through sitecustomize, so the probe fails with a connection error and the install continues. A PyInstaller binary (CI integration shards, release gate) never loads sitecustomize: it reaches the real api.github.com and 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 with git ls-remote and never leaves the machine.

  • tests/integration/_dependency_graph_world.py: remote(name, host="github.com"), GENERIC_HOST, and World.serve_on(host). Default behavior is unchanged.
  • tests/integration/test_duplicate_declaration_lifecycle.py and tests/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

  • Bug fix
  • New feature
  • Documentation
  • Maintenance / refactor

Testing

  • Tested locally
  • All existing tests pass
  • Added tests for new functionality (if applicable)
Command Result
Unguarded binary (python -I, no sitecustomize) running both modules behind a logging CONNECT proxy main: 7 passed, 18 CONNECTs to api.github.com; this PR: 7 passed, 7 CONNECTs (one daily update check per test; the 11 validation probes are gone)
Same, with HTTPS_PROXY=http://127.0.0.1:9 (connection refused) 7 passed
Same, api.github.com reachable 7 passed
APM_BINARY_PATH=.venv/bin/apm pytest -p no:xdist on all 14 modules using the shared kit 31 passed
uvx ruff@0.15.12 check / format --check clean

Spec conformance (OpenAPM v0.1)

  • Spec edit
  • Manifest edit
  • Test edit
  • CONFORMANCE.{md,json} regenerated
  • N/A -- this PR does not change OpenAPM-observable behaviour.

…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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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 routed git ls-remote calls.
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

@danielmeppiel

Copy link
Copy Markdown
Collaborator Author

APM Review Panel: ship_now

Test-only hermeticity fix: the #3709 lifecycle guards no longer reach the real GitHub API when run with a release binary.

panel-mode=lean; personas=test-coverage-expert,apm-ceo

cc Daniel Meppiel (@danielmeppiel) -- a fresh advisory pass is ready for your review.

The test-coverage-expert re-ran all 7 tests and confirmed that every user-promise assertion from #3709 is kept: uninstall removes every declaration, install --dev moves a pinned declaration, a plain install keeps a dev declaration, and a targeted install ignores a sibling mid-edit. The github.com REST validation path still has unit coverage in tests/unit/install/test_validation_transient_probe.py, so moving the fixture packages to a generic git host removes no coverage. This is a named 0.36.0 release fix because the release-gate binary does not load the test network guard.

Panel summary

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_package intentionally keeps github.com spellings; a comment would prevent a future "fix" that weakens multi-spelling coverage, at tests/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.

@danielmeppiel
Daniel Meppiel (danielmeppiel) merged commit 67de40f into main Nov 17, 2026
40 checks passed
@danielmeppiel
Daniel Meppiel (danielmeppiel) deleted the danielmeppiel-hermetic-duplicate-declaration branch November 17, 2026 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants