The `db-contrib-tool` - MongoDB's tool for contributors.
Project description
db-contrib-tool
The db-contrib-tool
- MongoDB's tools for contributors.
Table of contents
Description
The command line tool with various subcommands:
bisect
- README.md
- performs an evergreen-aware git-bisect to find the 'last passing version' and 'first failing version' of mongo
setup-repro-env
- README.md
- downloads and installs:
- particular MongoDB versions
- debug symbols
- artifacts (including resmoke, python scripts etc)
- python venv for resmoke, python scripts etc
symbolize
- README.md
- Symbolizes stacktraces from recent
mongod
andmongos
binaries compiled in Evergreen, including patch builds, mainline builds, and release/production builds. - Requires authenticating to an internal MongoDB symbol mapping service.
Dependencies
- Python 3.9 or later (python3 from the MongoDB Toolchain is highly recommended)
Installation
Make sure dependencies are installed. Use pipx to install db-contrib-tool that will be available globally on your machine:
python3 -m pip install pipx
python3 -m pipx ensurepath
Installing db-contrib-tool:
python3 -m pipx install db-contrib-tool
Upgrading db-contrib-tool:
python3 -m pipx upgrade db-contrib-tool
In 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 -m pip uninstall pipx
rm -rf ~/.local/pipx # in case you're using the default pipx home directory
Now you can try to install again from scratch.
Usage
Print out help message:
db-contrib-tool --help
For more information see description section.
Contributor's Guide (local development)
Install project dependencies
This project uses poetry for dependency management.
poetry install
Run command line tool (local development)
Some subcommands like bisect
and symbolize
could be tested from the db-contrib-tool repo root:
poetry run db-contrib-tool --help
For setup-repro-env
some features can also be tested from the db-contrib-tool repo root,
but full features are available when running from mongo repo root.
See testing changes locally section.
Run linters
poetry run isort src tests
poetry run black src tests
Run tests
poetry run pytest
Pre-commit
This project has pre-commit configured. Pre-commit will run
configured checks at git commit time.
To enable pre-commit on your local repository run:
poetry run pre-commit install
To run pre-commit manually:
poetry run pre-commit run
Testing changes in mongo
This 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 the evergreen/prelude_db_contrib_tool.sh to install from the git repository instead of from pypi:
pipx install "git+ssh://git@github.com/<user_name>/db-contrib-tool.git@<branch_name>" || exit 1
-
Create 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 locally
Pipx installation recommendations can be found in installation section.
The tool can be installed via pipx from your local repo:
python3 -m pipx install /path/to/db-contrib-tool/repo/root/dir
If the tool is already installed you can force install an updated version using --force flag:
python3 -m pipx install --force /path/to/db-contrib-tool/repo/root/dir
After these steps you can run in-development version of db-contrib-tool from any directory:
db-contrib-tool --help
Versioning
This project uses semver for versioning.
Please include a description what is added for each new version in CHANGELOG.md
.
Code Review
Please open a GitHub Pull Request for code review.
This project uses the Evergreen Commit Queue.
Add a PR comment with evergreen merge
to trigger a merge.
Deployment
Deployment to pypi is done by deploy
task of db-contrib-tool
project in Evergreen.
A new version in Evergreen is created on merges to main
branch.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file db_contrib_tool-0.6.13.tar.gz
.
File metadata
- Download URL: db_contrib_tool-0.6.13.tar.gz
- Upload date:
- Size: 52.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.2 CPython/3.9.2 Linux/4.15.0-1044-aws
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0a0acf5ef510086f16438b15f4a959a9d29c494a531b1c284459489187cdf6f |
|
MD5 | 4ce49608ccfe52621025afe87386b643 |
|
BLAKE2b-256 | dacf4b4df26c91a93c289d5f02056ecfd7683b543ba9a82fe7af6dd6c99690c2 |
File details
Details for the file db_contrib_tool-0.6.13-py3-none-any.whl
.
File metadata
- Download URL: db_contrib_tool-0.6.13-py3-none-any.whl
- Upload date:
- Size: 64.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.2 CPython/3.9.2 Linux/4.15.0-1044-aws
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6b1b2e7d2f97392b176435e6b368baf91c94297831ceee98963b074631f5809 |
|
MD5 | 31aee705485a15c7903f0d1e871ef381 |
|
BLAKE2b-256 | 6b7cec51663d87446bc213e94ea9d1c701b00f4fb78b6bda0c898d1f08928101 |