Skip to content

fix: correct stale tar.gz/tarball refs and publish UX gaps after zip default#1812

Closed
nadav-y wants to merge 1 commit into
mainfrom
fix/pr-1779-review-fixes
Closed

fix: correct stale tar.gz/tarball refs and publish UX gaps after zip default#1812
nadav-y wants to merge 1 commit into
mainfrom
fix/pr-1779-review-fixes

Conversation

@nadav-y

@nadav-y nadav-y commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #1779 (the zip-default cleanup). Fixes five issues surfaced by the post-merge panel review, plus completes the stale-string sweep the first pass missed.

  • --package missing from all examples (_PUBLISH_HELP in publish.py and Custom layouts in package-authoring.md): --package is required=True but every example omitted it -- copy-paste crash. Three panelists flagged this.
  • Four stale registry tarball for strings in resolver.py (lines 98, 104, 363, 369): same class of fix as extractor.py in the original PR, missed in the first pass. User-visible on every package validation failure.
  • Em dash in Forbidden ClickException (publish.py line 272): user-visible on 403 responses; prior commit fixed logger.info() calls in the same file but not this one.
  • Missing zip-build guidance in Custom layouts (registries.md): removed the tar czf example without adding a zip equivalent; adds a cross-platform python -m zipfile step.
  • No --tarball migration note (publish.md --zip row): CI pipelines using apm publish --tarball get No such option: --tarball with no recovery path.

What was omitted and why

  • --package optional (infer from apm.yml name:): design change, tracked as a separate issue per panel recommendation.
  • Pre-existing em dashes and section signs in internal comments (resolver.py, publish.py): outside this PR's scope; those are in non-user-visible code comments predating the cleanup.
  • test_mismatch_raises adding match= (nit): behavioral coverage confirmed; message-text trap deferred.

Test plan

  • uv run pytest tests/unit/registry/ passes (213 passed, 2 xfailed)
  • ruff check and ruff format --check pass on changed files
  • apm publish --help shows --package in all four examples
  • apm publish (no args) gives Missing option '--package' (not a crash from a different missing option)

Generated with Claude Code

…default (#1779)

apm publish and apm pack --archive now produce .zip by default (#1720).
This commit cleans all remaining stale references and fixes five UX gaps
surfaced in the post-merge panel review.

Stale reference cleanup:
- docs/reference/cli/publish.md: .tar.gz -> .zip, --tarball -> --zip,
  tarball root -> archive root, remove tar czf example, fix ASCII
- docs/guides/registries.md: same fixes + add cross-platform zip-build
  example in Custom layouts section
- docs/reference/registry-http-api.md: correct publish format note
- packages/apm-guide/.apm/skills/apm-usage/package-authoring.md:
  .tar.gz -> .zip, tarball -> archive, --tarball -> --zip
- packages/apm-guide/.apm/skills/apm-usage/workflow.md: .zip as default
- src/apm_cli/commands/publish.py: module docstring + em dash + tarball
- src/apm_cli/deps/registry/extractor.py: "tarball sha256 mismatch"
  -> "archive sha256 mismatch"
- src/apm_cli/deps/registry/resolver.py: em dash + tar.gz default

Panel review fixes (post-merge):
- publish.py _PUBLISH_HELP: add --package to all four examples (required=True
  flag was missing from every example -- copy-paste crash)
- publish.py line 272: replace em dash with -- in Forbidden ClickException
  (user-visible on 403 responses; prior commit missed this one)
- resolver.py lines 98, 104, 363, 369: replace "registry tarball for" with
  "registry archive for" in RegistryResolutionError strings (same class of
  fix as extractor.py, missed in first pass)
- package-authoring.md: add --package to all publish examples
- registries.md Custom layouts: add --package + python -m zipfile build step
  (Windows users had no actionable guidance after tar czf example was removed)
- publish.md --zip row: add "(renamed from --tarball in v0.20.0)" migration
  note so CI pipelines using --tarball get a recovery path

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 16, 2026 12:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR follows up on the zip-by-default shift for registry publishing/packing by sweeping remaining stale “tarball/tar.gz” references, tightening publish UX docs/examples to match the current CLI contract (--package required, --zip flag), and correcting a few user-visible messages.

Changes:

  • Updated apm publish help/examples and multiple docs pages to include the required --package flag and to use .zip / --zip terminology.
  • Reworded resolver/extractor error strings from “tarball” to “archive” and refreshed docs around registry publish Content-Type defaults.
  • Added custom-layout zip build guidance in the registries guide.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/apm_cli/deps/registry/resolver.py Updates user-facing resolution errors and clarifies extraction comment wording.
src/apm_cli/deps/registry/extractor.py Renames sha256 mismatch wording from tarball to archive.
src/apm_cli/commands/publish.py Updates command doc/help examples and replaces non-ASCII punctuation in user-visible strings.
packages/apm-guide/.apm/skills/apm-usage/workflow.md Refreshes install bundle format wording to reflect zip default + legacy tar.gz.
packages/apm-guide/.apm/skills/apm-usage/package-authoring.md Updates publish examples and archive terminology for zip default.
docs/src/content/docs/reference/registry-http-api.md Updates publish Content-Type/docs to match modern client zip behavior.
docs/src/content/docs/reference/cli/publish.md Updates CLI docs for --zip, examples, and error snippets.
docs/src/content/docs/guides/registries.md Adds cross-platform zip build guidance and updates publish examples/options.

"""``apm publish`` command upload a packed tarball to a registry.
"""``apm publish`` command -- upload a packed zip archive to a registry.

Implements docs/proposals/registry-api.md §5.3:
Comment on lines 292 to +294
# extract_archive dispatches on Content-Type (with magic-bytes
# fallback) supports both tar.gz (default) and zip (Anthropic
# skills format). Hash check happens before any extraction.
# fallback) -- supports both zip (default) and legacy tar.gz.
# Hash check happens before any extraction.
| `--registry NAME` | _(required when multiple registries configured)_ | Registry name from the `registries:` block. |
| `--package OWNER/REPO` | _(required)_ | Package identity to publish as (e.g. `acme/my-skill`). |
| `--tarball PATH` | auto-pack | Path to a pre-built `.tar.gz`. Skips auto-pack. |
| `--zip PATH` | auto-pack | Path to a pre-built `.zip`. Skips auto-pack. (renamed from `--tarball` in v0.20.0) |
Comment on lines +308 to +311
# Cross-platform zip build (Python stdlib -- no extra tools needed)
python -m zipfile -c ./build/my-skill-0.0.1.zip apm.yml .apm/

apm publish --package acme/my-skill --zip ./build/my-skill-0.0.1.zip
@nadav-y

nadav-y commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator Author

Superseded by the squash push to PR #1779.

@nadav-y nadav-y closed this Jun 16, 2026
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