feat: enforce lockstep major/minor versioning in release automation #219
No reviewers
Labels
No labels
adr
automated
bug
chore
dependencies
documentation
enhancement
epic
github-actions
P1-high
P2-medium
P3-low
release
research
rust
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jwilger/eventcore!219
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/release-versioning"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Implements ADR-025's lockstep versioning policy to ensure all workspace crates maintain identical major.minor versions while allowing independent patch versions.
Problem
The current release-plz configuration was creating release PRs where one crate would bump to 0.3.0 while others remained at 0.2.x, violating ADR-025's lockstep major/minor versioning policy.
Root Cause: release-plz performs independent semver analysis on each crate. When one crate has breaking changes, only that crate gets bumped to a new major/minor version.
Solution
Added post-processing to enforce lockstep versioning after release-plz's semver analysis:
Three-Step Workflow
Modified
.github/workflows/release-plz.yml:release-plz update- Analyze commits and update versions (independent semver)enforce-lockstep-versions.sh- Adjust all crates to highest major.minor versionrelease-plz release-pr- Create PR with lockstep-enforced versionsNew Scripts
.github/scripts/enforce-lockstep-versions.sh- Fixes version skew (used in release workflow).github/scripts/validate-lockstep-versions.sh- Validates lockstep compliance (used in CI).github/scripts/test-lockstep-scripts.sh- Integration tests proving correctnessCI Validation
Added
version-lockstepjob to.github/workflows/ci.yml:Documentation
Updated
docs/RELEASE_PROCESS.mdwith comprehensive "Version Lockstep Enforcement" section explaining:Example
Before this fix:
After this fix:
Testing
All integration tests pass:
Test results:
Verification
After merging this PR, the next release PR created by the workflow will have all crates sharing the same major.minor version, regardless of which crate actually had breaking changes.
References
Five issues found: sed portability problems (macOS/Linux), version parsing breaks on pre-release/build metadata, missing validation after enforcement in release workflow.
@ -0,0 +1,137 @@#!/usr/bin/env bashPortability issue:
sed -isyntax differs between macOS and Linux. On macOS, requires empty string for in-place edit:sed -i "" .... On Linux,sed -iworks without it.Recommended fix:
Version parsing issue: This breaks on semver pre-release/build versions like
0.2.0-alpha.1or0.2.0+build.123. The IFS-based split only handlesmajor.minor.patch.Either:
@ -0,0 +1,102 @@#!/usr/bin/env bashsed portability issue: Same macOS/Linux incompatibility as enforce-lockstep-versions.sh:108. Also affects lines 41 and throughout the script.
@ -0,0 +1,95 @@#!/usr/bin/env bashSame version parsing issue: Breaks on pre-release/build metadata. Apply same fix as enforce-lockstep-versions.sh:53.
@ -50,0 +54,4 @@- name: Enforce lockstep major/minor versioningrun: |# ADR-025 requires all crates share identical major.minor versions# This script adjusts versions after release-plz's semver analysisMissing validation: After running
enforce-lockstep-versions.sh, should validate the result withvalidate-lockstep-versions.shto catch any bugs in the enforcement script. Add:All previously requested changes have been addressed.