feat(marketplace): add package category option - #2637
feat(marketplace): add package category option#2637Ching Wei Kang (WilliamK112) wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Adds first-class --category TEXT support to marketplace package authoring commands so maintainers can set marketplace-owned package categories via CLI (parallel to the existing --tags workflow) and persist them onto marketplace.packages[].
Changes:
- Add
--categoryoption toapm marketplace package addandapm marketplace package set, persisting tomarketplace.packages[].categoryvia the round-trip YAML editor. - Extend YAML editor support for writing/updating
categoryon package entries (validated via existing schema revalidation + restore-on-failure behavior). - Update CLI reference + producer authoring docs examples; add unit tests for persistence and blank-value rejection.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/marketplace/test_yml_editor.py | Adds coverage that category is written on add/update paths. |
| tests/unit/commands/test_marketplace_plugin.py | Adds CLI tests ensuring --category is present and persisted; adds blank-category error/rollback checks. |
| src/apm_cli/marketplace/yml_editor.py | Adds category to add/update entry mutation logic. |
| src/apm_cli/commands/marketplace/plugin/set.py | Adds --category Click option and passes through to update logic. |
| src/apm_cli/commands/marketplace/plugin/add.py | Adds --category Click option and passes through to add logic. |
| docs/src/content/docs/reference/cli/marketplace.md | Documents the new --category flag in the CLI reference table. |
| docs/src/content/docs/producer/publish-to-a-marketplace.md | Updates authoring examples to show --category usage. |
Suppressed comments (1)
tests/unit/commands/test_marketplace_plugin.py:244
- This assertion depends on the YAML text formatting (e.g., quoting). To test the behavior (category persisted on the target package entry), parse the YAML and assert on the loaded data structure instead of substring-matching the serialized file.
)
assert result.exit_code == 0, result.output
assert "category: productivity" in yml.read_text(encoding="utf-8")
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…age-category # Conflicts: # packages/apm-guide/.apm/skills/apm-usage/commands.md
|
Resolved the current-main conflict in The only content conflict was in the bundled command guide. The resolution preserves the newer upstream Fresh validation on the merged tree:
GitHub now reports the PR as mergeable. |
Description
Add
--category TEXTtoapm marketplace package addandapm marketplace package set, following the existing--tagsauthoring path.The category is persisted on the target
marketplace.packages[]entry and remains independent of metadata in the source package manifest. Existing marketplace schema validation rejects blank values; the round-trip editor restores the original file when validation fails.This also updates the CLI reference, bundled command guide, and marketplace authoring examples.
Fixes #2625
Type of change
Current-main reconciliation
mainataa8a6820in merge commit309c3f82.apm doctordocumentation while adding--categoryto the package add/set rows.main.Testing
Validation performed on the reconciled tree:
ruff check src/ tests/: passedruff format --check src/ tests/: 1,695 files already formattedgit diff --check origin/main: passedSpec conformance (OpenAPM v0.1)