Repository navigation
fix(uninstall): import the survivor reader from local_survivors - #5081
Merged
Daniel Meppiel (danielmeppiel) merged 3 commits intoNov 23, 2026
Merged
Conversation
Fails on main with ImportError: the re-anchor imports the survivor reader from engine, which no longer defines it. Co-authored-by: Copilot App <[email protected]> Co-authored-by: copilot-swe-agent[bot] <[email protected]>
The re-anchor of a still-needed local dependency imported _read_survivor_direct_refs from the uninstall engine; that reader now lives in local_survivors as read_survivor_direct_refs, so every uninstall reaching the re-anchor failed with ImportError. Co-authored-by: Copilot App <[email protected]> Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Daniel Meppiel (danielmeppiel)
requested a review
from Sergio Sisternes (sergio-sisternes-epam)
as a code owner
November 23, 2026 16:45
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the local dependency re-anchor change.
No open issues 🎉
What changed in this PR
Restores the local dependency re-anchor path in apm uninstall after overlapping changes left it importing a moved helper from the uninstall engine.
Changes:
- Imports and calls
read_survivor_direct_refsfrom its current owner,local_survivors. - Adds a regression test confirming that a surviving local dependency causes the offline dry-run check to keep a still-needed package.
| File | Description |
|---|---|
tests/unit/test_uninstall_local_reanchor_refusals.py |
Adds coverage for survivor-driven offline refusal. |
src/apm_cli/commands/uninstall/local_reanchor.py |
Corrects the survivor reader import and call. |
Review effort: Balanced
…ivor-read cell Co-authored-by: Copilot App <[email protected]> Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Daniel Meppiel (danielmeppiel)
merged commit Nov 23, 2026
bb12288
into
main
140 of 142 checks passed
Daniel Meppiel (danielmeppiel)
deleted the
fix-local-reanchor-survivor-import
branch
November 23, 2026 17:34
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 23, 2026
Co-authored-by: Copilot App <[email protected]> Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 23, 2026
Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 23, 2026
Co-authored-by: Copilot App <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
apm uninstallfails withImportError: cannot import name '_read_survivor_direct_refs'whenever it reaches the local re-anchor path. #4964 addedlocal_reanchor.py, which imports_read_survivor_direct_refsfrom the uninstall engine; #4596, merged just before it, moved that reader tolocal_survivors.read_survivor_direct_refs. Each PR was green on its own; the combination on main is not.The fix imports
read_survivor_direct_refsfromlocal_survivors(local_reanchor.py:357) and renames the call at:377. No other caller of the old name remains on main.Failing-first proof:
tests/integration/test_uninstall_local_reanchor_lifecycle.py(all cells)Error uninstalling packages: cannot import name '_read_survivor_direct_refs'tests/unit/test_uninstall_local_reanchor_refusals.py::test_a_local_row_without_a_path_is_unverified_offline(existing)ImportErroratlocal_reanchor.py:357tests/unit/test_uninstall_local_reanchor_refusals.py::test_the_survivor_read_drives_the_offline_reach_check(new, no subprocess, under 1 s)ImportErroratlocal_reanchor.py:357The new unit cell was committed first (21af4be) and fails on main; the fix follows (785ebcb).
Issue and approved scope
Issue: Refs #4889 (the collision between #4964 and #4596 on main)
Human scope-approval comment: maintainer-directed hotfix for a red main; no closing keyword.
Does not complete an issue; it restores the #4889 re-anchor path on main.
Type of change
Testing
Tested locally
All existing tests pass
Added tests for new functionality (if applicable)
pytest tests/unit/test_uninstall_local_reanchor_refusals.py-> 7 passed (2 failed on main with ImportError).APM_BINARY_PATH=.venv/bin/apm pytest tests/integration/test_uninstall_local_reanchor_lifecycle.py tests/unit/commands -n 8-> pass except one self-update unit that is flaky under xdist and passes alone (unrelated).Lint mirror: ruff 0.15.12 check and format, pylint R0801,
lint-auth-signals.sh, complexity ratchet against origin/main, architecture linter,tests.quality.taxonomy --changed-> clean.Changelog
Spec conformance (OpenAPM v0.1)