feat: marketplace maintainer UX (#722)#790
feat: marketplace maintainer UX (#722)#790sergio-sisternes-epam wants to merge 9 commits intomainfrom
Conversation
Empty commit to open the draft PR. Implementation follows. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…or, publish (#722) Introduces a full marketplace-maintainer command surface designed around an authored marketplace.yml that compiles to an Anthropic-compliant marketplace.json (byte-for-byte), plus a publisher that updates downstream consumers via PR. New commands: - apm marketplace init scaffold marketplace.yml - apm marketplace build compile yml -> marketplace.json - apm marketplace outdated show packages with newer upstream refs - apm marketplace check validate refs, tag_pattern, schema - apm marketplace doctor diagnose repo/tooling issues - apm marketplace publish push updates to consumer apm.yml via PR Library modules (src/apm_cli/marketplace/): - yml_schema, builder, tag_pattern, ref_resolver, semver - init_template, publisher, pr_integration, git_stderr Design invariant: marketplace.json matches Anthropic's standard exactly. APM-only fields (build:, per-entry version ranges, ref:, subdir:, tag_pattern:, includePrerelease:) live only in marketplace.yml and are stripped during compile. metadata: is verbatim pass-through; packages: is renamed to plugins: per Anthropic's schema. Consumer updates follow the existing apm.yml dependencies.apm string format (plugin@marketplace[#ref]). Raw git refs only - semver ranges are not accepted in the consumer syntax. Docs: new guide at docs/src/content/docs/guides/marketplace-authoring.md, CLI reference entries, and skill updates for commands + package-authoring. Tests: 4824 unit+integration tests passing (68 new integration tests, 7 live e2e tests default-skipped behind APM_E2E_MARKETPLACE). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Wrap the state-file path in rich.text.Text(..., no_wrap=True) so it renders on a single line and does not break the publish-state.json substring that CI tests rely on when the terminal width is 80 cols. (microsoft#790) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…terminals Rich was breaking `publish-state.json` across lines at 80-col width, which (a) made the path uncopyable for users and (b) caused CI test assertions checking for the substring to fail. Route the final state-file line through `console.print(..., soft_wrap=True)` with a `Text(..., no_wrap=True)` so the path is preserved verbatim regardless of terminal width. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
6ec634c to
72d1b7b
Compare
Introduce `apm marketplace plugin {add,set,remove}` for programmatic
management of marketplace.yml entries. Uses ruamel.yaml for round-trip
YAML editing that preserves comments and formatting.
- `plugin add <source>` appends a validated entry with remote verification
- `plugin set <name>` updates fields on an existing entry
- `plugin remove <name>` deletes an entry with confirmation prompt
Includes 37 unit tests, documentation updates (authoring guide, skill
reference, CHANGELOG), and ruamel.yaml>=0.18.0 as a new dependency.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
72d1b7b to
56c20fe
Compare
Address UX review findings for the plugin subgroup: - Show subcommand names in plugin group help text - Guard `plugin set` against zero-field invocations - Standardise `plugin remove` confirmation via click.confirm - Extract shared _is_interactive() helper to _helpers.py - Remove dead --no-verify flag from `plugin set` - Document plugin commands in CLI reference Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
APM Expert Review Panel -- PR #790Reviewers: Python Architect, CLI Logging Expert, DevX UX Expert, Supply Chain Security Expert, APM CEO, OSS Growth Hacker Panel Verdict: Approve with conditionsThis is APM's most significant feature since Two conditions must be met before merge. Seven high-priority findings should be tracked for fast-follow. Conditions for Merge
Findings by SeverityCritical (4 findings)
High / Important (14 findings)
Notes (11 findings)
What's Done WellThe panel unanimously highlighted these strengths:
Strategic Assessment (CEO)Positioning: This is APM's moat-defining feature. No competitor offers self-hosted marketplace authoring with semver resolution and cross-repo PR-driven publish. This is the Naming: Dependency: Release: This merits a dedicated Priority Fix Order
Panel composition and routingSix specialist agents reviewed independently, with findings consolidated by the orchestrator:
Per panel protocol, specialists raised findings independently. The CEO arbitrated strategic calls (naming ratification, dependency approval, release framing). The Growth Hacker annotated discoverability gaps and escalated the sidebar registration as critical. |
Security:
- Add path traversal guard on marketplace.yml output field (S1)
- Suppress git credential prompts with GIT_TERMINAL_PROMPT=0 (S3)
- Validate ConsumerTarget repo/branch against injection (S4)
Architecture:
- Replace locals().get("pr") with explicit variable (A7)
- Make SOURCE_RE public in yml_schema (A4)
Logging:
- Add Rich fallback for publish state-file display (L1)
UX:
- Enforce --version/--ref mutual exclusivity in plugin add (UX4)
- Remove phantom --marketplace-yml from CLI reference docs (UX3)
Docs:
- Wire marketplace authoring guide into docs sidebar (C2)
- Add consumer-to-author cross-link in marketplace guide (G1)
12 new tests covering all security and UX fixes.
Resolves panel findings S1, S3, S4, A7, A4, L1, UX3, UX4, C2, G1.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Architecture: - Extract shared atomic_write() to marketplace/_io.py (A1) - Extract shared redact_token() to marketplace/_git_utils.py (A2) - Fix token redaction regex to cover http:// and ?token= (S2) Logging: - Add verbose traceback output to 5 exception handlers (L3) UX: - Add summary line to outdated command output (UX5) - Exit code 1 when packages are outdated, matching npm/pip (UX5) 17 new tests covering DRY utilities, verbose tracebacks, and outdated summary/exit behaviour. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…xclusivity - Add GIT_TERMINAL_PROMPT=0 and GIT_ASKPASS=echo to publisher._run_git() chokepoint (8 subprocess calls including clone/push) — completes S3 fix - Add --version/--ref mutual exclusivity to plugin set (NEW-1 from panel) - Update stale _TOKEN_RE docstring references in publisher and pr_integration (N2) - Tests: TestRunGitEnv (publisher), plugin set conflict test Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
APM Expert Review Panel -- Round 2 (Fix Commit Validation)Scope: 3 fix commits ( Panel Verdict: APPROVE (6/6 specialists)
Merge Conditions -- Verified
Security Fixes -- Validated
Architecture Fixes -- Validated
Logging + UX Fixes -- Validated
New Findings from Round 2 (Non-Blocking)
Post-Merge Recommendations
Test Coverage4825 tests passing (+31 new tests from fix commits), 0 failures. Every security fix has corresponding test coverage:
|
…/set When no --ref is provided, plugin add now resolves HEAD to a concrete 40-char SHA via git ls-remote before storing it in marketplace.yml. When --ref HEAD or a branch name is given, a warning is emitted and the ref is auto-resolved to its current SHA for supply-chain safety. Explicit SHAs and tags are stored as-is. Adds resolve_ref_sha() to RefResolver for single-ref lookups. 26 new tests covering all resolution paths. Updates CLI reference, marketplace guide, and CHANGELOG. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Description
First pass of the maintainer-side marketplace tooling tracked in #722. Builds on the foundations landing in #677 (semver engine,
MarketplaceValidatorskeleton, security advisories, publish skeleton).Design context and the full UX proposal are captured in the discussion thread on the tracking issue: #722 (comment).
Hard rule driving this work
marketplace.jsonis Anthropic's standard, unaltered. APM emits the artifact byte-for-byte against Anthropic's schema; APM-only build inputs live inmarketplace.ymland are stripped at compile time. A golden-file test enforces round-trip compatibility with Claude Code.High-level scope
apm marketplace init— scaffoldmarketplace.ymlapm marketplace build— compilemarketplace.yml-> Anthropic-compliantmarketplace.json(concurrent ref resolution, diff output, dry-run)apm marketplace check— validation + freshness for CI (--strict, per-rule toggles)apm marketplace outdated— maintainer-side discovery of stale rangesapm marketplace publish— transactional add/update of a package entry (PR-first,--resume/--abortrecovery)apm marketplace doctor— preflight probe for git / gh / tokens /ls-remoteDetailed plan, UX previews, and the 45-item UX-risk absorption map live in the session plan and will be distilled into a design doc / changelog entry during delivery.
Fixes #722
Type of change
Testing
Draft — work in progress. Please hold review until marked ready.