Skip to main content

AnalysisResult

Complete analysis result for a Jenkins job.
job_id
string
required
Unique identifier for the analysis job
job_name
string
default:""
Jenkins job name
build_number
integer
default:0
Jenkins build number
jenkins_url
HttpUrl
URL of the analyzed Jenkins job (None for non-Jenkins analysis)
status
Literal['pending', 'running', 'completed', 'failed']
required
Current status of the analysis
summary
string
required
Summary of the analysis findings
ai_provider
string
default:""
AI provider used for analysis
ai_model
string
default:""
AI model used for analysis
failures
array
default:[]
List of analyzed failures
child_job_analyses
array
default:[]
Analyses of failed child jobs in pipeline

Example

{
  "job_id": "abc123-def456",
  "job_name": "frontend/build-pipeline",
  "build_number": 42,
  "jenkins_url": "https://jenkins.example.com/job/frontend/job/build-pipeline/42/",
  "status": "completed",
  "summary": "Analysis completed: 2 test failures analyzed",
  "ai_provider": "claude",
  "ai_model": "claude-3-5-sonnet-20241022",
  "failures": [
    {
      "test_name": "com.example.TestClass.testMethod",
      "error": "AssertionError: Expected 200 but got 500",
      "analysis": {
        "classification": "PRODUCT BUG",
        "affected_tests": ["com.example.TestClass.testMethod"],
        "details": "API endpoint returning 500 error...",
        "product_bug_report": {
          "title": "API returns 500 error on user lookup",
          "severity": "high",
          "component": "user-service",
          "description": "The /api/users endpoint fails with 500...",
          "evidence": "Error: Internal Server Error...",
          "jira_search_keywords": ["user-service", "500 error", "API"],
          "jira_matches": []
        }
      }
    }
  ],
  "child_job_analyses": []
}

FailureAnalysisResult

Analysis result for direct failure analysis (no Jenkins context).
job_id
string
required
Unique identifier for the analysis job
status
Literal['completed', 'failed']
required
Analysis status
summary
string
required
Summary of the analysis findings
ai_provider
string
default:""
AI provider used
ai_model
string
default:""
AI model used
failures
array
default:[]
Analyzed failures (see FailureAnalysis section)
enriched_xml
string
Enriched JUnit XML with analysis results (only when raw_xml was provided in request)

Example

{
  "job_id": "xyz789-abc123",
  "status": "completed",
  "summary": "Analyzed 3 test failures",
  "ai_provider": "gemini",
  "ai_model": "gemini-2.0-flash-exp",
  "failures": [
    {
      "test_name": "com.example.TestClass.testMethod",
      "error": "NullPointerException",
      "analysis": {
        "classification": "CODE ISSUE",
        "affected_tests": ["com.example.TestClass.testMethod"],
        "details": "Null pointer dereference in initialization...",
        "code_fix": {
          "file": "src/main/java/com/example/Service.java",
          "line": "42",
          "change": "Add null check before accessing user object"
        }
      }
    }
  ],
  "enriched_xml": null
}

FailureAnalysis

Analysis result for a single test failure.
test_name
string
required
Name of the failed test
error
string
required
Error message or exception
analysis
object
required
Structured AI analysis output
Validation: The code_fix and product_bug_report fields are mutually exclusive. Only one will be present based on the classification.
Backward Compatibility: The analysis field accepts legacy string format for data stored before the AnalysisDetail model was introduced. String values are automatically wrapped in the details field.

Example - Code Issue

{
  "test_name": "com.example.TestClass.testNullPointer",
  "error": "NullPointerException at line 42",
  "analysis": {
    "classification": "CODE ISSUE",
    "affected_tests": ["com.example.TestClass.testNullPointer"],
    "details": "The test is failing due to a null pointer dereference when initializing the User object. The code attempts to access user.getName() without checking if user is null.",
    "code_fix": {
      "file": "src/main/java/com/example/UserService.java",
      "line": "42",
      "change": "Add null check: if (user != null) { return user.getName(); } else { return \"Unknown\"; }"
    }
  }
}

Example - Product Bug

{
  "test_name": "com.example.api.TestUserEndpoint.testGetUser",
  "error": "AssertionError: Expected 200 but got 500",
  "analysis": {
    "classification": "PRODUCT BUG",
    "affected_tests": ["com.example.api.TestUserEndpoint.testGetUser"],
    "details": "The API endpoint /api/users/{id} is returning a 500 Internal Server Error instead of successfully retrieving user data. This appears to be a regression in the user service.",
    "product_bug_report": {
      "title": "User API endpoint returns 500 error on valid requests",
      "severity": "high",
      "component": "user-service",
      "description": "The GET /api/users/{id} endpoint fails with HTTP 500 when requesting valid user IDs. Expected behavior is to return HTTP 200 with user data.",
      "evidence": "HTTP 500 Internal Server Error\nResponse: {\"error\": \"Database connection failed\"}",
      "jira_search_keywords": ["user-service", "API", "500 error", "database"],
      "jira_matches": [
        {
          "key": "PROJ-456",
          "summary": "User service intermittently returns 500 errors",
          "status": "Open",
          "priority": "High",
          "url": "https://example.atlassian.net/browse/PROJ-456",
          "score": 0.85
        }
      ]
    }
  }
}

Build docs developers (and LLMs) love