DEVOPS

Lead-Time-for-Changes from PR Merge to Production

When a production deployment finishes, traces every commit back to its merged pull request, computes lead time for changes per PR.

CategoryDevOps
Enginesim
Difficultyintermediate
Triggerwebhook
Steps5
Setup~15 min

How it runs

The automated pipeline, trigger to output.

  • TriggerGitHub production deployment-status webhook (success)GitHubGitHub
  • ActionList commits between previous and current production SHAGitHubGitHub
  • ActionResolve merged PR and merge timestamp per commitGitHubGitHub
  • LogicCompute per-PR lead time, drop PR-less direct pushes
  • OutputBatch-insert lead-time rows into SnowflakeSnowflakeSnowflake

What it does

This workflow measures lead time for changes: the elapsed time from a pull request being merged to the code reaching production. On each successful production deploy it resolves the commits shipped, looks up the merge timestamp of each commit's PR, calculates per-PR lead time, and inserts the rows into a Snowflake table that powers your DORA dashboard.

When to use it

Use it when you need accurate, commit-level lead-time data instead of rough averages, and you already warehouse engineering metrics in Snowflake for BI tooling. Good for teams that report DORA quartiles to leadership.

How it works

  1. 1A GitHub deployment-status webhook fires when a production deploy reaches `success`.
  2. 2The flow compares the deploy SHA to the previous production SHA and lists every commit in between.
  3. 3For each commit it queries GitHub for the associated merged PR and its merge timestamp.
  4. 4A logic step computes lead time as deploy time minus PR merge time, skipping direct pushes that have no PR.
  5. 5The final step batch-inserts one row per PR (repo, PR number, merged-at, deployed-at, lead-time seconds) into Snowflake.

Set it up

What you configure once, before turning it on.

  1. 1
    Connect GitHubRepos, issues, pull requests, actions.
  2. 2
    Connect SnowflakeWarehouses, queries, shares.
  3. 3
    Set each agent's modelWe leave models unset so you pick the tier — fast + cheap, or top-quality.
  4. 4
    Tune it to your dataEdit the prompts, filters, and field mappings so it matches how your team works.
  5. 5
    Test, then turn it onRun once against a sample, confirm the output, then enable the trigger.

Run this workflow in your colony.

14-day trial. No DevOps. No Sales call. Provisioned in under a minute.