-
Notifications
You must be signed in to change notification settings - Fork 385
marketplace.packages[].source: generalize beyond host/owner/repo (deeply-nested GitLab subgroups, arbitrary git hosts) #1519
Copy link
Copy link
Closed
Labels
area/enterpriseAir-gapped/GHE configurability, registry proxy, rulesets, adoption playbook.Air-gapped/GHE configurability, registry proxy, rulesets, adoption playbook.area/marketplacemarketplace.json schema, federation, authoring suite, source parity.marketplace.json schema, federation, authoring suite, source parity.priority/highHuman-set high priority; not scope approval, a release commitment or a required milestone.Human-set high priority; not scope approval, a release commitment or a required milestone.status/acceptedHuman scope approval; verify the issue's approval record and review contact before work.Human scope approval; verify the issue's approval record and review contact before work.status/shepherdingActively being driven by an APM shepherd runActively being driven by an APM shepherd runstatus/triagedAutomated advice completed; deduplication only. Not human approval; silence is not approval.Automated advice completed; deduplication only. Not human approval; silence is not approval.theme/governanceGoverned by policy. apm-policy, audit, enforcement, enterprise rollout.Governed by policy. apm-policy, audit, enforcement, enterprise rollout.type/featureNew capability, new flag, new primitive.New capability, new flag, new primitive.
Milestone
Description
Activity
Metadata
Metadata
Assignees
Labels
area/enterpriseAir-gapped/GHE configurability, registry proxy, rulesets, adoption playbook.Air-gapped/GHE configurability, registry proxy, rulesets, adoption playbook.area/marketplacemarketplace.json schema, federation, authoring suite, source parity.marketplace.json schema, federation, authoring suite, source parity.priority/highHuman-set high priority; not scope approval, a release commitment or a required milestone.Human-set high priority; not scope approval, a release commitment or a required milestone.status/acceptedHuman scope approval; verify the issue's approval record and review contact before work.Human scope approval; verify the issue's approval record and review contact before work.status/shepherdingActively being driven by an APM shepherd runActively being driven by an APM shepherd runstatus/triagedAutomated advice completed; deduplication only. Not human approval; silence is not approval.Automated advice completed; deduplication only. Not human approval; silence is not approval.theme/governanceGoverned by policy. apm-policy, audit, enforcement, enterprise rollout.Governed by policy. apm-policy, audit, enforcement, enterprise rollout.type/featureNew capability, new flag, new primitive.New capability, new flag, new primitive.
Type
Projects
- StatusShow more project fieldsDone
Summary
PR #1288 (merged) extended
marketplace.packages[].sourceto accept<host.tld>/<owner>/<repo>andhttps://<host.tld>/<owner>/<repo>[.git]. That unblocks GitHub Enterprise and shallow GitLab layouts, but the regex pins exactly three path segments (host + owner + repo), and the test suite explicitly rejects 4+ segments (test_four_segment_path_rejected).Self-hosted GitLab deployments commonly nest projects under multiple subgroups, e.g.:
That's host + 4 path segments + repo. With the post-#1288 schema there is still no
sourceform that names this repo — the schema rejects every URL form, thegit: { url: ... }object form is rejected as "must be a non-empty string", and the bare<owner>/<repo>shorthand silently routes to github.com regardless ofmarketplace.owner.url. Theapm viewresolver, by contrast, already handles arbitrary-depth host-prefixed paths correctly — so this is a marketplace-schema gap, not a resolver-capability gap.Repro
apm.yml:The object form sometimes recommended in authoring guides also fails:
Evidence the resolver itself isn't the blocker
Evidence
marketplace.owner.urlis unused at resolution timeWith:
I wrapped
gitonPATHto log every invocation.apm marketplace checkran:The shorthand routed to github.com, ignoring
owner.url. That's consistent with the schema docs (§7.3):owner.urlis documented as "Owner homepage" — descriptive metadata, not a resolution input.Why this matters
Self-hosted GitLab with subgroup nesting is the canonical enterprise pattern in many orgs. Until the schema accepts a form that names these repos, APM marketplaces can't list them — and the only schema-accepted shorthand silently exfiltrates the lookup to github.com under whatever auth happens to be in scope, which is also a small footgun for anyone publishing a marketplace from an enterprise tenant.
Suggested directions
Two options, not mutually exclusive:
Option A (preferred): a marketplace-level git base, packages name themselves relative to it
This is the shape every other package manager has converged on —
npm'sregistry,cargo's[registries], Maven's<repositories>. Declare the host/path once, then entries don't repeat it. It sidesteps the "how many slashes" parser problem entirely.A new field is cleaner than repurposing
owner.url(which is documented as "Owner homepage" and the official example,https://github.com/contoso, is a profile page with no git semantics):Properties:
host.tld/owner/repoform is the per-package escape hatch.sourceBaseis a strict prefix concatenation (no segment counting), so it composes with arbitrary GitLab subgroup depth, Bitbucket workspaces, Gitea orgs, etc.https://scheme, reject userinfo / port / query / fragment (same security posture as fix: add support for custom github endpoints (host.tld/owner/repo) as apm.yml entrypoint for command apm pack (marketplace) #1288).(Field name
sourceBaseis illustrative —host,defaultHost,registry, etc. are all reasonable.)Option B (mechanical fallback): widen the source regex to accept
>3path segmentsTreat the last two slash-separated segments as
owner/repo, everything before ashost + group path. Same security guards from #1288 (no userinfo, no port, no query, https-only for URL form). Less elegant than Option A but a smaller diff ifsourceBaseis too big a change to land soon.These compose well — Option A is the principled fix, Option B is available for one-off packages that don't fit the marketplace's base.
Decision needed from maintainers
Before anyone invests in implementation, it would help to know which direction lands cleanly with your design intent for the marketplace block:
Once a direction is chosen I'm happy to take a stab at the implementation PR (schema + tests + docs), tested against an actual deeply-nested self-hosted GitLab on our side. Just need the maintainer steer first to avoid building the wrong thing.
Out of scope (suggested for separate issues)
git@host:path) — explicitly rejected by fix: add support for custom github endpoints (host.tld/owner/repo) as apm.yml entrypoint for command apm pack (marketplace) #1288 for confused-deputy reasons; not asking to revisit here.httpsURL schemes — same.References
host.tld/owner/repoform; pins the limit viatest_four_segment_path_rejected.addsource parity with the Anthropic spec #676, [FEATURE] URL-based marketplace work Extension #692 — adjacent source-shape parity work.