Skip to content
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 12 commits into from
Oct 2, 2023
Merged

Add Smithy Lock command #1974

merged 12 commits into from
Oct 2, 2023

Conversation

hpmellema
Copy link
Contributor

@hpmellema hpmellema commented Sep 8, 2023

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 named smithy-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.

@hpmellema hpmellema requested a review from a team as a code owner September 8, 2023 23:04
import static org.mockserver.integration.ClientAndServer.startClientAndServer;
import static software.amazon.smithy.cli.MavenResolverMultipleReposTest.mockArtifactAndSha;

@Isolated
Copy link
Contributor Author

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.

@@ -86,11 +86,6 @@ private static final class Options implements ArgumentReceiver {
private String projection;
private String plugin;

@Override
Copy link
Contributor Author

@hpmellema hpmellema Sep 11, 2023

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.

@hpmellema hpmellema requested a review from mtdowling September 12, 2023 19:00
@hpmellema hpmellema merged commit bc16862 into smithy-lang:main Oct 2, 2023
@hpmellema hpmellema deleted the lock-command branch October 2, 2023 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants