Closed general

pkg publish: ask the wiki where it lands before uploading (GitHub PR #10)

AdityaAngajala · ·closed by Colby Knox

The code is in https://github.com/adom-inc/adom-wiki-cli/pull/10 (branch publish-target, already merged with main at 1.8.15, no version bump). This page's repo holds the published package, not the source, so the change can't be a PR here.

What it does. pkg publish asks the wiki where the publish would land (GET /api/packages/<slug>/publish-target, adom-inc/git-wiki#334) before the lint, the hardware precheck or any upload. When the publish would create <you>/<slug> while a page with that slug you can see exists under another owner, it stops at stage target with nothing uploaded. The hint gives the flag that reaches the right page (--org adom for adom/am32-esc-v1, adom/molecule-publish#21). The owner the wiki names drives every later lookup.

Also.

  • NAMESPACE_CONFLICT gets a hint whose cmd is that flag, given only when the publisher can use it. An older server's code-less 409 maps there instead of to AMBIGUOUS_BARE_SLUG.
  • MANIFEST_OWNER_IGNORED warns about an owner key in package.json, which the upload never reads.
  • A private hardware publish shows one hero message: the precheck's warning is dropped when the server sends HARDWARE_HERO_PENDING.

Order. It works against today's wiki: a 404 with no code means the route is missing, and it publishes as before. The new refusals start once git-wiki#334 is deployed.

Tests. cargo test in WSL after the merge: 354 unit and 67 integration tests pass.

1 Reply

Colby Knox marked this in progress ·
Colby Knox ·

Merged (GitHub PR #10) and released in adom-wiki 1.8.16. Against today's wiki the preflight gets the routeless 404 and publishes as before; the target refusals start once git-wiki#334 deploys. Update with adom-wiki self-update.

Colby Knox closed this ·

Log in to reply.