Skip to content

feat(publish): skip already-published versions before type checking - #35134

Merged
littledivy merged 3 commits into
mainfrom
orch/divybot-563
Jun 11, 2026
Merged

littledivy merged 3 commits into
mainfrom
orch/divybot-563

Conversation

@divybot

@divybot divybot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Summary

deno publish previously type checked and prepared every package before attempting to publish, only discovering that a version was already published when the registry rejected the upload (the duplicateVersionPublish path). For packages whose version is already on the registry this wasted the entire β€” and expensive β€” type-check + tarball step.

This adds the up-front check requested in #30280:

  1. Probe the registry for each package's version concurrently.
  2. Drop already-published versions before preparing anything. If every version is already published, return early without type checking at all.
  3. Type check + prepare the remaining packages.
  4. Publish β€” the existing post-prepare duplicateVersionPublish handling still covers the race where another CI run lands the same version in the meantime.

Skip-and-continue, not bail

Following the feedback on the earlier #30347, already-published versions are skipped with a warning (matching today's idempotent duplicateVersionPublish behavior) rather than turned into a hard error. This keeps workspace partial publishes and idempotent CI re-runs working. Only a 200 OK is treated as "already published"; a 404 (or any other non-success status) is treated as "not published" so a transient registry error never blocks a legitimate publish.

Other changes

  • Extracts shared helpers registry::parse_package_name and registry::get_package_version_api_url (also used by publish_package).
  • Fixes a missing closing quote in the invalid-package-name error message.

Tests

  • New spec test tests/specs/publish/already_published β€” publishing an already-published version skips it and exits successfully without type checking. The fake JSR registry now answers the version-existence GET (404 by default; a reserved already-published scope simulates an existing version).
  • registry::test_parse_package_name unit test.
  • Full cargo test specs::publish suite (64 tests) and specs::init pass.

Closes #30280

Closes denoland/divybot#563

`deno publish` previously type checked and prepared every package before
attempting to publish, only discovering that a version was already
published when the registry rejected the upload. For packages whose
version is already on the registry this wasted the entire (expensive)
type-check and tarball step.

Now `deno publish` probes the registry for each package's version up
front and drops already-published versions before preparing anything.
When every version is already published it returns early without
type checking at all. Matching the existing `duplicateVersionPublish`
behavior, already-published versions are skipped with a warning rather
than erroring, so re-running after a partial or concurrent publish still
succeeds. The post-prepare publish step still handles the race where
another publish lands a version in the meantime.

Also extracts a shared `registry::parse_package_name` /
`get_package_version_api_url` and fixes a missing quote in the invalid
package name error message.

Co-Authored-By: Divy Srivastava <me@littledivy.com>
@divybot
divybot marked this pull request as ready for review June 11, 2026 06:43
@divybot

divybot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

The wpt release linux-x86_64 failure (and the dependent ci status) is unrelated to this change. The single failing WPT test is /workers/Worker-structure-message.html, which timed out after 120s (a flaky worker test), and some WebSocket tests log certificate expired errors from an expired test fixture cert (not valid after May 2024). This PR only touches deno publish / cli/registry.rs / the JSR registry test handler β€” nothing in workers, websockets, fetch, or TLS. All 133 other checks (including specs, unit, integration, node_compat, lint, lint title) pass. Re-triggering CI to clear the flake.

Co-Authored-By: Divy Srivastava <me@littledivy.com>
@divybot

divybot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

Update on the wpt failure β€” root cause confirmed from the job log, and it is an infra flake unrelated to this PR:

  • Step "Run web platform tests (release)" passed: final result: ok. 5785 passed; 0 failed; 1983 expected failure.
  • Step "Autobahn testsuite" failed on docker pull: it retried docker pull crossbario/autobahn-testsuite:25.10.1@sha256:… 6 times (docker pull failed Error: Exited with code: 1), then Unable to find image … locally β†’ Exited with code: 125.

That's the CI runner failing to pull the Autobahn Docker image (Docker Hub network/rate-limit), not anything in this change β€” this PR only touches deno publish / cli/registry.rs / the JSR registry test mock and contains no runtime/WebSocket changes. Re-triggering to clear the transient pull failure.

Co-Authored-By: Divy Srivastava <me@littledivy.com>
@littledivy
littledivy merged commit 9aff2d5 into main Jun 11, 2026
136 checks passed
@littledivy
littledivy deleted the orch/divybot-563 branch June 11, 2026 17:35
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.

Speed up deno publish

2 participants