tektoncd / tektoncd/pipelines-as-code

feat: Add PR description and file changes to LLM context

Open
#2,303 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement llm priority/low
Dominant language
Go
Stars
214
Forks
144
Avg merge
2d 11h
Merged PRs (30d)
27

Description

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: https://github.com/openshift-pipelines/pipelines-as-code/pull/2292#discussion_r2468174103

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading pkg/params/info/events.go and pkg/llm/context/assembler.go, especially buildPRContent(), then inspect the GitHub, GitLab, Gitea, and Bitbucket provider implementations. Done means the event carries the PR body and changed-file list, each provider supplies them, and the assembler includes both in the LLM context.

Written by the indexing model from the issue text.

Assessment

Tech stack
github, gitlab, go
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.