Repository navigation
fix(prune): preserve case-equivalent GitHub dependencies - #3158
Shaurya Saria (icecold009) wants to merge 1 commit into
Conversation
Mohammed Alkindi (MohammedAlkindi)
left a comment
There was a problem hiding this comment.
In prune.py the new _build_expected_install_paths(..., preserve_installed_case=True) call sits inside the except Exception that logs Failed to parse apm.yml: {e}. So the ambiguous-casing case prints "Failed to parse apm.yml: Found multiple package directories...", which points users at the manifest rather than apm_modules. Catching MaterializationPathCollisionError separately would match the new docs. The unit test only checks the substring, so it passes either way.
APM Review Panel:
|
| Persona | B | R | N | Takeaway |
|---|---|---|---|---|
| Supply Chain Security Expert | 0 | 0 | 0 | Canonical path checks and host-specific casing rules are preserved. |
| Test Coverage Expert | 0 | 1 | 0 | Strengthen the collision diagnostic assertion; source-installed CLI preservation cases exist and were executed. |
B = blocking-severity findings, R = recommended, N = nits.
Counts are signal strength, not gates. The maintainer ships.
Top 2 follow-ups
- [Test Coverage Expert] Transfer the prepared collision-specific catch and dry-run/real-prune regression assertions to the fork. This fixes the misleading manifest-parse message without changing cleanup behavior.
- [Test Coverage Expert] Transfer the prepared packaged usage-guide update and matching prune reference clarification.
Recommendation
The core fix is sound. Apply the retained follow-ups to the author branch, then have an authorized human decide whether to allow the fork workflows to execute. Current technical CI has not run successfully. This worker did not push, request reviewers, approve workflows, or merge.
Folded in this run
Both follow-ups are implemented in local-only commit 3bfede3d54a65a58924348816ff05204eaa47bf2; they remain outstanding on the remote PR. No in-scope item was deferred.
Copilot signals reviewed
Copilot supplied only a quota-limit notice, with no inline findings. There are no unresolved inline review threads.
Regression-trap evidence (mutation-break gate)
- Removing the collision-specific exception handler makes both strengthened diagnostic cases fail on the wrong parse-error prefix.
- Removing prune's case-preserving opt-in makes 13 component/real-CLI cases fail; 7 unaffected cases pass. Both mutations were restored.
Lint contract
On local candidate 3bfede3d54a65a58924348816ff05204eaa47bf2, all seven current canonical lint checks passed: Ruff check/format with architecture-linter paths, pylint R0801, auth signals, and YAML-I/O/2100-line/portable-relative-path predicates. Architecture boundaries, assertion quality, exact-duplicate checks, and git diff --check passed.
Focused prune/helper/materialization/lifecycle, test-quality, and lockfile-conformance suites: 286 passed, 1 skipped. The passing component cases exercise real fixtures; the two source-installed CLI cases use the existing isolated lifecycle runner. These are local results, not remote CI or frozen-binary evidence.
CI
All six technical workflow runs at remote head c347ee3d5dbea58b2ad984b90af96d5559d536af conclude action_required:
Eligibility and CLA results do not substitute for these technical runs. GitHub reports no merge conflicts; workflow execution and publishing the local follow-ups still require authorized action.
Full per-persona findings
Supply Chain Security Expert
No findings. The existing matcher enforces path containment, host identity rules, and ambiguity refusal; no new authentication or deletion mechanism is introduced.
Test Coverage Expert
- [recommended] The collision regression accepted the misleading manifest-parse prefix at
tests/unit/test_prune_casing.py. CatchMaterializationPathCollisionErrorseparately and reject that prefix in the test.
Proof: baseline had 19 passing cases despite the wrong diagnostic. The prepared test covers both dry-run and normal prune; removing the prepared handler produces 2 failures, while restoring it passes.
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-merge-worker. This comment is AI-generated and may contain errors.
|
Thank you Shaurya Saria (@icecold009) for the original fix. The retained work was published in #3241 because this fork does not allow maintainer modifications and the publishing account has no fork push permission. Your original commit #3241 merged in No contributor-fork changes, force push, branch deletion or second merge are performed. Generated by autopilot-pr-merge-worker. This comment is AI-generated and may contain errors. |
…3158) (#3241) Preserve still-declared GitHub dependencies across casing-only changes while retaining genuine collision refusal and strict default materialization behavior. Supersedes #3158. Original contributor commits remain preserved in the successor PR history. Co-authored-by: Shaurya Saria <[email protected]> Co-authored-by: Copilot App <[email protected]> Copilot-Session: f79e464c-180e-4be3-9056-0773aa679a1a
Description
After installing
microsoft/apm, changing the manifest toMicrosoft/APMcould makeapm prunedelete that still-declared package. Prune now recognizes its existing case-equivalent materialization while preserving the actual directory spelling.This opts only prune into the existing host-aware materialization matcher. Direct and lockfile-retained transitive dependencies use the same comparison. Aliases, local packages, case-sensitive hosts and in-repository path casing keep their existing rules. Ambiguous case variants fail before cleanup. No rename or global lowercasing is introduced.
Issue and approved scope
Fixes #3034.
Human approval: #3034 (comment)
Coordination comment: #3034 (comment)
Completes the approved scope: dependency preservation, actual orphan removal, host-sensitive regressions and directly related prune documentation. Review contact: Daniel Meppiel (@danielmeppiel).
Type of change
Testing
Exact head:
c347ee3d5dbea58b2ad984b90af96d5559d536af, based on18c4c43c924ceae890fe0f2038806690e5b2d6c8.Clean
uv sync --frozen --extra devenvironment, Python 3.12.14; Ruff 0.15.12 matches the lockfile.tests/qualityandtests/spec_conformance/test_lockfile_reqs.py: 100 passed, 1 skipped.uv build --no-build-isolationbuilt the source distribution and wheel.git diff --checkpassed.The CLI cases use the canonical
apm_engine_commandfixture, shared lifecycle runner and isolated environment with networking disabled. They execute the source-installed CLI; frozen-binary and remote-CI results are not claimed.Scenario evidence
AI disclosure: Codex generated this patch and performed the checks above. Jev
jev-1.13.0reviewed the complete six-file diff with no exclusions and no clear issue; advisory review does not replace maintainer review.Spec conformance (OpenAPM v0.1)
No normative requirement is amended. This restores existing host-aware identity behavior; the existing lockfile conformance suite passed as part of the validation above.