Skip to main content

Git bisection with Bayesian statistics

Project description

git bayesect

Bayesian git bisection!

Use this to detect changes in likelihoods of events, for instance, to isolate a commit where a slightly flaky test became very flaky.

You don't need to know the likelihoods (although you can provide priors), just that something has changed at some point in some direction

Installation

pip install git_bayesect

Usage

Start a Bayesian bisection:

git bayesect start --old $COMMIT

Record an observation on the current commit:

git bayesect fail

Or on a specific commit:

git bayesect pass --commit $COMMIT

Check the overall status of the bisection:

git bayesect status

Reset:

git bayesect reset

More usage

Set the prior for a given commit:

git bayesect prior --commit $COMMIT --weight 10

Set prior for all commits based on filenames:

git bayesect priors_from_filenames --filenames-callback "return 10 if any('suspicious' in f for f in filenames) else 1"

Set the beta priors:

git bayesect beta_priors --alpha-new 0.9 --beta-new 0.1 --alpha-old 0.05 --beta-old 0.95

Get a log of commands to let you reconstruct the state:

git bayesect log

Undo the last observation:

git bayesect undo

Run the bisection automatically using a command to make observations:

git bayesect run $CMD

Checkout the best commmit to test:

git bayesect checkout

How it works

TODO: talk about math

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

git_bayesect-1.0.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

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

git_bayesect-1.0-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file git_bayesect-1.0.tar.gz.

File metadata

  • Download URL: git_bayesect-1.0.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.8

File hashes

Hashes for git_bayesect-1.0.tar.gz
Algorithm Hash digest
SHA256 16edea0d2e10562a41ef8d075c74350ddb86b4a6e5400d140f7fb54917694054
MD5 fb6462557ac10660e39a33fcc03b1cd7
BLAKE2b-256 3a06c6eeb387a40522413bce4db2dfb9ddc282ddc160390a630d3510d20b5cef

See more details on using hashes here.

File details

Details for the file git_bayesect-1.0-py3-none-any.whl.

File metadata

  • Download URL: git_bayesect-1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.8

File hashes

Hashes for git_bayesect-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0066a296e77b9f4e5547e0b23617576471c2f490fccea42001351a19864ab41c
MD5 6296cec923e2f82038305b8204b0fab6
BLAKE2b-256 ecc1279b65a4095b6c355c7cf85d94bbd547954cb2c9ef40c903c8f40e5ad70e

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