Skip to content

[FEATURE] build_error_context [i] port hint should name a concrete verification command + doc link #799

@edenfunf

Description

@edenfunf

Follow-up from PR #788 review panel -- devx-ux-expert finding #4 ("`[i]` hint actionability ~70%").

Is your feature request related to a problem? Please describe.

The `[i]` hint appended by `AuthResolver.build_error_context` when `dep_ref.port` is set names the right suspect but not the next action. Current output (`src/apm_cli/core/auth.py:428-429` on main):

```
[i] Host 'bitbucket.example.com:7999' -- verify your credential helper stores per-port entries (some helpers key by host only).
```

A user who hits this has two immediate questions the hint does not answer:

  1. How do I verify that? Nothing tells them which command to run against which helper; they have to translate "stores per-port entries" into GCM / osxkeychain / libsecret / gh-auth specifics themselves.
  2. Where do I read more? The public docs already have the helper compatibility table (`docs/src/content/docs/getting-started/authentication.md` -- added in fix(auth): thread dep_ref.port into credential resolution (#785) #788), but the hint does not link to it.

Net effect: roughly 70% actionable. Names the problem; stops short of naming the remediation.

Describe the solution you'd like

Rewrite the hint to include a concrete verification command for the most common helper (`git credential-manager`) and anchor at the new docs section:

```
[i] Host 'bitbucket.example.com:7999' -- this helper may key by host only.
Verify with: printf 'protocol=https\nhost=bitbucket.example.com:7999\n\n' | git credential fill
See: https://microsoft.github.io/apm/getting-started/authentication/#custom-port-hosts-and-per-port-credentials
```

Rationale:

  • `git credential fill` is the helper-agnostic entry point every credential helper implements -- it reproduces exactly what APM does internally, so the user can see what their helper returns for the same (host, port) pair.
  • The docs URL points to the per-helper compatibility table already in tree, so users who need per-helper specifics (GCM vs. osxkeychain vs. libsecret vs. gh auth) land directly on it.
  • Matches the wire-format precedent set by the PR fix(install): warn when --allow-protocol-fallback reuses a custom port across schemes (#786) #789 cross-protocol warning, which also emits a `See: ` line.

Describe alternatives you've considered

  • Leave as-is. Current wording is correct; just under-actionable. Acceptable if we expect most users to reach the docs via the `--verbose` diagnostics. Reviewer panel rated this ~70% actionable, so there is room.
  • Helper-specific guidance inline. Emit different advice for GCM vs. osxkeychain vs. libsecret. Rejected: the helper is opaque to APM at emission time, and the helper-compatibility table in docs is the right place for that detail -- not a three-line terminal hint.
  • Separate `--diagnose-credentials` subcommand. Bigger surface than this finding warrants.

Additional context

Refs

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/cliCLI command surface, flags, help text (cross-cutting).area/docs-sitedocs/src/content (Starlight), README, doc generation.priority/lowAccepted but not time-sensitivestatus/acceptedDirection approved, safe to start work.status/triagedInitial agentic triage complete; pending maintainer ratification (silence = approval).type/featureNew capability, new flag, new primitive.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions