Repository navigation
Conversation
Add workspace and per-package preMajor ({ breaking, feat }, each minor or patch). While the current major is 0 on a semver project, a breaking change and a feat take the configured bump instead. No effect from 1.0.0 on; unset keeps the current behaviour.
Closes #1376
Signed-off-by: BryanFRD <bryanferrando59@gmail.com>
Signed-off-by: BryanFRD <bryanferrando59@gmail.com>
* fix(migrate): map release-please extra-files and pre-major flags Read extra-files (generic, toml on Cargo.toml, json $.version) and report anything else under "Review manually". Map bump-minor-pre-major to zerover with a warning, warn on bump-patch-for-minor-pre-major, disable autoMergeReleases, enable updateLockfiles for lockfile manifests, fall back to the directory name for the root package, and write only non-default keys in the migrate output. Closes #1375 Signed-off-by: BryanFRD <bryanferrando59@gmail.com> * fix(migrate): drop stale release-type warning and test config round-trip The no-file-mapping warning now fires only when a package ends up with no versioned files. Migrated configs of every source are reloaded through the config loader and compared. Signed-off-by: BryanFRD <bryanferrando59@gmail.com> * fix(migrate): map release-please pre-major flags to preMajor bump-minor-pre-major sets preMajor.breaking: minor and bump-patch-for-minor-pre-major sets preMajor.feat: patch, each on its own. Serialise preMajor in camelCase. Signed-off-by: BryanFRD <bryanferrando59@gmail.com> --------- Signed-off-by: BryanFRD <bryanferrando59@gmail.com>
There was a problem hiding this comment.
Changes requested. preMajor is applied to a package's own commits but not to bumps that arrive through the dependency cascade, so a 0.x package can still be released as 1.0.0.
Blocking
src/monorepo/run/cascade.rs:106: cascaded bumps bypasspreMajor.apply_pre_majoris only called atplan.rs:400, on the bump derived from the package's own commits.resolve_cascaded(cascade.rs:105-106) passes the propagated bump straight tocompute_next_version.- Scenario: workspace
preMajor {breaking: minor}.coreis at 1.2.0 and getsfeat!, so it bumps Major.appis at 0.3.0 anddependsOncore withpropagate: same.cascade_roundhandsappa Major andappis released as 1.0.0, which is whatpreMajoris meant to prevent. - It also affects a package with its own commits: its held bump is the remapped Minor, the incoming Major wins in
cascade_round(graph.rs:52), and it is recomputed as 1.0.0. - The
plan.rstest only covers direct commits, so this path is untested. - Suggested fix: in
resolve_cascaded, remap before computing:let bump = apply_pre_major(pkg.effective_pre_major(&config.workspace), strategy, ¤t_version, bump);ahead ofcompute_next_version. Add a cascade test with a 1.x upstream breaking change and a 0.x dependent carryingpreMajor. graph --impact(cascade_round) will still show the raw propagated level. That is acceptable since it previews membership, not versions, but worth a note.
- Scenario: workspace
Formal verification
The formal verification step failed and returned no result, so nothing was verified by it.
…cade A 0.x package that only moved because a dependency took a breaking change still released as 1.0.0. Both the post-loop cascade and the raise of a package's own plan now remap the incoming bump. Signed-off-by: BryanFRD <bryanferrando59@gmail.com>
|
Fixed in bf73a16.
Tests: a 0.3.0 dependent of a 1.2.0 package taking a breaking change goes to 0.4.0 through the cascade, a 0.3.0 package with its own patch is raised to 0.4.0, and one already at minor stays at 0.4.0. All three fail with the remaps removed.
|
There was a problem hiding this comment.
Changes requested. The preMajor remap is correct where it is wired in (plan, cascade, upgrade raises) and well tested, but it is applied per call site. The why and impact previews still compute the next version without it, so they disagree with what release does.
Blocking
src/monorepo/run/why/mod.rs:442:ferrflow whyignorespreMajorfor dependency-triggered bumps.decide()passes the raw cascaded bump tocompute_next_version. Withworkspace.preMajor.breaking = minor, a 0.3.0 dependent of a package taking a major is reported as going to 1.0.0 bywhy, whilerelease(cascade.rs:105) writes 0.4.0.bump_leaves_version_unchanged(line 359) has the same gap.
Fix: callapply_pre_major(pkg.effective_pre_major(&config.workspace), strategy, ¤t, bump)beforecompute_next_versionin both places. Better, add one helper (for examplePackageConfig::next_version(workspace, strategy, current, bump)) and routeplan.rs,cascade.rs,upgrade.rs,why/mod.rsandimpact.rsthrough it so the rule cannot be missed at a call site.
To fix
- major,
src/monorepo/impact.rs:68:Versions::nextcallscompute_next_versionwith the propagated bump directly, so the graph impact report shows 0.x packages going to 1.0.0 under a breaking seed even whenpreMajorkeeps them in 0.x. Applyapply_pre_majorwithpkg.effective_pre_major(&self.config.workspace)and the current version first, or use the shared helper above.
Suggestions
src/config/migrate/release_please.rs:143: extra-files mapping, default pruning inprune.rs,autoMergeReleases: falseand the cwd-based default package name are independent of the pre-1.0 bump rules. They look correct, but splitting them out would make each easier to review and revert.
Formal verification
The formal verification step failed and returned no result, so nothing is verified there.
Adds an opt-in
preMajorsetting (workspace, overridable per package) so asemverproject below 1.0.0 can bump like release-please'sbump-minor-pre-major+bump-patch-for-minor-pre-major:semverwhile the current major is 0. From 1.0.0 on it has no effect; leaving 0.x staysferrflow release --force-version 1.0.0.minororpatch). Unset means today's behaviour, so existing configs are unchanged.compute_plan, socheck,whyand cascades show the adjusted bump. Cascaded bumps are not remapped twice.zeroveris untouched.Not changed: the standalone
ferrflow changelog,status,version_diffandapi_checkbump displays, which compute bumps outside the release plan.Tests
feat!→ 0.6.0,feat→ 0.5.1,fix→ 0.5.1; from 1.0.0 nothing changes; unset keepsfeat!→ 1.0.0v-prefixed and unparseable versionscompute_plan: 0.5.0 plans 0.6.0, 1.0.0 plans 2.0.0Schema,
npm/types/config.d.ts, README and the en/fr config docs are updated. Versioned docs (v0 to v6) are not.Also carries #1380 (merged into this branch): the release-please migrator maps
extra-filesand both pre-major flags, the latter topreMajor.Closes #1376
Closes #1375