Skip to content

fix(marketplace): resolve version tags from package remote - #3044

Open
Chandan Kumar (modelpath-dev) wants to merge 2 commits into
microsoft:mainfrom
modelpath-dev:fix/2928-package-tag-remote
Open

Chandan Kumar (modelpath-dev) wants to merge 2 commits into
microsoft:mainfrom
modelpath-dev:fix/2928-package-tag-remote

Conversation

@modelpath-dev

@modelpath-dev Chandan Kumar (modelpath-dev) commented Sep 20, 2026

Copy link
Copy Markdown

Fixes #2928

Why

Version constraints for marketplace installs listed git tags on the marketplace catalog even when the plugin lives in a separate package repository. Tags published only on the package remote never matched, so installs like apm install pkg@marketplace#1.0.1 failed with No tag matching version. Query the package remote when the plugin source points there, and keep the catalog remote for in-marketplace packages.

Scope

  • resolve_version_constraint: optional remote_url passed through to list_remote_refs
  • resolve_marketplace_plugin: pick package coordinates from dep_ref or github/gitlab/git-subdir locators before falling back to the marketplace
  • MarketplaceBuilder: pass source_url as remote_url when listing refs
  • Unit coverage for packed remote sources and remote_url forwarding

Tradeoffs

Left in-marketplace / relative sources on the catalog remote. That is still where those packages publish tags.

Blast Radius

Touches marketplace install validation and builder tag resolution only. Auth for the lookup follows the package host when it differs from the catalog.

Verification

uv run --extra dev pytest \
  tests/unit/marketplace/test_version_resolver.py \
  tests/unit/marketplace/test_marketplace_resolver.py \
  tests/unit/marketplace/test_versioned_resolver.py -q

173 passed.

Version constraints listed tags on the marketplace catalog even when the
plugin lives in a different package repo. Query the package remote so
tag/version install works when those remotes differ.

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.

Copilot review overview

🟡 Changes recommended

Repository host parsing and SSH transport issues remain unresolved; two minor test improvements are also noted.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity

Open (1)
What changed in this PR

Updates marketplace version resolution to query tags from the package repository when sources differ from the marketplace catalog.

Changes:

  • Forwards optional remote URLs during version and builder resolution.
  • Resolves package coordinates from external marketplace sources.
  • Adds unit coverage for remote lookup behavior.
File Summary
tests/​unit/​marketplace/​test_version_resolver.py Tests remote forwarding and diagnostics; nit (1 vote): parse diagnostic URLs instead of using substring matching.
tests/​unit/​marketplace/​test_marketplace_source_base.py Updates resolver test doubles.
tests/​unit/​marketplace/​test_marketplace_resolver.py Tests package-remote resolution.
tests/​unit/​marketplace/​test_builder.py Updates builder test doubles.
src/​apm_cli/​marketplace/​version_resolver.py Forwards optional remote URLs to reference resolution.
src/​apm_cli/​marketplace/​resolver.py Selects package remotes; critical (3 votes): preserve bare and host-qualified source semantics; moderate (1 vote): preserve SSH transport.
src/​apm_cli/​marketplace/​builder.py Uses source URLs for tag lookup; nit (1 vote): assert the forwarded source_url in builder tests.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/apm_cli/marketplace/resolver.py
Bare type:github locators and host-qualified repo fields must parse
through DependencyReference so tags are listed on github.com, not the
marketplace catalog host.
@modelpath-dev

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

This branch has not been deployed

No deployments
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]In last version (0.30.0) It is not possible to install package with git tag

2 participants