Commit 357415f
authored
Fix CI step for
## 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.36
](#3936)
```
error: package `aws-runtime` is ambiguous: it is defined by in multiple manifests within the root path /home/build/workspace/smithy-rs/target/semver-checks/git-base/be980cd7049d9acdb38f68dd11c465b3a242733a
defined in:
/home/build/workspace/smithy-rs/target/semver-checks/git-base/be980cd7049d9acdb38f68dd11c465b3a242733a/aws/rust-runtime/aws-runtime/Cargo.toml
/home/build/workspace/smithy-rs/target/semver-checks/git-base/be980cd7049d9acdb38f68dd11c465b3a242733a/tmp-codegen-diff/aws-sdk/sdk/aws-runtime/Cargo.toml
```
Referring to the diagram in [a previous relevant
PR](#3272), we see that the
`tmp-codegen-diff` directory is used as [the output
directory](https://github.com/smithy-lang/smithy-rs/blob/e394ad8b099ea638e0f9c7549295aaebccc36a61/tools/ci-scripts/codegen-diff/diff_lib.py#L11)
by `diff_lib.py`. However, the current version of `cargo semver checks`
no longer supports duplicated crates within the same root directory
([PR](obi1kenobi/cargo-semver-checks#887)).
This requires a solution where we maintain a single source of crate
layout to validate against `cargo-semver-checks` under `smithy-rs`. To
address this, this PR implements the following approach:
- (Bonus point) Reverts the changes made in [the previous relevant
PR](#3272).
- Updates `semver-checks.py` to stop using
`checkout_commit_and_generate` in `diff_lib.py`, which automatically
places both the runtime crates and the generated SDK crates into
`tmp-codegen-diff`, leading to conflicts with the crates in
`rust-runtime` and in `aws/rust-runtime`.
- When `semver-checks.py` creates the `base` and `current` branches, we
remove runtime crates from both `rust-runtime` and `aws/rust-runtime` to
uniquify the runtime crates in the `aws/sdk/build/aws-sdk/sdk`
directory. Note that the removal of crates only occurs in the `base` and
`current` branches and does not impact the main branch.
- Moves the `aws/sdk/build/aws-sdk` directory to the root of `smithy-rs`
for a reason explained in dd021d1.
## Testing
- CI passed `cargo semver checks`
- Removed [this enum
variant](https://github.com/smithy-lang/smithy-rs/blob/e394ad8b099ea638e0f9c7549295aaebccc36a61/rust-runtime/aws-smithy-runtime/src/client/sdk_feature.rs#L13)
intentionally to cause an API breakage, the step correctly detected it
```
--- failure enum_variant_missing: pub enum variant removed or renamed ---
Description:
A publicly-visible enum has at least one variant that is no longer available under its prior name. It may have been renamed or removed entirely.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.36.0/src/lints/enum_variant_missing.ron
Failed in:
variant BusinessMetric::GzipRequestCompression, previously in file /Users/awsaito/src/smithy-rs/target/semver-checks/git-base/d87d9ee34a13da0ad4c0cdcbfa2c74b7f98d278c/aws-sdk/sdk/aws-runtime/src/user_agent/metrics.rs:108
```
----
_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._cargo semver checks (#4033)1 parent 0f215bb commit 357415f
2 files changed
+52
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
30 | 37 | | |
31 | 38 | | |
32 | 39 | | |
33 | 40 | | |
34 | 41 | | |
35 | 42 | | |
36 | 43 | | |
37 | | - | |
| 44 | + | |
38 | 45 | | |
39 | 46 | | |
40 | | - | |
| 47 | + | |
41 | 48 | | |
42 | 49 | | |
43 | 50 | | |
| |||
56 | 63 | | |
57 | 64 | | |
58 | 65 | | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
| 66 | + | |
64 | 67 | | |
65 | 68 | | |
66 | 69 | | |
| |||
93 | 96 | | |
94 | 97 | | |
95 | 98 | | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
| 99 | + | |
103 | 100 | | |
104 | 101 | | |
105 | 102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | | - | |
| 7 | + | |
10 | 8 | | |
11 | 9 | | |
12 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
13 | 46 | | |
14 | 47 | | |
15 | 48 | | |
| |||
27 | 60 | | |
28 | 61 | | |
29 | 62 | | |
30 | | - | |
31 | | - | |
| 63 | + | |
| 64 | + | |
32 | 65 | | |
33 | | - | |
| 66 | + | |
34 | 67 | | |
35 | 68 | | |
36 | 69 | | |
| |||
41 | 74 | | |
42 | 75 | | |
43 | 76 | | |
44 | | - | |
| 77 | + | |
45 | 78 | | |
46 | 79 | | |
47 | 80 | | |
| |||
0 commit comments