Skip to content

[codex] Share target help fragments#1884

Open
WilliamK112 wants to merge 1 commit into
microsoft:mainfrom
WilliamK112:codex/shared-target-help-examples
Open

[codex] Share target help fragments#1884
WilliamK112 wants to merge 1 commit into
microsoft:mainfrom
WilliamK112:codex/shared-target-help-examples

Conversation

@WilliamK112

@WilliamK112 WilliamK112 commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add shared target-help display fragments next to the target parser constants
  • reuse those fragments in install, compile, deps update, and update help text
  • keep command-specific guidance intact: install still documents apm config target, and compile still nudges users from deprecated --target all to --all
  • pin the shared fragments with CLI consistency coverage

Context

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 all expansion aligned with the canonical display order while preserving the newer install fallback chain wording from main and compile's --all deprecation 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.py
  • git diff --check origin/main..HEAD

@WilliamK112 WilliamK112 force-pushed the codex/shared-target-help-examples branch from 91d708c to c93c44f Compare July 2, 2026 03:10
@WilliamK112 WilliamK112 marked this pull request as ready for review July 2, 2026 03:11
Copilot AI review requested due to automatic review settings July 2, 2026 03:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 in target_detection.py.
  • Replaces duplicated --target help strings in install, compile, deps update, and update with the shared fragments.
  • Adds a CLI-consistency regression test to pin the shared fragments (including the install-only apm config target precedence 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.

Comment thread src/apm_cli/commands/compile/cli.py Outdated
@WilliamK112 WilliamK112 force-pushed the codex/shared-target-help-examples branch from c93c44f to fbd7b1e Compare July 2, 2026 03:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants