Repository navigation
Fix marketplace --ref not propagated to relative plugin sources (#1811) - #1824
Conversation
When a marketplace is registered with --ref <branch>, relative string sources (e.g. ./plugins/my-plugin) resolved against the default branch instead of the registered ref. The canonical built by resolve_plugin_source carried no #ref suffix. Propagate source.ref into the canonical for GitHub-family hosts and into the DependencyReference for GitLab/non-GitHub hosts when: - No explicit version_spec overrides it - The plugin source is a relative string (in-marketplace) - source.ref is not "main" or "HEAD" (default-branch no-ops) Add regression tests for both GitHub and GitLab marketplace hosts. Fixes #1811 Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
✅ Ready to approve
The change is narrowly scoped to the documented root cause and is defended by targeted regression tests for the affected GitHub and GitLab resolution paths.
Note: this review does not count toward required approvals for merging.
Pull request overview
This PR fixes a marketplace resolution gap where a marketplace’s registered --ref was not being applied when resolving relative string plugin sources from marketplace.json, causing installs to unexpectedly resolve against the default branch instead of the pinned ref.
Changes:
- Propagates the registered marketplace ref into GitLab structured dependency references for in-repo plugins when the plugin source does not specify its own ref and no
version_specoverride is provided. - Appends
#<marketplace-ref>to GitHub-family relative string source canonicals (when no ref/version override is present) so downstream resolution uses the pinned branch/tag. - Adds regression tests covering GitHub and GitLab ref propagation,
mainexclusion behavior, andversion_specoverride precedence.
File summaries
| File | Description |
|---|---|
src/apm_cli/marketplace/resolver.py |
Ensures registered marketplace refs are applied to in-marketplace relative string plugin sources (GitHub canonical suffix + GitLab dep_ref fallback). |
tests/unit/marketplace/test_marketplace_resolver.py |
Adds unit regression tests validating ref propagation and override precedence across GitHub and GitLab hosts. |
Copilot's findings
- Files reviewed: 2/2 changed files
- Comments generated: 0
Note
Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.
APM Review Panel:
|
| Persona | B | R | N | Takeaway |
|---|---|---|---|---|
| Python Architect | 0 | 1 | 3 | Correct, surgical two-site fix; guards complete for stated scope. One untested GHE+string interaction and duplicated magic exclusion set are the only rough edges. |
| CLI Logging Expert | 0 | 2 | 1 | Two silent canonical mutations lack logger.debug() calls; the host-backfill block directly above sets the exact pattern both new blocks must follow. |
| DevX UX Expert | 0 | 3 | 1 | Bug fix correctly restores --ref user promise for string sources; three UX gaps remain around silent ref exclusion, uncontextualized downstream errors, and missing doc update. |
| Supply Chain Security Expert | 0 | 1 | 2 | No urgent issues; source.ref is safe via subprocess arg-list and URL encoding, but _validate_ref is absent at the canonical assembly point -- recommend adding as defense-in-depth. |
| OSS Growth Hacker | 0 | 1 | 2 | Solid community fix for a silent, adoption-affecting bug in --ref marketplace installs; missing CHANGELOG entry is the only gap before merge. |
| Doc Writer | 0 | 2 | 1 | No CHANGELOG entry for bug fix #1811; --ref propagation-to-relative-sources behavior and its main/HEAD silent-drop caveat are undocumented. |
| Test Coverage Expert | 0 | 2 | 0 | 5 unit tests are tight regression traps for both new code blocks; HEAD exclusion (both blocks) has no test -- one tuple edit away from silent regression; integration floor for install-with-ref is absent. |
B = blocking-severity findings, R = recommended, N = nits.
Counts are signal strength, not gates. The maintainer ships.
Top 5 follow-ups
- [OSS Growth Hacker + Doc Writer] Add
[Unreleased] > ### FixedCHANGELOG entry with contributor attribution and issue/PR refs before merge -- Pre-merge ask: affected users cannot self-triage the upgrade; contributor receives no visible credit. Both panelists converge independently. Suggested text: "apm install plugin@marketplacenow correctly propagates the marketplace-registered--refto relative string plugin sources instead of silently falling back to the default branch. (by Sergio Sisternes (@sergio-sisternes-epam); closes [BUG] marketplace add --ref: registered ref not propagated to relative plugin source resolution #1811) (Fix marketplace --ref not propagated to relative plugin sources (#1811) #1824)" - [Test Coverage Expert] Add HEAD exclusion tests for both GitHub canonical-append and GitLab effective_ref new code blocks --
outcome: missingon a behavioral guard: removing'HEAD'from either exclusion tuple causes zero test failures yet silently appends#HEADto canonicals. One parametrized test covering both'main'and'HEAD'for both paths closes the regression trap entirely. - [CLI Logging Expert] Add
logger.debug()calls inside both new ref-propagation blocks to match the host-backfill pattern at lines 843-854 -- Without it,--verbosemode cannot distinguish whether the ref fragment came from plugin registration, a version_spec override, or the marketplace fallback -- breaking both agent diagnostics and developer debugging. - [Supply Chain Security Expert] Call
_validate_ref(source.ref)before appending to canonical (GitHub block) and before GitLabeffective_refassignment -- Defense-in-depth following the project's own ref-injection control pattern;_validate_refis already called in_fetch_gitand_fetch_local; extending it here closes the gap at the assembly point. - [DevX UX Expert + Doc Writer] Update the
--refCLI reference doc to document propagation to relative plugin sources and themain/HEADsilent-drop caveat -- Post-fix,--refsemantics expanded silently beyond what the CLI reference documents. Themain/HEADexclusion edge case -- explicit--ref mainsilently dropped when the plugin repo's actual default branch differs -- needs a callout to avoid user confusion.
Architecture
classDiagram
direction LR
class MarketplaceSource {
<<ValueObject>>
+name str
+ref str
+owner str
+repo str
+host str
+kind str
}
class MarketplacePlugin {
<<ValueObject>>
+name str
+source any
+version str
}
class MarketplaceManifest {
<<ValueObject>>
+plugins tuple
+plugin_root str
+find_plugin(name) MarketplacePlugin
}
class MarketplacePluginResolution {
<<OutputAggregate>>
+canonical str
+dependency_reference DependencyReference
+cross_repo_misconfig_risk CrossRepoMisconfigRisk
}
class DependencyReference {
<<ValueObject>>
+repo_url str
+reference str
+to_canonical() str
}
class resolve_marketplace_plugin {
<<IOBoundary>>
+plugin_name str
+marketplace_name str
+version_spec str
}
class resolve_plugin_source {
<<Pure>>
+plugin MarketplacePlugin
+returns str
}
class gitlab_dep_ref_builder {
<<Pure>>
+source MarketplaceSource
+in_repo_path str
+ref str
+returns DependencyReference
}
MarketplaceManifest *-- MarketplacePlugin : contains
resolve_marketplace_plugin ..> MarketplaceSource : reads ref
resolve_marketplace_plugin ..> MarketplaceManifest : fetches
resolve_marketplace_plugin ..> MarketplacePluginResolution : returns
resolve_marketplace_plugin ..> resolve_plugin_source : delegates str source
resolve_marketplace_plugin ..> gitlab_dep_ref_builder : calls for gitlab path
resolve_plugin_source ..> MarketplacePlugin : reads source
gitlab_dep_ref_builder ..> DependencyReference : builds
MarketplacePluginResolution o-- DependencyReference : optional dep_ref
class resolve_marketplace_plugin:::touched
classDef touched fill:#fff3b0,stroke:#d47600
flowchart TD
A["resolve_marketplace_plugin"] --> B["get_marketplace_by_name: load MarketplaceSource.ref"]
B --> C["fetch_or_cache: download marketplace.json"]
C --> D["manifest.find_plugin"]
D --> E{"local kind + str source?"}
E -->|Yes| F["_resolve_local_relative_source: early return"]
E -->|No| G["resolve_plugin_source: str src yields owner/repo/subpath, no ref"]
G --> H{"_source_needs_explicit_git_path? (gitlab or non-GitHub)"}
H -->|"Yes + in-marketplace"| I["_extract_in_repo_path_and_ref: rel_path + ref=None"]
I --> J["[NEW] effective_ref = version_spec or path_ref or source.ref if not in exclusions"]
J --> K["_gitlab_in_marketplace_dep_reference: builds DependencyReference with effective_ref"]
K --> L["dep_ref.to_canonical()"]
H -->|"No or cross-repo"| M["dep_ref = None"]
L --> N{"dep_ref is None + _needs_canonical_host_prefix?"}
M --> N
N -->|"Yes GHE"| O["canonical = source.host/canonical"]
N -->|No| P["canonical unchanged"]
O --> Q["_compute_cross_repo_misconfig_risk"]
P --> Q
Q --> R{"dep_ref is None + not version_spec + str plugin.source + no hash + source.ref not in exclusions?"}
R -->|Yes| S["[NEW] canonical = canonical + '#' + source.ref"]
R -->|No| T["skip ref propagation"]
S --> U{"version_spec set + dep_ref is None?"}
T --> U
U -->|Yes| V["resolve_version_constraint or raw ref override"]
U -->|No| W["canonical final"]
V --> W
W --> X["check_ref_pin / record_ref_pin"]
X --> Y["detect_shadows advisory"]
Y --> Z["return MarketplacePluginResolution"]
Recommendation
Merge after the CHANGELOG entry is added (followup #1 -- the single pre-merge ask). The fix is correct, minimal, and safe; all panelists agree and the unit regression tests are strong. The HEAD exclusion regression trap (followup #2) and missing debug logs (followup #3) are the highest-signal post-merge items and should land in the same release cycle. _validate_ref defense-in-depth (followup #4) and the doc update (followup #5) can follow in adjacent PRs. The behavior fix is ready to ship once the CHANGELOG is in place.
Full per-persona findings
Python Architect
- [recommended]
*.ghe.commarketplace + relative string source + registered ref combination is untested attests/unit/marketplace/test_marketplace_resolver.py:1437
The GHE host-backfill block and new ref-propagation block execute sequentially for GHE in-marketplace string sources. This interaction is architecturally correct but all five new tests only exercisegithub.comandgitlab.comhosts.
Suggested: Add a sixth test:MarketplaceSource(host='corp.ghe.com', ref='feat/xxx', ...), pluginsource='./plugins/p'-> expectresult.canonical == 'corp.ghe.com/acme/catalog/plugins/p#feat/xxx'andresult.dependency_reference is None. - [nit] Magic exclusion tuple
('main', 'HEAD')duplicated atresolver.py:829andresolver.py:886atsrc/apm_cli/marketplace/resolver.py:829
The same two-element literal appears independently in both the GitLab effective_ref block and the GitHub ref-propagation block. If the exclusion policy is extended, both sites must be updated in sync.
Suggested: Add_DEFAULT_REF_EXCLUSIONS: frozenset[str] = frozenset({'main', 'HEAD'})module-level constant. - [nit] Silent skip when
'#'already in canonical produces no debug trace atsrc/apm_cli/marketplace/resolver.py:884
Suggested:logger.debug('Ref propagation skipped for %s@%s: canonical already carries fragment %r', plugin_name, marketplace_name, canonical) - [nit] Procedural pipeline, no new patterns introduced -- appropriate for two-site bug fix scope; no abstraction changes warranted.
CLI Logging Expert
- [recommended] GitHub ref-propagation block mutates canonical with no
logger.debug()-- breaks established pattern set by adjacent host-backfill block atsrc/apm_cli/marketplace/resolver.py:888
Lines 843-854 establish the pattern: every silent canonical mutation gets alogger.debug()call. In--verbosemode, a developer cannot determine whether the ref fragment came from the plugin source,version_spec, or the marketplace-registration fallback.
Suggested: After line 888:logger.debug("Propagated marketplace ref '%s' to canonical for %s@%s (#1811)", source.ref, plugin_name, marketplace_name) - [recommended] GitLab
effective_reffallback (line 830) has nologger.debug()call -- resolution decision is untraced atsrc/apm_cli/marketplace/resolver.py:830
Suggested: Inside theif not effective_ref...branch:logger.debug("Propagated marketplace ref '%s' to GitLab in-repo dep for %s@%s (#1811)", source.ref, plugin_name, marketplace_name) - [nit] Silent exclusion of
'main'/'HEAD'refs emits nothing atsrc/apm_cli/marketplace/resolver.py:886-- a debug trace when exclusion fires would help agents diagnose the known edge case.
DevX UX Expert
- [recommended] Silent exclusion of
--ref main/HEADwith no observable signal is invisible in a narrow but real scenario atsrc/apm_cli/marketplace/resolver.py:886
A user who explicitly typesapm marketplace add acme/catalog --ref mainon a repo whose actual default branch is NOTmainexpectsmainto be pinned; instead the fix silently drops it with no debug log, no warning.
Suggested:logger.debug("ref '%s' for %s@%s matches default-branch exclusion list; not propagating to canonical", source.ref, plugin_name, marketplace_name)when exclusion fires. - [recommended] When propagated
source.refdoes not exist on the plugin repo, the downstream error has no marketplace context atsrc/apm_cli/marketplace/resolver.py:888
User sees generic git "Reference not found" error with no mention of the marketplace or the recovery action (apm marketplace add <SOURCE> --ref <valid-ref>). - [recommended]
--refdocs say it governsmarketplace.jsonfetching only; after this PR it also governs plugin installation -- the doc is now incomplete atdocs/src/content/docs/reference/cli/marketplace.md
Suggested: Extend the--refrow to document: "governs both themarketplace.jsonfetch and, for relative string plugin sources, the ref used when installing plugins.main/HEADare treated as the default branch and not propagated." - [nit] HEAD exclusion asserted in code at two sites but has zero test coverage at
tests/unit/marketplace/test_marketplace_resolver.py:1465-- parametrize'main'/'HEAD'in the main-exclusion tests.
Supply Chain Security Expert
- [recommended]
_validate_refis not called beforesource.refis appended to the canonical string atsrc/apm_cli/marketplace/resolver.py:888
_validate_ref(enforces^[A-Za-z0-9][A-Za-z0-9._/-]*$) is called in_fetch_gitand_fetch_localbut not in_fetch_githubor_fetch_gitlab. A crafted localmarketplaces.jsonentry could embed characters that flow silently into the canonical. Downstream subprocess arg-lists and URL encoding mitigate in practice, but the explicit guard the project relies on is absent at the assembly point.
Suggested: Call_validate_ref(source.ref, marketplace_name)before line 888 and before the GitLabeffective_refassignment at line 830. - [nit] The
'main'/'HEAD'exclusion silently drops explicitly user-pinned refs atsrc/apm_cli/marketplace/resolver.py:886-- two machines with different repo defaults install different commits from the same lockfile entry. - [nit] GitLab
effective_refblock lacks the explanatory comment present in the GitHub-family block atsrc/apm_cli/marketplace/resolver.py:829-- copy rationale + known-limitation disclosure from lines 875-879.
OSS Growth Hacker
- [recommended] No CHANGELOG entry for this fix -- affected users cannot self-triage whether to upgrade at
CHANGELOG.md
Every other community fix in[Unreleased] Fixedhas a CHANGELOG bullet with PR/issue refs and contributor attribution. Without the entry, the contributor gets no visible credit and release posts cannot cite the fix.
Suggested: Add to[Unreleased] > ### Fixed: "apm install plugin@marketplacenow resolves relative string plugin sources against the marketplace's registered--refinstead of silently falling back to the default branch. (by Sergio Sisternes (@sergio-sisternes-epam); closes [BUG] marketplace add --ref: registered ref not propagated to relative plugin source resolution #1811) (Fix marketplace --ref not propagated to relative plugin sources (#1811) #1824)" - [nit] Docs for
--refflag and install guide silently omit propagation guarantee now provided by this fix atdocs/src/content/docs/consumer/installing-from-marketplaces.md. - [nit] Known limitation (
--ref mainsilently dropped when repo default branch differs) is buried in source comment, not surfaced to users.
Auth Expert -- inactive
Both changed hunks only touch the ref/fragment portion of canonical URLs and the DependencyReference.reference field. AuthResolver dispatches exclusively on host, port, and host_type -- none of which are modified. The existing *.ghe.com host-backfill auth block (#1285, lines 843-854) is unaffected and runs before the new ref-propagation block.
Doc Writer
- [recommended] Missing CHANGELOG entry under
[Unreleased] > Fixedfor the [BUG] marketplace add --ref: registered ref not propagated to relative plugin source resolution #1811 regression atCHANGELOG.md
The fix corrects a silent misbehavior users were working around. Users upgrading who were affected have no changelog signal that it is resolved.
Suggested: Add under[Unreleased] > ### Fixed: "apm install plugin@marketplacenow correctly uses the marketplace's registered--refwhen the plugin source is a relative string. Previously the ref was silently dropped, causing install to resolve against the default branch. (closes [BUG] marketplace add --ref: registered ref not propagated to relative plugin source resolution #1811) (Fix marketplace --ref not propagated to relative plugin sources (#1811) #1824)" - [recommended]
--refflag description does not document propagation to relative plugin sources or themain/HEADexclusion caveat atdocs/src/content/docs/reference/cli/marketplace.md
Suggested: Extend the--refrow to clarify that the ref is also propagated at install time for relative string sources, and note thatmain/HEADare excluded. - [nit] Consumer install doc covers
--reffor HTTPS URLs but not for relative plugin source propagation atdocs/src/content/docs/consumer/installing-from-marketplaces.md.
Test Coverage Expert
- [recommended] HEAD exclusion from ref propagation is untested in both new code blocks at
tests/unit/marketplace/test_marketplace_resolver.py
Both new blocks gate onsource.ref not in ('main', 'HEAD')but the new test class only coversref='main'. Removing'HEAD'from either exclusion tuple causes zero test failures. Confirmed absence via grep.
Proof (missing):tests/unit/marketplace/test_marketplace_resolver.py::test_github_relative_source_head_ref_not_appended-- proves: A marketplace registered with--ref HEADdoes not append#HEADto the canonical [devx, portability-by-manifest]
assert result.canonical == "acme/catalog/plugins/my-plugin" # no #HEAD suffix
Suggested: Add tests for HEAD exclusion for both GitHub and GitLab paths (or parametrize existing main-exclusion tests with('main', 'HEAD')). - [recommended] No integration-with-fixtures test walks
apm install plugin@marketplacethrough the lockfile when marketplace carries a non-default--refattests/integration/test_install_marketplace_phase4w3.py
The headline user promise is "install resolves against the registered branch." 5 unit tests defend the resolver in isolation, but no integration test traces the corrected canonical through install pipeline, lockfile write, and round-trip. Confirmed absence via grep ontests/integration/.
Proof (missing):tests/integration/test_install_marketplace_phase4w3.py::test_marketplace_install_propagates_registered_ref_to_lockfile-- proves:apm install plugin@marketplacewith registered--ref feat/xxxlocks canonical asowner/repo/path#feat/xxx[portability-by-manifest, devx]
assert locked_entry["canonical"].endswith("#feat/my-feature")
Suggested: Add hermetic integration test driving install with fixture marketplace at--ref feat/xxxand asserting lockfile canonical ends with#feat/xxx.
Performance Expert -- inactive
The two changed files (src/apm_cli/marketplace/resolver.py and its unit-test companion) are not in the perf fast-path (cache/deps/install phases/pipeline/resolve); all 30 added lines are pre-download metadata computation -- boolean guards and f-string concatenation -- with zero impact on resolve round-trips, fetch bytes, materialization syscalls, or install wall-time.
This panel is advisory. It does not block merge. Re-apply the
panel-review label after addressing feedback to re-run.
Generated by PR Review Panel for issue #1824 · sonnet46 16.5M · ◷
…GitLab slash-ref proxy filenames (#1880) * fix(artifactory): deterministic boundary probe for nested GitLab paths Mirrors the native GitLab resolver pattern -- but uses HEAD on Artifactory archive URLs as the existence signal, so no separate metadata API is needed. Covers both routing modes: Mode 1 -- explicit FQDN deps (host/artifactory/key/owner/repo/...). Mode 2 -- bare shorthand under PROXY_REGISTRY_URL+PROXY_REGISTRY_ONLY. The resolver walks candidate (owner, repo, virtual_path) splits shallow-first and locks in the first one whose archive responds 2xx-3xx. For unambiguous paths it returns the parse-time ref unchanged. When every candidate is rejected it raises -- distinguishing "missing repo" from auth (401/403) errors so users get an actionable hint instead of silently anchoring on a wrong guess. ``allow_redirects=False`` on the HEAD call keeps the Bearer token from leaking cross-host. Removes the parse-time marker-segment heuristic (_VIRTUAL_PATH_ROOT_SEGMENTS / _ARTIFACTORY_VIRTUAL_MARKERS / _ARTIFACTORY_VIRTUAL_FILE_EXTENSIONS) that previously decided the boundary based on hard-coded directory names like ``skills/`` or ``prompts/``. Parse-time now defaults to all-as-repo with a structural file-extension rule on the last segment; the install-time resolver is the authoritative source of the boundary. Also fixes a pre-existing URL-roundtrip bug where ``to_github_url`` -> ``parse`` folded the ``artifactory/<key>`` prefix into ``repo_url``, causing the downloader to build double-prefixed archive URLs and 404. ``_validate_url_repo_path`` now strips the prefix before returning the bare ``owner/repo`` slug. * fix(artifactory): address Copilot review feedback on PR #1472 - parse_artifactory_path: reject ``owner//virtual`` (empty segment before the explicit boundary) instead of falling through and returning an empty ``repo`` slug. - _proxy_routing_target: thread the proxy ``scheme`` (https/http) through the resolver into ``build_artifactory_archive_url`` so installs that intentionally route through an ``http://`` proxy (under ``PROXY_REGISTRY_ALLOW_HTTP=1``) probe over the same transport. - _CandidateStatus.EXISTS: update inline comment to say ``2xx or 3xx`` (redirect-inclusive), matching the actual classification in ``_candidate_archive_status``. - CHANGELOG: split the parse-time-behavior note into explicit-FQDN vs bare-shorthand modes (the all-as-repo default applies only under ``PROXY_REGISTRY_ONLY``; Mode 1 stays shallow). - package_resolution: clarify the ``direct_virtual_resolved`` docstring -- GitLab path gates on ``is_virtual``, Artifactory path gates on probe rebuild; both signal "persist as structured ``git:`` + ``path:`` entry". - Add two regression tests for the empty-segment edge case (parser + iterator). * test(artifactory): add regression traps for boundary resolver Adds focused regression-trap tests for the new install-pipeline boundary resolver (#1472) covering the contracts a future refactor could silently break: - allow_redirects=False on every HEAD probe (token-leak guard against proxy-issued cross-host redirects) - Mode 2 Authorization header is sourced from RegistryConfig (proxy bearer), never from AuthResolver (which returns the github.com PAT and would leak it to the proxy host) - 403 (like 401) classifies as AUTH; mixed 401/non-auth-4xx demotes the candidate set to MISSING so the user-facing error stays accurate (avoids misreporting a missing repo as auth failure) - 429 and other non-{401,403} 4xx are MISSING, not AUTH (guards against accidental broadening of the AUTH set) - _split_owner_repo subgroup folding for 3+ segment GitLab boundaries (group/sub1/sub2/repo correctly folds to owner=group, repo=sub1/sub2/repo) Both mutation-break gates were exercised: flipping allow_redirects to True and rewiring Mode 2 to AuthResolver each made the corresponding test fail; restoring the source code made them pass. Also applies ruff format pass to bring three files in line with the canonical formatter (pre-existing drift on the PR branch that would have failed CI lint check). Co-authored-by: chkp-roniz <[email protected]> Co-authored-by: Copilot <[email protected]> * fix(marketplace): propagate marketplace --ref to string sources; fix GitLab slash-ref proxy filenames Two related fixes for marketplace ref handling: 1. `apm install plugin@marketplace` now fetches from the registered --ref branch instead of silently falling back to the repo default branch. `resolve_marketplace_plugin` was not propagating `source.ref` downstream. Covers GitHub-family hosts (ref appended to canonical) and GitLab hosts (ref injected into DependencyReference). Guards skip main/HEAD and respect explicit version_spec overrides. Mirrors #1824. 2. GitLab archive URLs with slash-containing branch names (e.g. feat/my-feature) now produce Artifactory-proxyable filenames: slash preserved in the path segment, replaced with '-' in the filename. Previously PROXY_REGISTRY_ONLY=1 installs returned HTTP 404 because the filename contained a literal slash. This is the proxy scenario absent from #1824. 9 regression tests added; 0 pre-existing failures introduced. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * style: replace non-ASCII em-dashes, arrows, and box-drawing chars with ASCII Addresses Copilot review comments on PR #1880. Repo encoding rules require source files to stay within printable ASCII to avoid Windows cp1252 UnicodeEncodeError in some environments. - github_host.py: U+2192 arrow (->) - resolver.py: two U+2014 em-dashes (--) - test_marketplace_resolver.py: U+2014 em-dash and two U+2500 separators - test_artifactory_support.py: U+2014 em-dash and three U+2500 separators Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * fix(artifactory): demote mixed 401+404 candidate to MISSING not AUTH _candidate_archive_status() was returning AUTH whenever any URL shape returned 401/403, even if other shapes returned non-auth 4xx (e.g. 404). This misreported a boundary-resolution failure as an authentication failure, giving users a misleading error message. Per the module spec: AUTH is returned only when *every* observed response was 401/403 with no non-auth 4xx seen. A mix means at least one URL shape was definitively absent -- the candidate is MISSING and the unresolved- boundary error path is triggered instead. Added saw_non_auth_4xx flag; AUTH gate now requires `saw_auth and not saw_non_auth_4xx`. Addresses Copilot review comment on PR #1880. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * fix: restore CHANGELOG from main; format test files; fold panel items - Restore CHANGELOG.md from current main (refs #1902, #1873, #1897, etc.) - Add two PR-specific Fixed entries: marketplace --ref propagation and GitLab slash-ref proxy filename normalization - Apply ruff format to test_marketplace_resolver.py and test_artifactory_support.py (CI Lint gate fix) - All four lint checks pass: ruff check, ruff format, pylint R0801, auth-signals Co-authored-by: chkp-roniz <[email protected]> Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]> Co-authored-by: chkp-roniz <[email protected]> Co-authored-by: Claude Sonnet 4.6 <[email protected]> Co-authored-by: danielmeppiel <[email protected]>
TL;DR
Propagate the marketplace's registered
--refto relative string plugin sources soapm install plugin@marketplaceresolves against the registered branch, not the default branch.Problem (WHY)
When a marketplace is registered with
apm marketplace add owner/repo --ref feat/xxx, and itsmarketplace.jsonuses relative string sources (e.g."./plugins/my-plugin"),apm install my-plugin@my-marketplacedownloads the plugin from the default branch instead of the registered--ref.The ref is correctly persisted and used to fetch
marketplace.json, butresolve_marketplace_plugincallsresolve_plugin_sourcewithout passingsource.ref. The canonical string has no#refsuffix, so the downloader resolves against the default branch. The same gap exists in the GitLab structured-ref path where_gitlab_in_marketplace_dependency_referencereceivesNonefor string sources.Approach (WHAT)
Two surgical changes in
resolve_marketplace_plugin:GitHub-family path: After computing the canonical, append
#source.refwhen the plugin is a relative string source, no#refis already present, no explicitversion_specoverrides it, andsource.refis not"main"or"HEAD".GitLab/non-GitHub structured path: Fall back to
source.refin the ref argument to_gitlab_in_marketplace_dependency_referencewhenpath_refisNoneand noversion_spec.Validation
Fixes #1811