Skip to content

fix(publish): clarify --package is required and update docs#1562

Open
nadav-y wants to merge 2 commits into
microsoft:mainfrom
nadav-y:main
Open

fix(publish): clarify --package is required and update docs#1562
nadav-y wants to merge 2 commits into
microsoft:mainfrom
nadav-y:main

Conversation

@nadav-y
Copy link
Copy Markdown
Contributor

@nadav-y nadav-y commented May 31, 2026

Summary

  • apm publish always required --package to supply the owner/repo identity, but the error message and --package help text both referred to a non-functional source: fallback in apm.yml (the field was never read from the YAML)
  • Removed all references to source: as a publish identity source — it's a runtime-only field set by the resolver, not a root-level apm.yml field for this purpose
  • Updated registries.md examples and option table so --package is consistently shown as required
  • Added TestResolvePackageId unit tests covering the --package path and the no-identity error

What changed

  • publish.py: --package help text and UsageError message no longer mention source: in apm.yml
  • registries.md: all apm publish examples now include --package acme/my-skill; option table updated
  • Tests: _resolve_package_id unit tests added

Test plan

  • apm publish without --package shows clear error pointing to --package
  • apm publish --package acme/my-skill --dry-run resolves correctly
  • pytest tests/unit/commands/test_publish_registry_archive.py passes

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings May 31, 2026 08:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/repo usage.
  • Add unit tests for _resolve_package_id parsing 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).",
)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
"""
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

valid point. fixing

nadav-y and others added 2 commits May 31, 2026 14:55
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants