Skip to content

Drop POST/DELETE /-/refs (publish is the only way refs enter)#42

Merged
fengmk2 merged 1 commit into
mainfrom
drop-post-delete-refs
Jul 1, 2026
Merged

Drop POST/DELETE /-/refs (publish is the only way refs enter)#42
fengmk2 merged 1 commit into
mainfrom
drop-post-delete-refs

Conversation

@fengmk2

@fengmk2 fengmk2 commented Jul 1, 2026

Copy link
Copy Markdown
Member

(Recreated from #41, which GitHub auto-closed when its stacked base drop-static-preview-refs was deleted on #38's merge. Now targets main directly.)

Why

POST /-/refs (register-only) and DELETE /-/refs (unregister) have no production caller , the publish action uses /-/tarball + /-/publish, which registers the ref internally. Register-only's only distinct capability was a "registered but unpublished" ref, which falls back to the on-demand build that serves the unversioned upstream bytes pnpm-strict rejects (the explicitly-unsupported path). Removing both makes the model an invariant: a ref exists only once it has been published with artifacts.

What

  • Remove the POST and DELETE /-/refs handlers and the now-dead unregisterRef. GET /-/refs (discovery) stays; registerRef stays (used by /-/publish).
  • Tests: the fixture seeds via /-/publish (the production path). Register/unregister/auth tests fold into publish-based equivalents.
  • Coverage preserved: the optional-dependency URL rewriting (previously only asserted by the now-passthrough packument test) moves down to a buildPreviewTarball unit assertion.
  • README admin section updated.

Verify

tsc clean, 73 tests pass, action bundle unaffected. Net −57 lines.

POST /-/refs (register-only) and DELETE /-/refs (unregister) had no production
caller: the publish action uses /-/tarball + /-/publish, which registers the ref
internally. Register-only only enabled the unsupported on-demand-build result
(unversioned upstream bytes that pnpm-strict rejects). Removing both makes 'a ref
exists only once it has been published with artifacts' an invariant and drops the
now-dead unregisterRef.

GET /-/refs (discovery) stays. The test fixture seeds its ref via /-/publish (the
production path); the register/unregister/auth tests fold into publish-based
equivalents; the optional-dependency URL rewriting moves to a buildPreviewTarball
unit assertion (it had been covered only by the now-passthrough packument test).
@fengmk2 fengmk2 merged commit 567495b into main Jul 1, 2026
4 checks passed
@fengmk2 fengmk2 deleted the drop-post-delete-refs branch July 1, 2026 00:40
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.

1 participant