-
Notifications
You must be signed in to change notification settings - Fork 318
Add SemVer checks #3375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add SemVer checks #3375
Conversation
c190716 to
726de70
Compare
726de70 to
f84e0e2
Compare
API Change CheckAPIView identified API level changes in this PR and created the following API reviews |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds semantic versioning (SemVer) compatibility checks to the Azure SDK for Rust build pipeline using cargo-semver-checks. The changes ensure that package version updates comply with SemVer rules before releases.
Key changes:
- Introduces a new PowerShell script to check SemVer compatibility of packages
- Extracts common cargo metadata functions to a shared module for reuse
- Adds cgmanifest.json to track the cargo-semver-checks tool version used in builds
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| eng/scripts/shared/Cargo.ps1 | New shared module containing reusable cargo metadata and package querying functions |
| eng/scripts/Test-Semver.ps1 | New script that installs cargo-semver-checks and validates package changes against SemVer rules |
| eng/scripts/Pack-Crates.ps1 | Refactored to use shared cargo functions from Cargo.ps1, eliminating duplication |
| eng/pipelines/templates/jobs/pack.yml | Adds SemVer check tasks to both auto and manual service directory build scenarios |
| eng/cgmanifest.json | New manifest tracking cargo-semver-checks version 0.45.0 as a development dependency |
| Write-Host "cargo install cargo-semver-checks --locked $($versionParams -join ' ')" | ||
| cargo install cargo-semver-checks --locked @versionParams |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not Invoke-LogCommand or whatever that is we use everywhere else? I see other places it'd work in this PR as well.
eng/cgmanfiest.jsonto track installation of a dev tool in the build systemTest-Semver.ps1uses the version specified ineng/cgmanifest.jsonTested:
Test performance
SemVer checks add a non-trivial amount of time in some OS configurations (Windows, MacOS) because
rust-semver-checksis built.rust-semver-checkbuild times (look at logs for builds of stable in this PR run):Caching considerations
Also discussed here: #3158
Azure DevOps caches are scoped according to several factors. In the case of a PR where speed is most important, we would need a job that runs against
mainto populate a cache that PRs could read. We don't currently schedule PR pipelines to run. In fact, vcpkg, uses its own cache mechanism with relevant rules.If we needed to semver check across OS quickly, we could use a storage account to hold pre-built binaries (similar to vcpkg). The binaries would be built in a Rust pipeline and uploaded to the storage account with a path prefix like
carge-semver-checks/ubuntu-24/0.45.0/. Something would need to update the cache and cgmanifes.json file and proper arrangements would need to be made locally so that callingcargo semver-checkswould use the correct binary.Similar work could also be done to cache source analysis binaries
Other considerations
Checking "nightly" and "msrv" versions of Rust is more complicated. Generally,
cargo-semver-checkssupports "stable" so SemVer checking focuses there.PRs should also block on semver-breaking changes. It may be possible that future version schemes (e.g. adding
-beta.xto a version number) may not block PRs because semver allows breaking changes in-beta.xversions. This will need to be investigated as part of the version incrementing script. We'd either need to adjust the version scheme or update-beta.xat CI execution time.