Skip to content

feat(uninstall): accept unambiguous short package names - #2748

Closed
Nom1fan wants to merge 1 commit into
microsoft:mainfrom
Nom1fan:feature/uninstall-short-package-names
Closed

feat(uninstall): accept unambiguous short package names#2748
Nom1fan wants to merge 1 commit into
microsoft:mainfrom
Nom1fan:feature/uninstall-short-package-names

Conversation

@Nom1fan

@Nom1fan Nom1fan commented Sep 1, 2026

Copy link
Copy Markdown

Description

APM users currently need to repeat the full owner/repo identifier when uninstalling a package, even when the installed manifest has only one package with that name. This is particularly awkward for globally installed skills and bundles where users typically know the package's short name.

Allow apm uninstall <name> and apm uninstall -g <name> to resolve directly from installed manifest entries. Resolution fails closed when multiple owners provide the same final path segment and points users to apm deps list for the exact identifier. Existing canonical, marketplace, URL, and local-path selection behavior remains unchanged.

This intentionally keeps the contribution focused on uninstall UX. Current main already provides installed inventory through apm deps list and version checks through apm outdated; broader install-output suppression was not included because APM's default stream contains security-significant policy and cleanup warnings that should not be hidden without a separate output-policy design.

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Maintenance / refactor

Testing

  • Tested locally
  • All existing tests pass
  • Added tests for new functionality (if applicable)

Validation run:

  • uv run --extra dev pytest tests/unit tests/test_console.py -x — 20,729 passed, 3 skipped, 21 xfailed
  • uv run --extra dev ruff check src/ tests/
  • uv run --extra dev ruff format --check src/ tests/

Spec conformance (OpenAPM v0.1)

  • N/A -- this PR does not change an OpenAPM v0.1 normative requirement; it adds a CLI identifier convenience for selecting an already-declared dependency.

Made with Cursor

Resolve short names from installed manifest entries so users can remove packages without repeating the owner, while failing closed on collisions.

Co-authored-by: Cursor <cursoragent@cursor.com>

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

Adds an uninstall UX improvement so apm uninstall <name> (and -g) can resolve an installed dependency by an unambiguous short package name, failing closed on ambiguity and preserving existing identifier behaviors.

Changes:

  • Extend uninstall dependency selection to allow basename matching when it uniquely identifies an installed remote dependency.
  • Add unit tests covering unique/ambiguous short-name resolution and updated not-found messaging.
  • Update CLI help + docs and add an Unreleased changelog entry for the new behavior.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/unit/test_uninstall_engine_helpers.py Adds/updates uninstall validation tests for short-name matching, ambiguity, and not-found messaging.
tests/unit/models/test_dependency_uninstall_selection.py Adds model-level tests for unique vs ambiguous short-name selection outcomes.
src/apm_cli/models/dependency/selection.py Implements short-name matching in manifest dependency selection.
src/apm_cli/commands/uninstall/engine.py Allows bare names to flow into selection (instead of hard “invalid format” rejection) while preserving marketplace pre-resolution.
src/apm_cli/commands/uninstall/cli.py Updates CLI help/examples to document uninstall-by-short-name.
docs/src/content/docs/reference/cli/uninstall.md Documents short-name uninstall semantics and ambiguity behavior.
CHANGELOG.md Adds an Unreleased entry describing short-name uninstall support.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +53 to 57
short_name = (
package if "/" not in package and not DependencyReference.is_local_path(package) else None
)
try:
requested_identity = DependencyReference.parse(package).get_identity()
Comment thread CHANGELOG.md
Comment on lines +12 to +14
- `apm uninstall` now accepts an unambiguous package short name, while
requiring the full installed identifier when multiple owners use the same
name.
Comment on lines 45 to 47
@click.command(
help="Remove packages using manifest entries or direct locked keys from 'apm deps list'"
help="Remove packages by full identifier, unambiguous short name, or direct locked keys from 'apm deps list'"
)
@danielmeppiel

Copy link
Copy Markdown
Collaborator

Thank you for the work you have put into APM. We are closing this PR as part of a maintainer-led issue-first intake reset because we could not identify an APM issue tracking this change.

Our small maintainer team cannot sustainably review implementations before agreeing which problems and scope we can support. We recognize this process was not clear when some contributions began, and we are sorry for that. This is a review-capacity decision, not a judgment of your work's quality.

Please open an issue describing the problem and proposed scope, or point us to the existing matching issue, and link it here. For substantive changes, a responsible human maintainer must agree the scope, acceptance criteria and review contact under the contribution rules.

Once the tracking and applicable scope decision are in place, please ask here to reopen this PR so the existing work can be reused. There is no need to discard your contribution or start over. The same issue-first expectations apply to maintainer-authored and automated PRs.

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.

4 participants