fix(publish): clarify --package is required and update docs#1562
Open
nadav-y wants to merge 2 commits into
Open
fix(publish): clarify --package is required and update docs#1562nadav-y wants to merge 2 commits into
nadav-y wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates apm publish guidance and tests to make registry publish identity (OWNER/REPO) explicit via --package, and tightens messaging around package-id resolution.
Changes:
- Update CLI help/error messaging to emphasize
--package owner/repousage. - Add unit tests for
_resolve_package_idparsing and missing-override behavior. - Update registry guide examples to always pass
--package.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| tests/unit/commands/test_publish_registry_archive.py | Adds coverage for _resolve_package_id and clarifies tests around required --package. |
| src/apm_cli/commands/publish.py | Updates --package help text and the _resolve_package_id error message. |
| docs/src/content/docs/guides/registries.md | Updates documentation/examples to always provide --package owner/repo. |
Comment on lines
57
to
61
| "package_id", | ||
| default=None, | ||
| metavar="OWNER/REPO", | ||
| help="Override owner/repo identity (default: parsed from 'source:' in apm.yml).", | ||
| help="Package identity to publish as (required: owner/repo, e.g. acme/my-skill).", | ||
| ) |
Contributor
Author
There was a problem hiding this comment.
valid point. fixing
Comment on lines
+69
to
+74
| class TestResolvePackageId: | ||
| """Unit tests for ``_resolve_package_id`` owner/repo resolution. | ||
|
|
||
| ``--package owner/repo`` is the only supported way to supply the identity; | ||
| there is no implicit fallback from apm.yml fields or git remote. | ||
| """ |
Contributor
Author
There was a problem hiding this comment.
valid point. fixing
Comment on lines
+84
to
+87
| def test_no_override_raises_with_package_hint(self) -> None: | ||
| pkg = APMPackage(name="x", version="1.0.0", source=None) | ||
| with pytest.raises(UsageError, match="--package"): | ||
| _resolve_package_id(pkg, override=None) |
Contributor
Author
There was a problem hiding this comment.
valid point. fixing
Fixed misleading error message and --package help text that referenced a non-functional source: fallback. Updated registries.md examples and option table to show --package consistently. Added tests for the _resolve_package_id path. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ack archive Matches npm behaviour of bundling standard root-level documentation files when present. Matched case-insensitively; LICENSE has no required extension. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
apm publishalways required--packageto supply theowner/repoidentity, but the error message and--packagehelp text both referred to a non-functionalsource:fallback inapm.yml(the field was never read from the YAML)source:as a publish identity source — it's a runtime-only field set by the resolver, not a root-levelapm.ymlfield for this purposeregistries.mdexamples and option table so--packageis consistently shown as requiredTestResolvePackageIdunit tests covering the--packagepath and the no-identity errorWhat changed
publish.py:--packagehelp text andUsageErrormessage no longer mentionsource:inapm.ymlregistries.md: allapm publishexamples now include--package acme/my-skill; option table updated_resolve_package_idunit tests addedTest plan
apm publishwithout--packageshows clear error pointing to--packageapm publish --package acme/my-skill --dry-runresolves correctlypytest tests/unit/commands/test_publish_registry_archive.pypasses🤖 Generated with Claude Code