-
Notifications
You must be signed in to change notification settings - Fork 8
feat(mongodb-downloader)!: use a lockfile to prevent redundant parallel downloads MONGOSH-1875 #580
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
Merged
Merged
Changes from 12 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
20e4664
chore(mongodb-downloader): use a lockfile to prevent redundant parall…
gagik 1ef4dc5
chore: cleanup, use proper-lockfile, use original interface
gagik 8bab148
chore: use class
gagik 9f50210
chore: add proper tests
gagik fb9f1c7
chore: version naming tests
gagik e14716a
chore: rename file
gagik 365a452
docs: add migration guide
gagik 6e0975e
chore: correct docs
gagik 7078c3f
chore: fix package.json
gagik cc899eb
Merge branch 'main' of github.com:mongodb-js/devtools-shared into gag…
gagik ea6d5c0
chore: update mongodb-runner
gagik 6e82751
chore: fixup naming logic
gagik b538f66
Merge branch 'main' of github.com:mongodb-js/devtools-shared into gag…
gagik 10afb7c
chore: update readme
gagik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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,39 @@ | ||
| ## mongodb-downloader | ||
|
|
||
| A simple library to download MongoDB binaries for different platforms and versions. | ||
|
|
||
| ### Migrating from v0.4 to v0.5 | ||
|
|
||
| In v0.5.x, the library introduced lockfiles to prevent parallel downloads of the same MongoDB binary. It also changed the arguments for the `downloadMongoDb` and `downloadMongoDbWithVersionInfo` functions, introducing a new `useLockfile` field and using a single options object instead of separate parameters for different options. It is recommended to enable lockfiles to prevent redundant downloads unless you have a specific reason not to. | ||
|
|
||
| ```ts | ||
| // Before (v0.4.x) | ||
| downloadMongoDb('/tmp/directory', '4.4.6', { | ||
| platform: 'linux', | ||
| arch: 'x64', | ||
| }); | ||
|
|
||
| downloadMongoDbWithVersionInfo('/tmp/directory', '4.4.6', { | ||
| arch: 'x64', | ||
| }); | ||
|
|
||
| // After (v0.5.x) | ||
| downloadMongoDb({ | ||
| directory: '/tmp/directory', | ||
| version: '4.4.6', | ||
| useLockfile: true, // New, required field. | ||
| downloadOptions: { | ||
| platform: 'linux', | ||
| arch: 'x64', | ||
| }, | ||
| }); | ||
|
|
||
| downloadMongoDbWithVersionInfo({ | ||
| directory: '/tmp/directory', | ||
| version: '4.4.6', | ||
| useLockfile: true, // New, required field. | ||
| downloadOptions: { | ||
| arch: 'x64', | ||
| }, | ||
| }); | ||
| ``` | ||
This file contains hidden or 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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.