DEV Community

Chaitasi Patel
Chaitasi Patel

Posted on

Building CI Failure Intelligence: From Noisy Build Logs to Actionable Insights

CI is supposed to give developers fast feedback.

But when a build fails, the feedback isn't always useful.

A pipeline might produce thousands of lines of logs. Somewhere in that output is the information a developer needs: a failed test, a missing dependency, a timeout, or an infrastructure issue.

The challenge is finding that signal quickly.

As engineering teams and codebases grow, investigating CI failures can become a repetitive part of the development cycle. Developers often spend time scanning logs, comparing failures across builds, and trying to determine whether an issue is new or something they've already seen.

I wanted to explore a simple question:

Can we turn noisy CI logs into structured failure information that developers and automation tools can actually use?

That led me to build CI Failure Intelligence.

The problem: CI logs contain signals, but not enough structure

Consider a few common CI failure scenarios:

  • A test fails because an assertion returns an unexpected value.
  • A dependency installation fails because a package is missing.
  • An integration test times out while connecting to a database.
  • The same underlying failure appears across multiple builds, but timestamps, paths, or line numbers differ.

These failures require different responses.

A test failure may need investigation by the owning team. A dependency issue may need a configuration fix. An infrastructure timeout may need a closer look at the environment.

When all of these are buried in raw logs, identifying and grouping them becomes harder than it needs to be.

I wanted to build a small tool that could do the first layer of this analysis consistently.

The solution

CI Failure Intelligence is a Python-based tool that analyzes CI log files and produces structured failure reports.

The initial version focuses on four things:

  1. Parse CI logs and identify failure events.
  2. Classify failures into categories.
  3. Normalize failure messages and generate stable fingerprints.
  4. Group recurring failures and generate readable reports.

The goal isn't to automatically determine every root cause. It's to create a reliable, structured starting point for investigation.

How it works

The processing pipeline is intentionally straightforward:

          CI Log Input
               |
               v
           Log Parser
               |
               v
       Failure Classifier
               |
               v
       Message Normalizer
               |
               v
      Failure Fingerprinter
               |
               v
       Failure Aggregator
               |
               v
        Report Generator
          /     |      \
       Text    JSON   Markdown
Enter fullscreen mode Exit fullscreen mode

Each stage has a focused responsibility.

1. Parsing CI logs

The parser processes a supplied log file and identifies failure events.

The idea is to move away from treating the entire log as one large text blob and instead extract individual failure signals that can be analyzed independently.

2. Classifying failures

The tool classifies failures into predefined categories:

  • Test failures
  • Dependency failures
  • Infrastructure failures
  • Timeout failures

This classification provides an initial indication of what kind of issue occurred.

It is intentionally rule-based in the current implementation, making the results predictable and reproducible.

3. Normalizing failure messages

One challenge with CI logs is that the same failure can look different across builds.

For example, timestamps, build-specific paths, and stack trace line numbers can change even when the underlying failure remains the same.

Normalization removes selected volatile information before fingerprinting.

This helps avoid treating every slightly different log message as a completely new issue.

4. Generating stable fingerprints

After normalization, the tool generates fingerprints that help group equivalent failures.

Instead of counting every occurrence as a separate issue, the aggregator can group matching fingerprints and report:

  • Number of occurrences
  • First-seen line number
  • Representative failure examples

This makes recurring patterns easier to spot.

5. Generating actionable reports

The tool supports three output formats:

  • Text: Useful for local debugging.
  • JSON: Useful for downstream automation and integrations.
  • Markdown: Useful for CI artifacts and developer-facing reports.

Keeping the output structured is important. It makes the analysis useful beyond the command line and creates a foundation for future integrations.

Seeing it in action

Imagine a CI log containing these failures:

FAILED tests/test_payment.py::test_total
AssertionError: expected 100, got 90

ModuleNotFoundError: No module named 'requests'

psycopg.OperationalError: connection timed out
Enter fullscreen mode Exit fullscreen mode

Run the tool:

ci-inspect tests/fixtures/sample_ci.log
Enter fullscreen mode Exit fullscreen mode

The report identifies three failure events and groups them into categories:

CI Failure Intelligence

Total failure events: 3
Unique failure groups: 3

Failure Summary

Category: TEST_FAILURE
Occurrences: 1

Category: DEPENDENCY_FAILURE
Occurrences: 1

Category: INFRASTRUCTURE_FAILURE
Occurrences: 1
Enter fullscreen mode Exit fullscreen mode

This is a small example, but it demonstrates the core idea: turn raw log output into information that is easier to scan, compare, and consume.

A few engineering decisions

While building this, I made a few deliberate choices.

Deterministic analysis before AI

It can be tempting to use an LLM to interpret every failure. But classification and grouping are foundational operations. I wanted those operations to be reproducible and testable.

A deterministic analysis layer also gives future AI-based analysis a more structured input.

Separate the processing stages

Parsing, classification, normalization, fingerprinting, aggregation, and reporting are separate responsibilities.

This keeps the implementation easier to test and makes it possible to extend individual stages without tightly coupling the entire pipeline.

Keep output formats flexible

Text, JSON, and Markdown serve different consumers. Structured output also makes future CI and automation integrations easier.

What it doesn't solve yet

This is an intentionally scoped first version, and there are important limitations:

  • Classification depends on predefined patterns and may not recognize every CI framework or failure format.
  • Fingerprinting is based on normalized text and stack trace information, not semantic understanding.
  • The tool analyzes supplied log files; it does not yet retrieve logs directly from CI providers.
  • Grouping failures does not establish their actual root cause.

I think being explicit about these limitations is important. A useful engineering tool should make clear what it can and cannot tell you.

What I'd explore next

There are several directions worth exploring:

  • Historical failure trends and regression detection.
  • Failure ownership and routing.
  • Integrations with CI providers.
  • Evidence-backed LLM root-cause analysis, with deterministic fallback.
  • Automated remediation suggestions.

One direction I'm particularly interested in is combining deterministic failure analysis with AI.

The deterministic layer can identify and group failures. An AI layer could then use the structured evidence—logs, stack traces, code changes, and other context—to help explain likely causes.

The key is to make AI analysis evidence-based rather than allowing it to guess.

Final thoughts

This project started with a practical developer productivity problem: engineers shouldn't have to repeatedly dig through noisy logs to identify failures they've already encountered.

Building it reinforced an engineering principle I find useful:

Before adding intelligence, make the underlying data structured, consistent, and reliable.

That foundation can make future automation and AI capabilities much more useful.

I'm continuing to explore ideas around developer productivity, engineering workflows, and reliable AI-powered developer tools.

If you're working on CI observability, test intelligence, or developer productivity, I'd love to hear how you're approaching failure analysis.

Explore the project:

CI Failure Intelligence on GitHub

Feedback and suggestions are welcome!

Top comments (0)