-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
ci: rewrite bump check and respect semver #12395
Conversation
r? @epage (rustbot has picked a reviewer for you, use r? to override) |
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.
This looks good. Two suggestions to make it even better:
- Consider using the cargo-semver-checks GitHub Action, which automatically sets up proper rustdoc caching and other nice things like that.
- If not, then consider at least caching the
target/semver-checks/cache/
directory across runs, to enable reuse of rustdoc JSON when the baseline version hasn't changed. This would probably reduce semver-checking time by about half.
I understood the baseline rustdoc wrong. It should be fixed on latest beta branch for nightly cargo, and latest stable branch for beta cargo. Make it as a draft temporarily. |
c9d1524
to
809acf3
Compare
cargo-semver-checks
to detect semver violations
Thanks @obi1kenobi! Some questions:
|
809acf3
to
12fb677
Compare
12fb677
to
01298e1
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
ci: rewrite bump check and respect semver ### What does this PR try to resolve? This ports `ci/validate-version-bump.sh` and #12200 to the new xtask `bump-check`. It also adds the ability to set the correct baseline revision when checking version bump. That is, it fixes #12347. In addition, this integrates the community tool `cargo-semver-checks`. SemVer violation can now be detected earlier. ### How should we test and review this PR? This PR extracts the registry query part from `xtask-unpublished` and removes other pars. I don't feel like we need it in the short term. For how it works, please the check doc comment in each function. One concern is that this check is still a required job for bors. I believe `@obi1kenobi` is quite responsive and willing to help if there is something wrong. So, waiting for an upstream fix won't be a problem for cargo. Also as a good citizen in the community, we can always contribute back. (Take it easy `@obi1kenobi,` don't be stressed out 🙂) <!-- homu-ignore:end -->
01298e1
to
0beb3d8
Compare
@bors try |
ci: rewrite bump check and respect semver ### What does this PR try to resolve? This ports `ci/validate-version-bump.sh` and #12200 to the new xtask `bump-check`. It also adds the ability to set the correct baseline revision when checking version bump. That is, it fixes #12347. In addition, this integrates the community tool `cargo-semver-checks`. SemVer violation can now be detected earlier. ### How should we test and review this PR? This PR extracts the registry query part from `xtask-unpublished` and removes other pars. I don't feel like we need it in the short term. For how it works, please the check doc comment in each function. One concern is that this check is still a required job for bors. I believe `@obi1kenobi` is quite responsive and willing to help if there is something wrong. So, waiting for an upstream fix won't be a problem for cargo. Also as a good citizen in the community, we can always contribute back. (Take it easy `@obi1kenobi,` don't be stressed out 🙂) <!-- homu-ignore:end -->
crates/xtask-bump-check/src/xtask.rs
Outdated
let base_tree = base_commit.as_object().peel_to_tree()?; | ||
let head_tree = head.as_object().peel_to_tree()?; | ||
let diff = repo | ||
.diff_tree_to_tree(Some(&base_tree), Some(&head_tree), Default::default()) |
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.
I am not sure which one is better
- Diff members between
base...head
- Diff members between
referenced_commit..head
base
here refers to the commit this PR want to merge into. referenced_commit
is what fn referenced_commit
returns.
The former one focuses on the current PR and is more time/resource efficient, while the latter one can catches something like #12401, though in the future case like #12401 shouldn't appear after this PR gets merged.
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.
Since this is only used for the finding of whats changed and not for comparing the versions, I think using the PR base is sufficient
As you mentioned, by using the beta branch for comparing versions, #12401 shouldn't be a problem
💥 Test timed out |
Out of curiosity, what's the motivation for using a git revision as the baseline in CI? Asking because the usual CI workflow is to check against the previous published version, and I'd love to figure out if there's an alternative workflow we're not doing a great job of supporting today.
|
I see. Thanks for the info! The release of Cargo is included in Rust's 6-weeks train model. Every crate gets into beta is considered as “released”, though they won't actually be released until hitting stable. The model I propose here is roughly like
I don't feel like it is a common case. It should be a low priority task as well, as |
8f9d9b0
to
f91d830
Compare
Thanks for the review. Most of the review comments are addressed. |
f91d830
to
7b6585f
Compare
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.
Feel free to r= me
7b6585f
to
a95e615
Compare
This is a rewrite of old `ci/validate-version-bump.sh` in Rust.
a95e615
to
8d31d62
Compare
@bors r=epage Thanks a lot for the review and your prior pull request! |
☀️ Test successful - checks-actions |
Update cargo 8 commits in c91a693e7977e33a1064b63a5daf5fb689f01651..6dc1deaddf62c7748c9097c7ea88e9ec77ff1a1a 2023-07-31 00:26:46 +0000 to 2023-08-02 00:23:54 +0000 - `#[allow(internal_features)]` in RUSTC_BOOTSTRAP test (rust-lang/cargo#12429) - ci: rewrite bump check and respect semver (rust-lang/cargo#12395) - fix(update): Tweak CLI behavior (rust-lang/cargo#12428) - chore(deps): update compatible (rust-lang/cargo#12426) - Display crate version on timings graph (rust-lang/cargo#12420) - chore(deps): update alpine docker tag to v3.18 (rust-lang/cargo#12427) - Use thiserror for credential provider errors (rust-lang/cargo#12424) - Clarify in `--help` that `cargo test --all-targets` excludes doctests (rust-lang/cargo#12422) r? `@ghost`
Update cargo 8 commits in c91a693e7977e33a1064b63a5daf5fb689f01651..6dc1deaddf62c7748c9097c7ea88e9ec77ff1a1a 2023-07-31 00:26:46 +0000 to 2023-08-02 00:23:54 +0000 - `#[allow(internal_features)]` in RUSTC_BOOTSTRAP test (rust-lang/cargo#12429) - ci: rewrite bump check and respect semver (rust-lang/cargo#12395) - fix(update): Tweak CLI behavior (rust-lang/cargo#12428) - chore(deps): update compatible (rust-lang/cargo#12426) - Display crate version on timings graph (rust-lang/cargo#12420) - chore(deps): update alpine docker tag to v3.18 (rust-lang/cargo#12427) - Use thiserror for credential provider errors (rust-lang/cargo#12424) - Clarify in `--help` that `cargo test --all-targets` excludes doctests (rust-lang/cargo#12422) r? ``@ghost``
Update cargo 10 commits in c91a693e7977e33a1064b63a5daf5fb689f01651..020651c52257052d28f6fd83fbecf5cfa1ed516c 2023-07-31 00:26:46 +0000 to 2023-08-02 16:00:37 +0000 - Update rustix to 0.38.6 (rust-lang/cargo#12436) - replace `master` branch by default branch in documentation (rust-lang/cargo#12435) - `#[allow(internal_features)]` in RUSTC_BOOTSTRAP test (rust-lang/cargo#12429) - ci: rewrite bump check and respect semver (rust-lang/cargo#12395) - fix(update): Tweak CLI behavior (rust-lang/cargo#12428) - chore(deps): update compatible (rust-lang/cargo#12426) - Display crate version on timings graph (rust-lang/cargo#12420) - chore(deps): update alpine docker tag to v3.18 (rust-lang/cargo#12427) - Use thiserror for credential provider errors (rust-lang/cargo#12424) - Clarify in `--help` that `cargo test --all-targets` excludes doctests (rust-lang/cargo#12422) r? `@ghost`
Update cargo 10 commits in c91a693e7977e33a1064b63a5daf5fb689f01651..020651c52257052d28f6fd83fbecf5cfa1ed516c 2023-07-31 00:26:46 +0000 to 2023-08-02 16:00:37 +0000 - Update rustix to 0.38.6 (rust-lang/cargo#12436) - replace `master` branch by default branch in documentation (rust-lang/cargo#12435) - `#[allow(internal_features)]` in RUSTC_BOOTSTRAP test (rust-lang/cargo#12429) - ci: rewrite bump check and respect semver (rust-lang/cargo#12395) - fix(update): Tweak CLI behavior (rust-lang/cargo#12428) - chore(deps): update compatible (rust-lang/cargo#12426) - Display crate version on timings graph (rust-lang/cargo#12420) - chore(deps): update alpine docker tag to v3.18 (rust-lang/cargo#12427) - Use thiserror for credential provider errors (rust-lang/cargo#12424) - Clarify in `--help` that `cargo test --all-targets` excludes doctests (rust-lang/cargo#12422) r? `@ghost`
What does this PR try to resolve?
This ports
ci/validate-version-bump.sh
and #12200 to the new xtaskbump-check
. It also adds the ability to set the correct baseline revision when checking version bump. That is, it fixes #12347.In addition, this integrates the community tool
cargo-semver-checks
. SemVer violation can now be detected earlier.How should we test and review this PR?
This PR extracts the registry query part from
xtask-unpublished
and removes other pars. I don't feel like we need it in the short term.For how it works, please the check doc comment in each function.
One concern is that this check is still a required job for bors. I believe @obi1kenobi is quite responsive and willing to help if there is something wrong. So, waiting for an upstream fix won't be a problem for cargo. Also as a good citizen in the community, we can always contribute back.
(Take it easy @obi1kenobi, don't be stressed out 🙂)