-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix migrate command version matchers
Previously, Smithy models with versions without a decimal suffix (`.0`) would not be matched properly in the `smithy migrate` command. For Smithy models with a version of `"1"`, the upgraded files would result in conflicting version control statements, e.g. ```smithy $version: "2.0" $version: "1" // ... ``` Similarly for Smithy models with a version of `"2"`, the files would incorrectly attempt to be upgraded, e.g. ```smithy $version: "2.0" $version: "2" // ... ``` This change loosens the version matchers to match the [`Version::fromString`](https://github.com/awslabs/smithy/blob/c95943844a65a6623f79ac647e54326d87a68c24/smithy-model/src/main/java/software/amazon/smithy/model/loader/Version.java#L205-L216) implementation.
- Loading branch information
Steven Yuan
committed
May 12, 2023
1 parent
c959438
commit e399ee7
Showing
10 changed files
with
43 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions
5
...ources/software/amazon/smithy/cli/commands/upgrade/cases/version-decimal-suffix.v1.smithy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
$version: "1.0" | ||
|
||
namespace com.example | ||
|
||
string Foo |
5 changes: 5 additions & 0 deletions
5
...ources/software/amazon/smithy/cli/commands/upgrade/cases/version-decimal-suffix.v2.smithy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
$version: "2.0" | ||
|
||
namespace com.example | ||
|
||
string Foo |
5 changes: 5 additions & 0 deletions
5
...ces/software/amazon/smithy/cli/commands/upgrade/cases/version-no-decimal-suffix.v1.smithy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
$version: "1" | ||
|
||
namespace com.example | ||
|
||
string Foo |
5 changes: 5 additions & 0 deletions
5
...ces/software/amazon/smithy/cli/commands/upgrade/cases/version-no-decimal-suffix.v2.smithy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
$version: "2.0" | ||
|
||
namespace com.example | ||
|
||
string Foo |
1 change: 1 addition & 0 deletions
1
...test/resources/software/amazon/smithy/cli/commands/upgrade/no-op/decimal-suffix.v2.smithy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$version: "2.0" |
1 change: 1 addition & 0 deletions
1
...t/resources/software/amazon/smithy/cli/commands/upgrade/no-op/no-decimal-suffix.v2.smithy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$version: "2" |