fix(marketplace): resolve marketplace check against each entry's host + token#1763
Draft
leocamello wants to merge 1 commit into
Draft
fix(marketplace): resolve marketplace check against each entry's host + token#1763leocamello wants to merge 1 commit into
marketplace check against each entry's host + token#1763leocamello wants to merge 1 commit into
Conversation
`apm marketplace check` built a single default-host RefResolver with no token and called list_remote_refs(entry.source), ignoring the entry's effective host. After microsoft#1736 a relative source under `marketplace.sourceBase` parses as host=None with the bare relative `source`, and the base is composed only on the build (`pack`) path -- which `check` does not share. So `check` ran `git ls-remote https://github.com/<relative>.git` and failed with exit 128 for every `sourceBase` entry (and for the pre-existing microsoft#1288 host-prefixed form), even when `apm pack` against the same apm.yml succeeded. `check` now mirrors the builder's routing: it composes a host-less source onto `sourceBase` (via the shared `split_source_base`), honours per-entry host overrides, resolves a per-host token through the shared `marketplace/auth_helpers.resolve_token_for_host`, and short-circuits local `./` packages before any network call. Default-host entries are unchanged. Adds three `check` regressions: composed -> base host + token, host-prefixed override -> github, local -> zero ls-remote. Verified end-to-end against a real self-managed GitLab (the exit-128 case now resolves). Follows up microsoft#1736 / closes the `check` gap flagged there.
This was referenced Jun 12, 2026
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.
Description
apm marketplace checkbuilt a single default-hostRefResolverwith no token and calledlist_remote_refs(entry.source), ignoring each entry's effective host. After #1736 a relative source undermarketplace.sourceBaseparses ashost=Nonewith the bare relativesource(the base is composed only on the build/packpath, whichcheckdoesn't share), socheckrangit ls-remote https://github.com/<relative>.gitand failed with exit 128 for everysourceBaseentry — and for the pre-existing #1288host.tld/owner/repoform — even whenapm packagainst the sameapm.ymlsucceeded.checknow mirrors the builder's routing: it composes a host-less source ontosourceBase(via the sharedsplit_source_base), honours per-entry host overrides, resolves the host's token through a sharedmarketplace/auth_helpers.resolve_token_for_host, and short-circuits local./packages before any network call. Default-host entries are unchanged.Verified end-to-end against a real self-managed GitLab: the exit-128 case now resolves against the composed nested path.
Fixes #1762
Type of change
Testing
Adds three
checkregressions intests/unit/commands/test_marketplace_check.py: composed → base host + token, host-prefixed override → github, local → zero ls-remote.uv run pytest tests/unit/marketplace tests/unit/commandsis green (2607 passed);ruff check/ruff format --checkclean.Spec conformance (OpenAPM v0.1)
(
src/apm_cli/marketplace/andcommands/marketplace/are not Mode-B critical paths; no normative requirement changes.)