“Who made this bug?” shouldn’t be a blame game. It should be an automated answer.
When a regression pops up during testing, the usual process is tedious: dig through Git history, read commit messages, manually link tickets. We often skip it because it’s painful — but that’s valuable data left on the table.
So I automated it.
At Paycor, when QA finds a bug, the natural question is: which feature introduced this regression? The answer usually lives somewhere in the Git history, but finding it means:
This takes anywhere from 15 minutes to an hour depending on complexity. Multiply that by dozens of bugs per sprint, and you’re looking at serious lost time.
I built a pipeline that connects Azure DevOps with OpenAI to do the heavy lifting:
The system watches for closed bugs and identifies the commit that fixed them. This is straightforward — most teams already link commits to work items.
Here’s where it gets interesting. The system:
```bash
git blame -L 45,60 src/components/PaymentForm.tsx ```
The extracted context goes to GPT-4o with a focused prompt:
“Given this bug fix that changed lines X-Y in these files, and the commit history showing who previously modified these lines, which commit is the most likely root cause?”
The model doesn’t guess randomly. It has:
Once GPT-4o identifies the likely root cause commit, the system:
Before: Manual triage taking 15-60 minutes per bug, often skipped entirely.
After: Complete traceability in seconds, zero manual effort.
We now know exactly which features are causing regressions. Sprint retrospectives have actual data instead of hunches. The team can identify patterns — maybe a particular area of the codebase needs refactoring, or a specific type of change tends to break things.
The key insight is that this process mirrors what an engineer would do manually. We’re not asking the AI to magically know the answer — we’re giving it the same information a human would use:
The AI just does the correlation faster and more consistently.
This approach works best when:
It’s less effective for:
I’m exploring ways to extend this:
At this rate, I’ll automate myself out of a job in 18 months. But that’s the goal, right? Spend less time on toil, more time on interesting problems.
The code isn’t public (it’s tightly coupled to our internal systems), but the pattern is reusable. If you’re dealing with similar pain points, the combination of `git blame` + LLM reasoning is surprisingly effective.