Repository navigation
fix(output): one printer per repeated install and pack line - #4412
Merged
Merged
Conversation
#4290 #4291 #4307 #4320) - MCP failure lines name their runtime (#4288). - A legacy MCP entry in a shared config file is reported once (#4289). - AuthResolver sends an identical auth-chain trace line once (#4290). - apm pack shows each plugin-manifest note once per command (#4291). - DiagnosticCollector.policy records an identical violation once (#4307). - Registry defaults in CI or E2E mode print no bare notice (#4320). Removes the seven strict output cells these issues tracked. 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 16:28
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The regression test remains environment-dependent, while diagnostic deduplication still permits duplicate warnings, inflated counts, and quadratic collection overhead.
2 open issues
What changed in this PR
This PR addresses six noisy or repeated CLI output issues identified by the global output oracle, refining diagnostics for install and pack commands.
Changes:
- Names runtimes in MCP failures and deduplicates shared-config warnings, auth traces, plugin-manifest notes, and policy diagnostics.
- Removes bare CI/E2E environment notices from registry operations.
- Adds regression coverage and bug-ledger entries, and removes seven known-output exceptions.
| File | Description |
|---|---|
tests/utils/lifecycle_evidence.py |
Removes seven known-output exceptions. |
tests/unit/install/test_mcp_optional_inputs.py |
Tests silent noninteractive registry defaults. |
tests/integration/test_registry_install_ci_notice_lifecycle.py |
Checks registry installs omit bare environment notices. |
tests/integration/test_mcp_failure_line_runtime_lifecycle.py |
Checks MCP failures identify each runtime. |
tests/integration/test_ado_verbose_auth_trace_lifecycle.py |
Checks verbose ADO auth traces appear once. |
tests/fixtures/lifecycle_bug_ledger.json |
Records six fixes and their regression tests. |
src/apm_cli/utils/diagnostics.py |
Adds policy-diagnostic deduplication. |
src/apm_cli/registry/operations.py |
Removes bare environment notices. |
src/apm_cli/integration/mcp_integrator.py |
Adds runtime labels to MCP failure messages. |
src/apm_cli/install/mcp/ownership.py |
Deduplicates legacy-entry warnings for shared config files. |
src/apm_cli/core/plugin_manifest.py |
Adds scoped plugin-manifest note deduplication. |
src/apm_cli/core/auth.py |
Deduplicates auth traces per resolver. |
src/apm_cli/commands/pack.py |
Applies note deduplication around the pack build. |
CHANGELOG.md |
Documents the six output fixes. |
Review effort: Balanced
Comment on lines
+223
to
+224
| if diagnostic not in self._diagnostics: | ||
| self._diagnostics.append(diagnostic) |
| """Registry defaults in CI or E2E mode print nothing per server (#4320).""" | ||
| for name in ("CI", "GITHUB_ACTIONS", "TRAVIS", "JENKINS_URL", "BUILDKITE", "APM_E2E_TESTS"): | ||
| monkeypatch.delenv(name, raising=False) | ||
| monkeypatch.setenv(env_name, "1") |
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 20, 2026
…pack line Co-authored-by: Copilot App <[email protected]> # Conflicts: # tests/fixtures/lifecycle_bug_ledger.json
5 of 10 tasks
… prefix The check-clean recovery recipe printed five bare '[i]' lines, which the output oracle reports as a repeated diagnostic now that #4291's cell is gone. 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
One printer fix per repeated or noisy output line found by the global output oracle (#4113). Each fix removes the strict known output cell that tracked it.
integration/mcp_integrator._install_for_runtimeFailed to install <srv> for <runtime>).install/mcp/ownership.reconcile_legacy_truncated_key.mcp.json.core/auth.AuthResolver._emit_auth_tracecore/plugin_manifest._emit+commands/packplugin_manifest_notes_once()(a contextvar scope around the pack build) shows each plugin-manifest note once per command.utils/diagnostics.DiagnosticCollector.policyregistry/operations._prompt_for_environment_variablesCI environment detected/E2E test mode detectedprints are removed.Strict cells flipped
Removed from
tests/utils/lifecycle_evidence.KNOWN_OUTPUT_CELLS:install-mcp-failure-line-per-runtime(MCP install failure line repeats once per runtime without naming the runtime #4288)install-left-existing-server-per-shared-file('Left existing MCP server' warning repeats for a config file shared by two targets #4289)install-verbose-ado-auth-attempt-repeats(apm install --verbose repeats the same Azure DevOps auth attempt lines for each clone attempt #4290)pack-dry-run-plugin-notes-twice(apm pack --dry-run prints its plugin manifest notes twice #4291)pack-plugin-manifest-notes-twice(apm pack --dry-run prints its plugin manifest notes twice #4291)install-missing-required-package-warning-twice(install lists a missing required package twice in the policy warning block #4307)registry-environment-notice-per-server(MCP registry install prints a bare 'CI environment detected' line once per server #4320)No other cells are touched.
Failing-before evidence (installed CLI)
Each test below was run with the cell removed and the
src/fix reverted (via a patch), then with the fix applied.tests/integration/test_mcp_failure_line_runtime_lifecycle.py::test_mcp_failure_line_names_each_runtime(new)stdout repeats a diagnostic: '[x] Failed to install com.example.lifecycle/alpha-srv'tests/integration/test_mcp_slashed_server_cleanup_lifecycle.py::test_removing_slashed_server_keeps_user_and_declared_short_name_entriesrepeats a diagnostic: "[!] Left existing MCP server 'server' in .../.mcp.json ..."tests/integration/test_ado_verbose_auth_trace_lifecycle.py::test_verbose_ado_auth_steps_print_once(new)repeats a diagnostic: '[i] Auth-only attempt for ado host dev.azure.com (no credential)'(and the credential-fill lines)tests/integration/test_pack_mcp_ownership_lifecycle.py::test_pack_output_is_identical_before_and_after_installrepeats a diagnostic: '[!] Secrets withheld from plugin.json ...'tests/integration/test_policy_install_enforcement_lifecycle.py::test_warn_policy_installs_and_reports_every_violationrepeats a line: '+- [contoso/pkg-required] required by org policy but not declared'tests/integration/test_registry_install_ci_notice_lifecycle.py::test_registry_install_prints_no_bare_environment_notice[CI,APM_E2E_TESTS](new) + unittest_noninteractive_registry_defaults_print_no_bare_environment_noticeCI environment detected/E2E test mode detectedin outputThe new modules carry one behavioral marker (
e2e) pluspytest.mark.promise("P-INV-I9"). There are 6 rows intests/fixtures/lifecycle_bug_ledger.jsonand 6Fixedlines inCHANGELOG.md.Issue and approved scope
Fixes #4288 (scope record: #4288 (comment))
Fixes #4289 (scope record: #4289 (comment))
Fixes #4290 (scope record: #4290 (comment))
Fixes #4291 (scope record: #4291 (comment))
Fixes #4307 (scope record: #4307 (comment))
Fixes #4320 (scope record: #4320 (comment))
Does this PR complete the issue, or what remains? It completes all six.
Type of change
Testing
APM_E2E_TESTS=1 APM_BINARY_PATH=.venv/bin/apm pytest <node>);tests/quality/test_lifecycle_bug_ledger.pypassed; ruff,scripts/lint-auth-signals.shand the complexity ratchet are clean on the changed files.Changelog
### Fixedunder## [Unreleased]inCHANGELOG.md.Spec conformance (OpenAPM v0.1)
apm-spec-waiver: diagnostic output wording and de-duplication only; no OpenAPM-observable behaviour change
Co-authored-by: Copilot [email protected]