fix(cli): add missing help text to outdated command#1216
Merged
Conversation
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>
17e5d8d to
bb641e4
Compare
Contributor
There was a problem hiding this comment.
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 outdatedcommand so it shows a description inapm --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>
This was referenced May 9, 2026
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>
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
Adds the missing
help=parameter to theoutdatedcommand's@click.command()decorator so it displays a description inapm --helpoutput.Problem
Running
apm --helpshows theoutdatedcommand 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 insrc/apm_cli/commands/outdated.py.Fixes #1204