Skip to content

version-bump check doesn't know a subcrate hasn't bumped on nightly if we've bumped it on beta #12347

Closed
@weihanglo

Description

Problem

We've added cargo unpublished xtask and ci/validate-version-bump.sh to help the project to detect if a pull request has touched any subcrate and needs a version bump for it. This works well when there is no bump on beta branch. Bad thing happens when we already have a bump on the current beta but not yet published, cargo published would assume we've already bumped that crate.

In reality, we should consider crate version in beta branch as “published” and check the version bump against that instead of published one on crates.io. Every crate gets into beta branch of the 6 weeks release window should be considered as “published”.

Steps

In #12310, the check thought crates-io crate has been bumped. Actually it is required to update to 0.37.0, since 0.36.1 will be published with 1.72.0, but #12310 is targeted at 1.73.0. or 1.74.0 if merged.

Possible Solution(s)

It is quite tricky to solve this. Subcrates are not necessary to follow the train release model with Rust and Cargo. However, there are some requirements we need to pay attention to

  • Subcrates are somehow loosely bound to Cargo. Sometimes a specific change is required by a certain version of Cargo, so it needs to be released when cargo gets released.
  • We may not want to have a separate release cadence for each subcrate. It would be a maintenance burden.
  • We may not want to release a subcrate when the cargo version it is bound to has yet hit stable, since everything could change before that.

I don't have a good answer for the release model of subcrates, but here is a proposal that may make it more explicit:

  • A subcrate version can contain build metadata to show with which cargo version it is supposed to be released. That is, for crates-io 0.36.1 it would be 0.36.1+1.71.0, so that is pretty clear it is targeted to be released with Rust 1.71.0.
  • If we need to backport to a subcrate on beta, for example crates-io@0.36.1 to 0.37.0, then we just bump it to 0.37.0+1.71.0. We then need a xtask automation to detect that on beta it has got a version bump so on nightly we need to adjust accordingly.

Version

This is about project infra but let me record the point of time it happened.

cargo 1.70.0 (ec8a8a0ca 2023-04-25)
release: 1.70.0
commit-hash: ec8a8a0cabb0e0cadef58902470f6c7ee7868bdc
commit-date: 2023-04-25

Metadata

Assignees

No one assigned

    Labels

    A-infrastructureArea: infrastructure around the cargo repo, ci, releases, etc.C-bugCategory: bugS-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions