Closed stennie closed 3 years ago
I would love if we could add functionality to choose a version of tools to download. My ideal API for this would be adding a "tools" command that has several subcommands that mimic the behavior of the root commands:
m tools stable
m tools latest
m tools X.Y
m tools ls
m tools installed
As a disclaimer, I work on the database tools, so my need for switching between particular versions of tools is probably greater than typical users of m
. Still I think this would be a great addition and the approach could be used to support mongosh
too.
I'd be happy to contribute to implementing support for the new standalone tools.
Thanks @tfogo! I also regularly switch between different combinations of server/tools and your subcommand suggestion is in line with what I was thinking of.
Some help on testing and defining expected behaviour would be excellent:
m tools X
(eg m tools 100
) also be supported? For the MongoDB server the version number shortcuts are major release series (X.Y) or specific release (X.Y.Z).m
to switch to an older server version which still includes the tools, should the server tool versions take precedence over the standalone tools? For my use case I think yes, but yours may be the opposite. Probably need to allow this to be a preference.Any another planning considerations would be helpful.
Regards, Stennie
Awesome! The new tools use semver so the options for versions should be:
Any versioned release of tools is a stable version. The "latest" release channel points to the head of master and is unstable. The "stable" release channel points to the latest stable version. The release process documentation is here: https://github.com/mongodb/mongo-tools/blob/master/RELEASE.md
When using
m
to switch to an older server version which still includes the tools, should the server tool versions take precedence over the standalone tools?
Our recommendation to users is to always use the latest version of tools with non-EOL versions of the server. We guarantee tools will work with non-EOL versions, but they should work fine with earlier versions too. So I think it would be best to have the standalone tools take precedence over the server tools.
I think it would be worth changing the log messages to help make it clear what versions of each are being used. Something like:
$ m 4.0.10
Activating: Server 4.0.10, Database Tools 100.0.1
$ m tools 4.0.10
Activating: Server 4.0.10, Database Tools 4.0.10
Also tagging @rychipman in case he has any thoughts.
@tfogo covered all the points I would have brought up. The proposed API & log message changes LGTM!
As of the MongoDB 4.4 RCs, database tools like
mongodump
,mongorestore
, etc are now separately distributed and versioned from the core server so the tarball downloads only includemongod
,mongos
, andmongo
.MongoDB Database Tools version 100 supports 3.6 through 4.4. It would be helpful for
m
to have a shortcut to download the latest tools. The tool binaries should probably be saved in a separate directory from the server versions.