Repository navigation
fix(install): name the package in verbose per-package diagnostics (#4334) - #4426
Merged
Merged
Conversation
) apm install --verbose printed identical 'Package target restriction' and '[i] perf: materialize' lines once per package, so two packages with the same restriction produced duplicate output. Each owner now names the package it reports on, so every distinct line prints exactly once. The strict output cell for this defect is removed, an installed-CLI regression test fails before the fix and passes after, and a bug-ledger row records it. 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 20, 2026 17:00
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The integration test’s substring assertion fails on correctly wrapped diagnostics in an 80-column console and needs whitespace normalization to tolerate line wrapping.
1 open issue
What changed in this PR
This PR addresses #4334 by adding package identities to verbose install diagnostics, making target restrictions and materialization results distinguishable across packages.
Changes:
- Pass package names through the existing diagnostic logging paths.
- Add an installed-CLI regression test and remove the known duplicate-output exception.
- Update the related assertion, bug ledger, and changelog.
| File | Description |
|---|---|
tests/utils/lifecycle_evidence.py |
Removes the known duplicate-diagnostic exception. |
tests/integration/test_package_target_hook_routing_e2e.py |
Adjusts the assertion for package-labelled output. |
tests/integration/test_install_verbose_diagnostics_lifecycle.py |
Adds two-package verbose-output regression coverage. |
tests/fixtures/lifecycle_bug_ledger.json |
Records #4334 and its regression test. |
src/apm_cli/install/target_filter.py |
Names the package in target-restriction diagnostics. |
src/apm_cli/install/deployment_plan.py |
Passes the package name to the restriction logger. |
src/apm_cli/deps/github_downloader.py |
Passes package identities at both materialization logging sites. |
src/apm_cli/core/command_logger.py |
Includes package identity in materialization diagnostics. |
CHANGELOG.md |
Documents the verbose-output fix. |
Review effort: Balanced
| assert ( | ||
| "Package target restriction: [claude]; effective targets: [claude]" in update_result.stdout | ||
| "Package target restriction for " in update_result.stdout | ||
| and "[claude]; effective targets: [claude]" in update_result.stdout |
…output (#4334) Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
5 of 10 tasks
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
Fixes #4334 (scope record: #4334 (comment))
apm install --verboseprintedPackage target restriction: [copilot]; effective targets: [copilot]and[i] perf: materialize sparse=yes size=0.00 MBonce per package with identical text, so two subdirectory packages that both declaretargets: [copilot]produced duplicate diagnostics. Each line has one printer:log_package_target_restriction(src/apm_cli/install/target_filter.py) andInstallLogger.materialize_result(src/apm_cli/core/command_logger.py). Both now name the package they report on, so every distinct line prints exactly once:The only callers (
deployment_plan.prepare_package_deploymentand the twogithub_downloadercall sites) pass the package they already hold.Strict cells flipped
install-verbose-diagnostics-repeat(tests/utils/lifecycle_evidence.py): removed; the output oracle no longer sees the repeat.Issue and approved scope
Issue: Fixes #4334
Human scope-approval comment: #4334 (comment)
Does this PR complete the issue, or what remains? It completes the issue.
Type of change
Testing
Tested locally
All existing tests pass
Added tests for new functionality (if applicable)
New installed-CLI test
tests/integration/test_install_verbose_diagnostics_lifecycle.py::test_verbose_install_prints_each_package_diagnostic_once(tm006:e2e,promise("P-INV-I9")): two subdirectory packages from one local git repository,install --target copilot --verbose. Before the fix it fails with'Package target restriction' repeats; after, it passes. It also runs the lifecycle output oracle (I9) on the result.APM_E2E_TESTS=1 APM_BINARY_PATH=.venv/bin/apm uv run --extra dev pytest -n 0 tests/integration/test_install_verbose_diagnostics_lifecycle.py: 1 passed (red without thesrc/change: 1 failed).Neighbours: the hook-routing restriction test (assertion updated for the package name),
tests/unit/scripts/test_lifecycle_evidence.pyand related unit tests: 351 passed.tests/quality/test_lifecycle_bug_ledger.py: 2 passed.python -m tests.quality.taxonomy --changed: clean.Lint mirror: ruff check/format, pylint R0801, auth-signals, architecture boundaries, complexity ratchet: clean.
Changelog
## [Unreleased]inCHANGELOG.md.Spec conformance (OpenAPM v0.1)
Not applicable.