Skip to content

feat: Add PR description and file changes to LLM context #2303

@chmouel

Description

@chmouel

Description

Add PR description (body) and list of files changed to the LLM context to provide richer information for AI-powered analysis.

Context

This was suggested in PR #2292 review comment: #2292 (comment)

Currently, the LLM context includes basic PR information (number, title, labels) but not:

  • PR description/body
  • List of files changed in the PR

Proposed Changes

  1. Extend Event struct (pkg/params/info/events.go):

    • Add PullRequestBody string field
    • Add PullRequestFiles []string field (or more detailed file change info)
  2. Update provider implementations to fetch this data:

    • GitHub provider
    • GitLab provider
    • Gitea provider
    • Bitbucket providers
  3. Update context assembler (pkg/llm/context/assembler.go):

    • Include PR body in buildPRContent() method
    • Include file changes list in the context

Benefits

  • Better context for LLM to understand what the PR is trying to accomplish
  • File changes can help identify which areas of code might be related to failures
  • More comprehensive analysis of test failures in relation to code changes

Priority

This is a future enhancement and not blocking for the initial LLM analysis feature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions