Skip to main content

A tool to calculate the DORA Lead Time metric

Project description

Build and Test PyPI Downloads

DORA Lead Time Metric

A tool to generate lead time charts and outlier reports by connecting data from Jira and GitHub.

Overview

Lead Time for Changes is one of the four key DORA (DevOps Research and Assessment) metrics that measure software delivery performance. It measures the time it takes from when code is committed to when it is successfully running in production. A shorter lead time indicates an organization's ability to respond quickly to customer needs and fix problems rapidly.

This Python package calculates lead time by connecting data from Jira and GitHub. The calculation involves going from Projects → Releases → Stories → Pull Requests → Commits, calculating the lead time for each pull request, and averaging those over a given time period.

Requirements

  • Python 3.13 or higher
  • OpenAI API key and other parameters (set in your .env file)

Installation

This project uses Poetry for dependency management.

  1. Install Poetry by following the instructions in the official documentation.

    Quick installation methods:

    # For Linux, macOS, Windows (WSL)
    curl -sSL https://install.python-poetry.org | python3 -
    
    # For Windows PowerShell
    (Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | python -
    
  2. Install Project Dependencies

    # Clone the repository
    git clone https://github.com/sualeh/dora-lead-time-metric.git
    cd dora-lead-time-metric
    
  3. Install dependencies using Poetry

    poetry install --extras "dev"
    poetry show --tree
    

Configuration

Create an ".env" file in the project root based on ".env.example", and similarly create an ".env.params" file based on ".env.params.example". For a detailed walkthrough of required variables and examples, see calculate-dora-lead-time-metric.md.

Usage

  1. Create releases database
poetry run python -m dora_lead_time.main --build
  1. Generate lead time charts
poetry run python -m dora_lead_time.main --charts
  1. Generate outlier reports
poetry run python -m dora_lead_time.main --reports

Development and Testing

  1. Install dependencies, as above.

  2. Run all tests:

    poetry run pytest
    

Docker Compose Usage

You can also use Docker Compose for easier management of the dora-lead-time container:

  1. Clone the project, as described above.

  2. Configure the ".env" and ".env.params" files as described above.

  3. Run the application using Docker Compose:

    # To build a releases database
    docker-compose run dora-lead-time --build
    
    # To generate lead time charts
    docker-compose run dora-lead-time --charts
    
    # To generate outlier reports
    docker-compose run dora-lead-time --reports
    

This approach simplifies volume mounting and environment variable management, especially when working with the tool regularly.

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

dora_lead_time_metric-2.3.0.tar.gz (31.4 kB view details)

Uploaded Source

Built Distribution

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

dora_lead_time_metric-2.3.0-py3-none-any.whl (41.9 kB view details)

Uploaded Python 3

File details

Details for the file dora_lead_time_metric-2.3.0.tar.gz.

File metadata

  • Download URL: dora_lead_time_metric-2.3.0.tar.gz
  • Upload date:
  • Size: 31.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dora_lead_time_metric-2.3.0.tar.gz
Algorithm Hash digest
SHA256 92ab8e7950b06139f72e3d0ab8fe225b610f96bfbc778598c56501da7adcdb38
MD5 409f4e975e85ca2d388acf6e14a3b3d9
BLAKE2b-256 1cc555b030959a16b44ded88a4a1a65cd4fd336235cfa7a4eafe815e38303b9d

See more details on using hashes here.

Provenance

The following attestation bundles were made for dora_lead_time_metric-2.3.0.tar.gz:

Publisher: publish-pypi.yml on sualeh/dora-lead-time-metric

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dora_lead_time_metric-2.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for dora_lead_time_metric-2.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 36e9e465ecad37306458fa50f2ace0724fe008449ad91e488c5d2ecd44da9cff
MD5 e0d738a64056fc2970ed151e64aa476c
BLAKE2b-256 27dae6403008e18ad56c1375fd82858a3798e2b01f89d8e8d701e3b3a7aa348a

See more details on using hashes here.

Provenance

The following attestation bundles were made for dora_lead_time_metric-2.3.0-py3-none-any.whl:

Publisher: publish-pypi.yml on sualeh/dora-lead-time-metric

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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