Skip to content

feat(deps): support marketplace dependencies in plugin.json#1422

Open
stbenjam wants to merge 3 commits into
microsoft:mainfrom
stbenjam:fix/marketplace-dep-parsing
Open

feat(deps): support marketplace dependencies in plugin.json#1422
stbenjam wants to merge 3 commits into
microsoft:mainfrom
stbenjam:fix/marketplace-dep-parsing

Conversation

@stbenjam
Copy link
Copy Markdown
Contributor

@stbenjam stbenjam commented May 20, 2026

Description

Plugins like openshift-eng/ai-helpers/golang declare transitive deps as {"name": "gopls-lsp", "marketplace": "claude-plugins-official"} in plugin.json. Previously parse_from_dict() rejected these with "must have a 'git' or 'path' field". Now marketplace dicts are parsed into DependencyReference objects and resolved to concrete git refs during BFS dependency resolution via resolve_marketplace_plugin().

Note: marketplace must still have been previously registered w/ apm to work.

Fixes # (issue)

N/A

Type of change

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

Testing

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

@stbenjam stbenjam requested a review from danielmeppiel as a code owner May 20, 2026 17:31
Copilot AI review requested due to automatic review settings May 20, 2026 17:31
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

Adds support for marketplace-style dependency entries ({name: ..., marketplace: ...}) in plugin.json/apm.yml by extending dependency parsing and resolving those placeholders into concrete git refs during BFS dependency resolution.

Changes:

  • Extend DependencyReference to represent and parse marketplace dependency dict entries.
  • Resolve marketplace dependencies to concrete git references during BFS tree building (with auth resolver plumbing from install context).
  • Add unit + integration tests covering parsing and resolution behavior.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/apm_cli/models/dependency/reference.py Adds marketplace fields, parsing support for {name, marketplace}, and guards for unresolved marketplace refs in install-path/serialization helpers.
src/apm_cli/deps/apm_resolver.py Introduces marketplace resolution during BFS and threads auth_resolver into resolver calls.
src/apm_cli/install/phases/resolve.py Passes ctx.auth_resolver into APMDependencyResolver for marketplace resolution.
tests/test_apm_package_models.py Adds parsing/validation tests for marketplace dependency dict format.
tests/test_apm_resolver.py Adds tests for resolver marketplace-resolution behavior and tree integration.
tests/integration/test_marketplace_plugin_integration.py Adds integration coverage for plugin.json parsing with marketplace deps and mixed dependency scenarios.
Comments suppressed due to low confidence (2)

src/apm_cli/models/dependency/reference.py:1578

  • to_apm_yml_entry() now raises ValueError for unresolved marketplace deps. Since this is a public-ish serialization helper used by manifest writers, consider documenting this in the docstring and ensuring any call sites that may encounter marketplace refs either resolve them first or preserve the original dict form instead of calling to_apm_yml_entry().
        if self.is_marketplace:
            raise ValueError(
                f"Cannot serialize unresolved marketplace dependency "
                f"'{self.marketplace_plugin_name}@{self.marketplace_name}'"
            )

src/apm_cli/models/dependency/reference.py:548

  • This PR changes the supported dependency format by allowing marketplace dict entries in plugin.json/apm.yml. Per the repo's docs-update rules, please update the Starlight docs under docs/src/content/docs/ and the APM guide skill reference packages/apm-guide/.apm/skills/apm-usage/dependencies.md to document {name: ..., marketplace: ...} entries and how they are resolved.
        # Support marketplace dependencies: { name: X, marketplace: Y }

Comment thread src/apm_cli/deps/apm_resolver.py
Comment thread src/apm_cli/deps/apm_resolver.py
Comment thread src/apm_cli/models/dependency/reference.py
Comment thread src/apm_cli/models/dependency/reference.py
not-stbenjam added a commit to not-stbenjam/apm that referenced this pull request May 20, 2026
Address PR microsoft#1422 review feedback:
- Marketplace resolution failures now record errors on the dependency
  graph instead of silently dropping the dependency
- Updated get_install_path() docstring to document ValueError for
  unresolved marketplace deps
- Updated parse_from_dict() docstring to document marketplace dict format

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
stbenjam and others added 2 commits May 20, 2026 13:45
Plugins like openshift-eng/ai-helpers/golang declare transitive deps as
`{"name": "gopls-lsp", "marketplace": "claude-plugins-official"}` in
plugin.json. Previously parse_from_dict() rejected these with "must have
a 'git' or 'path' field". Now marketplace dicts are parsed into
DependencyReference objects and resolved to concrete git refs during
BFS dependency resolution via resolve_marketplace_plugin().

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Address PR microsoft#1422 review feedback:
- Marketplace resolution failures now record errors on the dependency
  graph instead of silently dropping the dependency
- Updated get_install_path() docstring to document ValueError for
  unresolved marketplace deps
- Updated parse_from_dict() docstring to document marketplace dict format

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@stbenjam stbenjam force-pushed the fix/marketplace-dep-parsing branch 2 times, most recently from 555fa90 to 2c08c61 Compare May 20, 2026 18:30
@stbenjam stbenjam changed the title feat(deps): support marketplace dependencies in plugin.json [wip] feat(deps): support marketplace dependencies in plugin.json May 20, 2026
@stbenjam stbenjam force-pushed the fix/marketplace-dep-parsing branch from 2c08c61 to 362ebe5 Compare May 20, 2026 18:31
The object form sections in the consumer guide and apm-guide skill
reference had bare YAML examples with no field tables or explanatory
text. Add structured documentation for all three mutually exclusive
dict variants (git, path, marketplace). Add the new marketplace dict
form to the manifest schema spec (Section 4.1.2).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@stbenjam stbenjam changed the title [wip] feat(deps): support marketplace dependencies in plugin.json feat(deps): support marketplace dependencies in plugin.json May 20, 2026
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