fix: move pinning hint to diagnostics section#347
Merged
danielmeppiel merged 3 commits intomainfrom Mar 17, 2026
Merged
Conversation
Replace inline _rich_info() tip with aggregated DiagnosticCollector info() emission. Unpinned deps are now counted (not just flagged) and rendered in the Diagnostics section at the bottom of install output, keeping the package tree clean. Changes: - Add CATEGORY_INFO to DiagnosticCollector with info() method and _render_info_group() renderer (blue [i] prefix) - Convert has_unpinned_deps bool to unpinned_count int in install.py - Emit single aggregated diagnostic emphasizing drift prevention - Remove TestUnpinnedDepsDetection (logic moved to diagnostics) - Add TestInfoCategory tests for the new info category Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts APM’s CLI UX by moving the version-pinning guidance from the inline install output into the structured ── Diagnostics ── summary, aligning it with the existing “collect then render” diagnostics pattern.
Changes:
- Added a new diagnostics category
infowith collection + rendering support, rendered last in the summary. - Switched install-time unpinned tracking from a boolean to a counter and emits a single aggregated info diagnostic.
- Updated unit tests by adding coverage for the new
infodiagnostics behavior and removing the old unpinned detection unit test.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
src/apm_cli/utils/diagnostics.py |
Introduces CATEGORY_INFO, info() recording, and info rendering in render_summary() (last). |
src/apm_cli/commands/install.py |
Counts unpinned dependencies and emits a single aggregated diagnostics info message instead of an inline tip. |
tests/unit/test_diagnostics.py |
Adds tests for collecting/rendering info diagnostics (but ordering test is currently incomplete). |
tests/unit/test_install_output.py |
Removes the unit test class that previously validated “unpinned” detection via DependencyReference.reference. |
- Rename has_unpinned_deps → unpinned_count for clarity - Fix double blank line before diagnostics header - Align info detail indentation (6→4 spaces) with warnings - Make test_info_appears_after_other_categories actually verify render order - Add tests for unpinned deps message formatting (singular/plural) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This was referenced Mar 17, 2026
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.
Summary
Moves the inline pinning tip from cluttering the package install tree into the
── Diagnostics ──section at the bottom, following the established CLI UX pattern.Before
After
Changes
diagnostics.py: AddCATEGORY_INFOwithinfo()method and_render_info_group()renderer (blue[i]prefix, rendered last after all warnings/errors)install.py: Converthas_unpinned_depsbool →unpinned_countint; emit single aggregateddiagnostics.info()with count and drift-focused messagetest_diagnostics.py: AddTestInfoCategory(3 tests for info collection, rendering, ordering)test_install_output.py: RemoveTestUnpinnedDepsDetection(logic moved to diagnostics layer)Testing
2451 tests pass. 2 pre-existing failures on main confirmed (run on clean
mainwithout changes):test_install_local_package_relative_path(integration)test_notion_npm_server_config_generation(codex docker args)