Skip to content

fix(cli): add missing help text to outdated command#1216

Merged
danielmeppiel merged 1 commit into
mainfrom
fix/outdated-help-text
May 8, 2026
Merged

fix(cli): add missing help text to outdated command#1216
danielmeppiel merged 1 commit into
mainfrom
fix/outdated-help-text

Conversation

@danielmeppiel
Copy link
Copy Markdown
Collaborator

Summary

Adds the missing help= parameter to the outdated command's @click.command() decorator so it displays a description in apm --help output.

Problem

Running apm --help shows the outdated command with no help text, unlike all other commands which have descriptions. This was reported in #1204.

Fix

Added help="Check for outdated locked dependencies" to the @click.command(name="outdated") decorator in src/apm_cli/commands/outdated.py.

Fixes #1204

Copilot AI review requested due to automatic review settings May 8, 2026 20:59
The `outdated` command was missing the `help=` parameter in its
`@click.command` decorator, causing it to show no description in
`apm --help` output.

Fixes #1204

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@danielmeppiel danielmeppiel force-pushed the fix/outdated-help-text branch from 17e5d8d to bb641e4 Compare May 8, 2026 21:03
@danielmeppiel danielmeppiel merged commit 0afc235 into main May 8, 2026
6 of 8 checks passed
@danielmeppiel danielmeppiel deleted the fix/outdated-help-text branch May 8, 2026 21:04
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 improves CLI UX and hardens Azure DevOps (ADO) authentication handling by centralizing ADO auth-failure detection and wiring PAT-to-AAD-bearer fallback into additional call sites (including the --update preflight), with new tests and CI linting to prevent regression.

Changes:

  • Adds missing help text for the apm outdated command so it shows a description in apm --help.
  • Introduces is_ado_auth_failure_signal() as the single source of truth for ADO auth-failure signatures and applies it across preflight/validation/downloader flows, including PAT->bearer fallback behavior and improved diagnostics.
  • Adds unit + integration regression tests and a new CI lint script to enforce auth-protocol boundaries; updates integration scripts and the changelog.
Show a summary per file
File Description
src/apm_cli/commands/outdated.py Adds help= text to the outdated Click command.
src/apm_cli/utils/github_host.py Adds centralized ADO auth-failure signal list + predicate helper.
src/apm_cli/core/auth.py Adds BearerFallbackOutcome, improves ADO error context wording, dedups stale-PAT warnings, and changes bearer-fallback helper return shape.
src/apm_cli/install/pipeline.py Updates --update preflight auth probe to use PAT->bearer fallback via execute_with_bearer_fallback.
src/apm_cli/install/validation.py Reuses the centralized ADO auth-failure predicate and adjusts bearer fallback env construction.
src/apm_cli/deps/github_downloader.py Routes ADO ls-remote bearer fallback through the canonical resolver helper and uses the shared predicate.
src/apm_cli/cache/git_cache.py Adds clarifying comment on why bearer fallback does not apply at cache ref-resolution layer.
tests/unit/utils/test_github_host_predicate.py New unit tests for the centralized ADO auth-failure predicate.
tests/unit/test_list_remote_refs.py Adjusts mocking to accommodate the new bearer-fallback helper result shape.
tests/unit/test_auth.py Adds tests for new diagnostic prefix behavior and stale-PAT warning dedup.
tests/unit/install/test_pipeline_auth_preflight.py Adds unit tests ensuring preflight falls back to bearer and doesn’t leak PAT into the bearer env.
tests/integration/test_ado_preflight_bearer_fallback_e2e.py New hermetic E2E test using fake git/az shims to validate preflight fallback end-to-end (POSIX-only).
scripts/test-integration.sh Runs the new preflight bearer-fallback integration test.
scripts/windows/test-integration.ps1 Documents skipping the new POSIX-only E2E test on Windows.
scripts/lint-auth-signals.sh New lint script enforcing auth-protocol boundary rules.
.github/workflows/ci.yml Runs the new auth-protocol boundary lint in the Lint job.
CHANGELOG.md Adds an Unreleased entry describing the preflight bearer fallback behavior.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 1



@click.command(name="outdated")
@click.command(name="outdated", help="Check for outdated locked dependencies")
danielmeppiel added a commit that referenced this pull request May 8, 2026
PR #1216 added help="Check for outdated locked dependencies" to the
outdated command, but tests/unit/test_cli_consistency.py expects
"Show outdated locked dependencies" (the original docstring wording
the test was written against). The mismatch broke CI on main.

Restore the docstring wording so the help description matches the
test contract.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
danielmeppiel added a commit that referenced this pull request May 8, 2026
…tions (#1208) (#1215)

* fix(errors): hide agent-skills from unknown-target suggestions (#1208)

The unknown-target error renderer advertised every member of
CANONICAL_TARGETS as a recovery path, including the meta-target
"agent-skills". But "apm targets" intentionally omits "agent-skills"
from its table (it is a multi-harness fan-out target with no single
deploy_dir; visible only via "apm targets --json --all"). A user
following the error message's "apm targets  # see all supported
harnesses" hint cannot confirm "agent-skills" exists, leaving them
stuck on a contradiction APM authored itself.

Filter "agent-skills" out of the rendered "Valid targets:" CSV and
out of the "did you mean?" suggestion fallback chain. The canonical
set still ACCEPTS "agent-skills" via "--target agent-skills" and the
"target:"/"targets:" keys in apm.yml, so power users who pass it
explicitly continue to work; we just stop steering beginners toward a
target the discovery command refuses to confirm.

Adds two tests:
- agent-skills must not appear anywhere in the unknown-target render.
- If the caller filters down to only agent-skills, the renderer must
  fall back to a sane default suggestion ("claude") rather than
  re-introducing agent-skills.

Closes #1208 (paired with #1197 which fixed the parser crash).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* docs(changelog): add entry for #1215

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix(errors): avoid empty 'Valid targets:' when only meta-target visible

Address PR #1215 review: when the caller passes a list containing only
"agent-skills" (or empty), the rendered "Valid targets:" line previously
collapsed to a bare colon because the visible-set filter consumed all
entries. Compute the safety-net suggestion first and use it as the CSV
fallback so the line always carries a single actionable harness name.
Production call sites all pass the full canonical set, so this only
exercises in tests and hypothetical future callers; covers
defense-in-depth without changing behavior on the hot path.

Extends test_unknown_target_error_falls_back_when_only_meta_target_visible
to pin the new "Valid targets: claude" assertion alongside the existing
suggestion-fallback checks.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix(cli): align outdated help text with consistency test

PR #1216 added help="Check for outdated locked dependencies" to the
outdated command, but tests/unit/test_cli_consistency.py expects
"Show outdated locked dependencies" (the original docstring wording
the test was written against). The mismatch broke CI on main.

Restore the docstring wording so the help description matches the
test contract.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
danielmeppiel added a commit that referenced this pull request May 11, 2026
- Move [Unreleased] entries into [0.13.0] - 2026-05-11
- Audit entries to one concise so-what line per PR; add missing
  user-facing entries (#1216, #1236, #1237, #1241, #1242); drop
  dev-only / release-machinery entries
- Bump pyproject.toml + uv.lock to 0.13.0
- Move 34 open items from 0.13.0 (closed) and older open milestones
  (0.8.0, 0.9.4, 0.10.0) into a fresh 0.14.0 milestone

Co-authored-by: Daniel Meppiel <copilot-rework@github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

[BUG] outdated option is missing help text

2 participants