Package: db-contrib-tool
db-contrib-toolThedb-contrib-tool- MongoDB's tools for contributors.Table of contentsdb-contrib-toolTable of contentsDescriptionDependenciesInstallationUsageContributor's Guide (local development)Install project dependenciesRun command line tool (local development)Run lintersRun testsPre-commitTesting changes in mongoTesting changes locallyVersioningCode ReviewDeploymentDescriptionThe command line tool with various subcommands:bisectREADME.mdperforms an evergreen-aware git-bisect to find the 'last passing version' and 'first failing version' of mongosetup-repro-envREADME.mddownloads and installs:particular MongoDB versionsdebug symbolsartifacts (including resmoke, python scripts etc)python venv for resmoke, python scripts etcsymbolizeREADME.mdSymbolizes stacktraces from recentmongodandmongosbinaries compiled in Evergreen, including patch builds, mainline builds, and release/production builds.Requires authenticating to an internal MongoDB symbol mapping service.DependenciesPython 3.9 or later (python3 from theMongoDB Toolchainis highly recommended)InstallationMake suredependenciesare installed.
Usepipxto install db-contrib-tool that will be available globally on your machine:python3-mpipinstallpipx
python3-mpipxensurepathInstalling db-contrib-tool:python3-mpipxinstalldb-contrib-toolUpgrading db-contrib-tool:python3-mpipxupgradedb-contrib-toolIn case of installation errors, some of them may be related to pipx and could be fixed by re-installing pipx.Removing pipx completely (WARNING! This will delete everything that is installed and managed by pipx):python3-mpipuninstallpipx
rm-rf~/.local/pipx# in case you're using the default pipx home directoryNow you can try to install again from scratch.UsagePrint out help message:db-contrib-tool--helpFor more information seedescriptionsection.Contributor's Guide (local development)Install project dependenciesThis project usespoetryfor dependency management.poetryinstallRun command line tool (local development)Some subcommands likebisectandsymbolizecould be tested from the db-contrib-tool repo root:poetryrundb-contrib-tool--helpForsetup-repro-envsome features can also be tested from the db-contrib-tool repo root,
but full features are available when running from mongo repo root.
Seetesting changes locallysection.Run linterspoetryrunisortsrctests
poetryrunblacksrctestsRun testspoetryrunpytestPre-commitThis project haspre-commitconfigured. Pre-commit will run
configured checks at git commit time.To enable pre-commit on your local repository run:poetryrunpre-commitinstallTo run pre-commit manually:poetryrunpre-commitrunTesting changes in mongoThis tool is used to help run tests in the mongodb/mongo repository. On occasion, it may be
desirable to run a mongodb-mongo-* patch build with in-flight changes to this repository. The
following steps can be taken to accomplish that.Create a branch with the changes you wish to test.Push the branch to the origin repository:git push -u origin <branch_name>.In the "mongo" repository, edit theevergreen/prelude_db_contrib_tool.shto install from the git repository instead of from pypi:pipxinstall"git+ssh://git@github.com/<user_name>/db-contrib-tool.git@<branch_name>"||exit1Create a patch build.The patch build should now pull down the changes from your branch instead of using the published
db-contrib-tool.Note: Since the db-contrib-tool is pulled from your branch, if you need to make additional
changes to the tool, you can just push to the branch and then restart the desired tasks. There is
no need to create an additional patch build unless you also need to make updates to the mongo
repository.Testing changes locallyPipx installation recommendations can be found ininstallationsection.The tool can be installed via pipx from your local repo:python3-mpipxinstall/path/to/db-contrib-tool/repo/root/dirIf the tool is already installed you can force install an updated version using --force flag:python3-mpipxinstall--force/path/to/db-contrib-tool/repo/root/dirAfter these steps you can run in-development version of db-contrib-tool from any directory:db-contrib-tool--helpVersioningThis project usessemverfor versioning.
Please include a description what is added for each new version inCHANGELOG.md.Code ReviewPlease open a GitHub Pull Request for code review.
This project uses theEvergreen Commit Queue.
Add a PR comment withevergreen mergeto trigger a merge.DeploymentDeployment to pypi is done bydeploytask ofdb-contrib-toolproject in Evergreen.
A new version in Evergreen is created on merges tomainbranch.