fix(publish): continue publishing workspace after a package fails#35133
fix(publish): continue publishing workspace after a package fails#35133divybot wants to merge 4 commits into
Conversation
When publishing a workspace with multiple packages, a failure while publishing one package would fast-fail the whole process via the `?` operator in `perform_publish`, aborting before the remaining in-flight and queued packages (and steps like provenance attestation) were handled. Collect publish errors instead of propagating the first one: keep publishing the other independent packages, preserve each error's context chain, and exit non-zero at the end reporting all collected failures. Packages depending on a failed package are still skipped (we don't call `finish_package` for a failure) so they're never published against a missing version. Co-Authored-By: Divy Srivastava <me@littledivy.com>
|
Reviewed the change — the core logic is correct and the dependent-blocking behavior holds up (a failed package isn't
|
Address review feedback on #35133: - Add a spec test where a package depends on a failing one, locking in that blocked dependents stay unpublished and ensure_no_pending() does not swallow the collected errors. - Report skipped (blocked) dependents instead of silently dropping them. - Document why the retained ensure_no_pending()? is safe.
|
Thanks for the review! Addressed all three points in 50df891:
|
|
CI note: the The All publish-related tests (including the two new |
…streaming This test (added in #35049) and the legacy-abort deprecation warning (added in #34397) landed in parallel and collided on main: the test exercises legacy abort with a handler that accesses request.signal and returns successfully, which is exactly what #34397 warns about, but its main.out wasn't updated. main has been failing this spec test on every commit since #34397, which blocks CI for this PR (and every other) once merged with main. The warning is correct for this scenario, so expect it in the test output. Folded in here (rather than the standalone #35191) to make this PR's CI self-sufficient; happy to split back out if preferred.
|
Pushed 1dc97f9: merged latest |
…ming Merging main brings in #34397, which emits a legacy-abort deprecation warning when a Deno.serve handler uses legacy request.signal abort on a successful response. The request_signal_streaming spec exercises exactly that path, so its expected output must include the warning line. Same fix as the closed #35191 (folded into #35133); included here so this PR's CI is self-sufficient. Unrelated to the blob-worker change.
When running
deno publishfor a workspace containing multiple packages, a failure while publishing one package caused the entire publish process to fast-fail. The remaining (independent) packages — and steps like provenance attestation for already-published packages — were skipped.The fast-fail was the
?inperform_publish(cli/tools/publish/mod.rs):Fix
Instead of aborting on the first error, the publish loop now:
anyhowcontext chain (theFailed to publish <package>chain) rather than discarding it,A package that fails is intentionally not passed to
finish_package, so any packages depending on it stay blocked and are never published against a missing version. Independent packages publish as normal.When a single package fails its original error (and context chain) is returned unchanged; when multiple fail they are combined into one error that lists every failure with its full chain.
Test
Adds the
publish/workspace_continue_on_errorspec test: a workspace with one package that publishes successfully and two that fail at the registry. It asserts the successful package is still published, that both failures are reported with their context chains, and that the command exits non-zero. The test registry mock (tests/util/server/servers/jsr_registry.rs) now simulates a publish failure for packages namedpublish-fails*.Background: originally attempted in #26829, which went stale after the code moved from
cli/tools/registry/mod.rstocli/tools/publish/mod.rs.Closes #35091
Closes denoland/divybot#562