-
Notifications
You must be signed in to change notification settings - Fork 226
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
Add Smithy Lock command #1974
Merged
Merged
Add Smithy Lock command #1974
Conversation
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
hpmellema
commented
Sep 11, 2023
import static org.mockserver.integration.ClientAndServer.startClientAndServer; | ||
import static software.amazon.smithy.cli.MavenResolverMultipleReposTest.mockArtifactAndSha; | ||
|
||
@Isolated |
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.
Necessary to prevent a socket binding issue on windows CI.
hpmellema
commented
Sep 11, 2023
@@ -86,11 +86,6 @@ private static final class Options implements ArgumentReceiver { | |||
private String projection; | |||
private String plugin; | |||
|
|||
@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 override is removed as this is identical to the default.
35ec219
to
7953c1d
Compare
mtdowling
reviewed
Sep 11, 2023
smithy-cli/src/main/java/software/amazon/smithy/cli/dependencies/DependencyUtils.java
Outdated
Show resolved
Hide resolved
smithy-cli/src/main/java/software/amazon/smithy/cli/dependencies/PinnedArtifact.java
Outdated
Show resolved
Hide resolved
smithy-cli/src/main/java/software/amazon/smithy/cli/dependencies/PinnedArtifact.java
Outdated
Show resolved
Hide resolved
smithy-cli/src/main/java/software/amazon/smithy/cli/dependencies/LockFile.java
Outdated
Show resolved
Hide resolved
smithy-cli/src/main/java/software/amazon/smithy/cli/dependencies/Artifact.java
Outdated
Show resolved
Hide resolved
smithy-cli/src/main/java/software/amazon/smithy/cli/commands/ClasspathAction.java
Outdated
Show resolved
Hide resolved
mtdowling
requested changes
Sep 12, 2023
smithy-cli/src/main/java/software/amazon/smithy/cli/commands/DependencyUtils.java
Outdated
Show resolved
Hide resolved
smithy-cli/src/main/java/software/amazon/smithy/cli/commands/DependencyUtils.java
Outdated
Show resolved
Hide resolved
smithy-cli/src/main/java/software/amazon/smithy/cli/commands/DependencyUtils.java
Outdated
Show resolved
Hide resolved
smithy-cli/src/main/java/software/amazon/smithy/cli/commands/DependencyUtils.java
Outdated
Show resolved
Hide resolved
smithy-cli/src/main/java/software/amazon/smithy/cli/commands/ClasspathAction.java
Outdated
Show resolved
Hide resolved
smithy-cli/src/test/resources/software/amazon/smithy/cli/commands/smithy-lock-test.json
Show resolved
Hide resolved
smithy-cli/src/main/java/software/amazon/smithy/cli/commands/LockFile.java
Outdated
Show resolved
Hide resolved
smithy-cli/src/main/java/software/amazon/smithy/cli/commands/LockFile.java
Outdated
Show resolved
Hide resolved
smithy-cli/src/main/java/software/amazon/smithy/cli/commands/LockFile.java
Outdated
Show resolved
Hide resolved
smithy-cli/src/main/java/software/amazon/smithy/cli/commands/LockFile.java
Outdated
Show resolved
Hide resolved
mtdowling
requested changes
Sep 12, 2023
smithy-cli/src/main/java/software/amazon/smithy/cli/commands/DependencyUtils.java
Outdated
Show resolved
Hide resolved
5d4ed7f
to
93f90dd
Compare
f86540e
to
6d9d6bc
Compare
mtdowling
approved these changes
Sep 18, 2023
sugmanue
reviewed
Sep 19, 2023
smithy-cli/src/it/java/software/amazon/smithy/cli/LockCommandTest.java
Outdated
Show resolved
Hide resolved
smithy-cli/src/it/java/software/amazon/smithy/cli/LockCommandTest.java
Outdated
Show resolved
Hide resolved
smithy-cli/src/main/java/software/amazon/smithy/cli/commands/ClasspathAction.java
Outdated
Show resolved
Hide resolved
smithy-cli/src/main/java/software/amazon/smithy/cli/commands/ConfigurationUtils.java
Show resolved
Hide resolved
smithy-cli/src/main/java/software/amazon/smithy/cli/dependencies/DependencyUtils.java
Show resolved
Hide resolved
sugmanue
approved these changes
Sep 19, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description of changes
Adds a lock file implementation to the smithy CLI.
Users can lock their dependencies using the
smithy lock
CLI command. This resolve all dependencies defined in the config and will generate a lock file namedsmithy-lock.json
that pins the resolved dependencies.Future calls to the smithy cli will then use the pinned versions of dependencies defined in the lockfile rather than the dependency versions (and potentially ranges) specified in the config file whenever a lockfile is present.
If the config file changes from what was used to generate the local lockfile an error is generated instructing users to re-lock their dependencies.
Benchmarking
Without Cache
Before - 99.5ms +- 3.0ms (1sigma, 15 runs)
After (no-lockfile) - 101.9ms +- 3.13ms (1 sigma, 10runs)
After (lockfile) - 109ms +- 3.6ms (1 sigma, 10 runs)
With Cache
Before - 37ms +- 0.5ms (1sigma, 15 runs)
After (no lockfile) - 39ms +- 1.5ms (1 sigma, 10 runs)
After (lockfile) - 50.1ms +- 2.1ms (1 sigma, 10 runs)
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.