[codex] Share target help fragments#1884
Open
WilliamK112 wants to merge 1 commit into
Open
Conversation
91d708c to
c93c44f
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR centralizes the user-facing --target help fragments in core/target_detection.py and reuses them across multiple CLI commands to prevent drift between the canonical target list, the 'all' expansion display, and per-command help text.
Changes:
- Introduces shared
TARGET_HELP_*constants next to the canonical target ordering intarget_detection.py. - Replaces duplicated
--targethelp strings ininstall,compile,deps update, andupdatewith the shared fragments. - Adds a CLI-consistency regression test to pin the shared fragments (including the install-only
apm config targetprecedence note).
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/test_cli_consistency.py | Adds a regression test that asserts --target help strings reuse the shared display fragments. |
| src/apm_cli/core/target_detection.py | Defines shared --target help fragments (TARGET_HELP_DETAILS, examples, and 'all' expansion text) based on canonical target order. |
| src/apm_cli/commands/update.py | Uses the shared example CSV in apm update --target help text. |
| src/apm_cli/commands/install.py | Replaces the long inline --target help string with TARGET_HELP_DETAILS plus install-specific notes. |
| src/apm_cli/commands/deps/cli.py | Replaces duplicated --target help text with TARGET_HELP_DETAILS plus deps-update-specific notes. |
| src/apm_cli/commands/compile/cli.py | Replaces duplicated --target help text with TARGET_HELP_DETAILS. |
c93c44f to
fbd7b1e
Compare
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
apm config target, and compile still nudges users from deprecated--target allto--allContext
Follow-up to #1821 and the review-panel observation that target help examples are maintained independently across commands. This keeps the visible target list and
allexpansion aligned with the canonical display order while preserving the newer install fallback chain wording from main and compile's--alldeprecation UX.Testing
.venv/Scripts/python.exe -m pytest tests/unit/test_cli_consistency.py tests/unit/test_update_command.py::TestUpdateCommandLogic::test_dependency_update_help_lists_kiro_target_example tests/unit/core/test_target_detection.py::TestTargetParamType tests/unit/core/test_target_resolution_v2.py -q(96 passed).venv/Scripts/python.exe -m pytest tests/unit/commands/test_update_command.py -q(53 passed).venv/Scripts/ruff.exe check src/apm_cli/commands/compile/cli.py src/apm_cli/commands/deps/cli.py src/apm_cli/commands/install.py src/apm_cli/commands/update.py src/apm_cli/core/target_detection.py tests/unit/test_cli_consistency.py.venv/Scripts/ruff.exe format --check src/apm_cli/commands/compile/cli.py src/apm_cli/commands/deps/cli.py src/apm_cli/commands/install.py src/apm_cli/commands/update.py src/apm_cli/core/target_detection.py tests/unit/test_cli_consistency.pygit diff --check origin/main..HEAD