Fix CI step for cargo semver checks
#4033
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation and Context
Fixes CI step for running
cargo semver checks
Description
The said CI step has been failing for the past three months. The most recent failure observed in CI looks like the following, since we upgraded the version of
cargo-semver-checks
to 0.36Referring to the diagram in a previous relevant PR, we see that the
tmp-codegen-diff
directory is used as the output directory bydiff_lib.py
. However, the current version ofcargo semver checks
no longer supports duplicated crates within the same root directory (PR).This requires a solution where we maintain a single source of crate layout to validate against
cargo-semver-checks
undersmithy-rs
. To address this, this PR implements the following approach:semver-checks.py
to stop usingcheckout_commit_and_generate
indiff_lib.py
, which automatically places both the runtime crates and the generated SDK crates intotmp-codegen-diff
, leading to conflicts with the crates inrust-runtime
and inaws/rust-runtime
.semver-checks.py
creates thebase
andcurrent
branches, we remove runtime crates from bothrust-runtime
andaws/rust-runtime
to uniquify the runtime crates in theaws/sdk/build/aws-sdk/sdk
directory. Note that the removal of crates only occurs in thebase
andcurrent
branches and does not impact the main branch.aws/sdk/build/aws-sdk
directory to the root ofsmithy-rs
for a reason explained in dd021d1.Testing
cargo semver checks
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.