Skip to main content

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 and mongos binaries compiled in Evergreen, including patch builds, mainline builds, and release/production builds.
    • Requires authenticating to an internal MongoDB symbol mapping service.

Dependencies

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 ruff format
poetry run ruff check

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

or across all files (not just those staged):

poetry run pre-commit run --all-files

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 patch build with the changes you wish to test, running the create_pyinstaller_binary tasks.
  • In the mongo repository, edit evergreen/download_db_contrib_tool.py to use your patch's Evergreen version, like https://mdb-build-public.s3.amazonaws.com/db-contrib-tool-binaries/<your patch's version ID>/"

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

This projects uses GitHub PRs for code reviews. You should assign any reviewers you would like to look at the PR to it.

This project uses the GitHub merge queue. Click "Merge when ready" as soon as you'd like.

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

db_contrib_tool-1.1.3.tar.gz (56.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

db_contrib_tool-1.1.3-py3-none-any.whl (70.1 kB view details)

Uploaded Python 3

File details

Details for the file db_contrib_tool-1.1.3.tar.gz.

File metadata

  • Download URL: db_contrib_tool-1.1.3.tar.gz
  • Upload date:
  • Size: 56.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.9.23 Linux/5.4.0-1009-aws

File hashes

Hashes for db_contrib_tool-1.1.3.tar.gz
Algorithm Hash digest
SHA256 5f9f30d4e3a24683f4cf1a3a7e910c910e290c7b037fa835388ba9298ba793f5
MD5 e4dc7b2023e1572f8f793322a9091038
BLAKE2b-256 2b7e7b36a4119a17e00ef9451c1413e24c4713fdbc53a011acae92546dc6a8b1

See more details on using hashes here.

File details

Details for the file db_contrib_tool-1.1.3-py3-none-any.whl.

File metadata

  • Download URL: db_contrib_tool-1.1.3-py3-none-any.whl
  • Upload date:
  • Size: 70.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.9.23 Linux/5.4.0-1009-aws

File hashes

Hashes for db_contrib_tool-1.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a29920e65e2227ef7c60a95e3a2de4d293ff5345d78d25560b7fbfa7573ad450
MD5 70d69fea5481d2801e5c2e0223ae03f0
BLAKE2b-256 5dc86674b0af4d9b3aa84ef657490d3a972ee2eab5e79e1a19a3ec8823ecf79c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page