Repository navigation
fix(publish): keep dependency order and branch-first push in per-package mode - #765
Conversation
…age mode Per-package mode gave each publish stage a single update, so the npm and cargo dependency sorts and every registry's publishOrder had nothing to order, and packages published in VersionOutput order. Merge each selected registry's own publish order into one sequence before the loop. pushPackageTag also pushed the tag before the branch, so a rejected branch push left an orphan tag on the remote. Push the branch first, as batch mode does. Refs #735 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Standing release PR: #730 · v0.42.1 queued (4 packages) · open 6h 43m · ✅ ready to merge Release Preview — v0.42.0 → v0.42.1
These changes will be added to the release PR (#730) when merged: Changelogmonorepo 0.42.0 → 0.42.1
After merge — predicted release
Updated automatically by ReleaseKit |
|
Order-dependent crate failure with two hybrids (found in a review pass; not pushed, since this PR has an owner)
Repro, added to it('should publish a hybrid crate after its path dependency when the npm sides are unrelated', async () => {
write('packages/a/package.json', packageJson('a'));
write('packages/a/Cargo.toml', cargoToml('a-crate', 'b-crate = { path = "../b", version = "0.1.0" }\n'));
write('packages/b/package.json', packageJson('b'));
write('packages/b/Cargo.toml', cargoToml('b-crate'));
await runPipeline(
perPackageInput([update('a', 'packages/a/package.json'), update('b', 'packages/b/package.json')]),
getDefaultConfig(),
options,
);
expect(publishedLabels().filter((l) => l.startsWith('cargo'))).toEqual([
'cargo publish b-crate@0.2.0',
'cargo publish a-crate@0.2.0',
]);
});It fails with Suggested fix: build edges from real dependencies (npm workspace deps from each |
Turning each registry's whole sorted order into constraints also encoded npm's arbitrary order for unrelated packages. For two hybrids whose crates depend on each other but whose npm sides don't, that contradicted cargo's path dependency, the cycle fell back to input order, and a crate could publish before its dependency. Constrain only by npm workspace deps, cargo path deps, and a configured publishOrder. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Description
Per-package mode had two bugs. That mode runs when any update carries a
tag: single, async,version.groups, or sync withpackageSpecificTags.publishOrder, had nothing to order. Packages published inVersionOutputorder, so a dependent crate could publish before its path dependency andcargo publishwould then fail.topologicalOrder(the function the batch sorts use), over the constraints of every selected registry at once. The constraints are npm workspace dependencies, cargo path dependencies, and a configuredpublishOrder, which keeps batch mode's listed-then-rest order.package.jsonandCargo.tomlin one directory) publishes to both registries in one step, before its tag. Only real constraints count: npm's arbitrary order for unrelated packages would contradict cargo's.Related Issue(s)
Refs #735. This doesn't address item 3 there (re-running failed jobs after a partial publish); it stays open in that issue.
Type of Change
feat— New featurefix— Bug fixdocs— Documentation changerefactor— Code refactoringtest— Adding or updating testschore— Maintenance, dependencies, toolingScope
@releasekit/version@releasekit/notes@releasekit/publish@releasekit/release@releasekit/config@releasekit/coreChecklist
pnpm lint)pnpm test)pnpm typecheck)Testing Notes
runPipelinein per-package mode with the real stages, mocking exec, git and auth.publishOrder, and a configured npm one, beat input order.main's@releasekit/publishsource.pushPackageTagtests that pinned tag-first now expect branch-first. The branch-rejection test also asserts that the tag isn't pushed.pnpm testpass, including the root integration suite.🤖 Generated with Claude Code