Azure / Azure/azure-sdk-for-rust
Core crates should require path references and new versions if changed
- Dominant language
- Rust
- Stars
- 884
- Forks
- 365
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 102
Description
If the shipped version of azure_core is 0.22.0, then the default for packages in the repo should be to depend in 0.22.0. This would mean the the workspace dependency for core should be
```toml
[workspace.dependencies.azure_core]
version = "0.22.0"
```
If there are unreleased changes for core on main, we want the packages in the repo to depend on the new unreleased version, so we should have them depend on core from its path:
```toml
[workspace.dependencies.azure_core]
path = "core/azure_core"
```
The version in `core/azure_core/Cargo.toml` should have been updated to a new unreleased version after the release of 0.22.0:
```toml
[package]
name = "azure_core"
version = "0.23.0"
```
This could be generalized as:
- A version in workspace dependencies is for pinning to a released version of a package
- A path in workspace dependencies is for pinning to the current unreleased version of a package
- Packages will rev new versions numbers after release, so the version in /Cargo.toml should be newer than the version in workspace.dependencies
- Packages like typespec and core will always use path based workspace dependencies if they have unreleased changes
- This means that when azure_core has unreleased changes, by default, all of the other packages in the repo will depend on the unreleased version of core and azure_core will have to ship before them
- If a package in the repo is unchanged since its release, the repo should reflect consuming the package as a released dependency
- If there are changes made to a package in a PR and that package is considered a **must uptake** package like azure_core or typespec, then the PR that makes a change in the package must also check that the workspace dependency is set to path mode, not version
Proposed change:
Add a check in the PR build to confirm that the package is either not marked as "must uptake" or that it is set to Path mode in workspace.dependencies
Contributor guide
Assessment
This issue has not been assessed yet.