Skip to content

[FEATURE] Add a marketplace with just a full repository URL #1027

@rcollette

Description

@rcollette

Is your feature request related to a problem? Please describe.
I am unable to add a marketplace hosted in a gitlab repository that is several folder paths deep due to the 2 segment owner/repo path limitation.

Describe the solution you'd like
I would like to be able to specify the path to a report or the marketplace.json in a repo like:

apm marketplace add https://gitlab.com/mycompany/myorg/specs-and-standards/apm-internal-marketplace

Describe alternatives you've considered

Problem

The command:

apm marketplace add https://gitlab.com/mycompany/myorg/specs-and-standards/internal-marketplace --name myorg-internal-marketplace

cannot register a GitLab-hosted marketplace with subgroups.

Root Causes

  1. Parser rejects subgroup pathsapm marketplace add only accepts OWNER/REPO (2 parts) or HOST/OWNER/REPO (3 parts). The GitLab path mycompany/myorg/specs-and-standards/copilot-configuration has 4 segments.

  2. GitHub API used for all hosts — Internally, APM calls /api/v3/repos/... (GitHub's API) for every host, including GitLab. GitLab returns 410 Gone for this endpoint.

This is confirmed by open issue #1014 in the microsoft/apm repo.

Marketplace Storage

Registered marketplaces are stored in ~/.apm/marketplaces.json.

Workaround

Directly edit ~/.apm/marketplaces.json:

cat > ~/.apm/marketplaces.json << 'EOF'
{
  "marketplaces": [
    {
      "name": "myorg-internal-marketplace",
      "owner": "mycompany/myorg/specs-and-standards",
      "repo": "copilot-configuration",
      "host": "gitlab.com",
      "branch": "main",
      "path": "marketplace.json"
    }
  ]
}
EOF

This registers the marketplace (visible via apm marketplace list), but browse/update will fail until APM adds GitLab API support.

Additional context
Add any other context or screenshots about the feature request here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/featureNew capability, new flag, new primitive.

    Type

    No type

    Projects

    Status

    In Progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions