Skip to content

Add PR analysis with code context investigation#95

Open
mohit-sheth wants to merge 1 commit intoredhat-performance:mainfrom
mohit-sheth:pr-analysis-w-context
Open

Add PR analysis with code context investigation#95
mohit-sheth wants to merge 1 commit intoredhat-performance:mainfrom
mohit-sheth:pr-analysis-w-context

Conversation

@mohit-sheth
Copy link
Copy Markdown
Collaborator

Add 9 GitHub investigation tools (pr_tools.py) that let the LLM autonomously explore PR diffs, commits, file contents, and metadata during regression analysis. Integrate tools with MCP/Orion tools in pr_analyzer.py. Update prompts with funnel investigation strategy (scope assessment, adaptive small/large PR handling, subsystem mapping), lower severity thresholds to 8%, and add test file exclusion guardrails.

Includes developer documentation at docs/enhancement-pr-analysis.md.

Add 9 GitHub investigation tools (pr_tools.py) that let the LLM
autonomously explore PR diffs, commits, file contents, and metadata
during regression analysis. Integrate tools with MCP/Orion tools in
pr_analyzer.py. Update prompts with funnel investigation strategy
(scope assessment, adaptive small/large PR handling, subsystem mapping),
lower severity thresholds to 8%, and add test file exclusion guardrails.

Includes developer documentation at docs/enhancement-pr-analysis.md.

Signed-off-by: Mohit Sheth <msheth@redhat.com>
@mohit-sheth mohit-sheth marked this pull request as ready for review March 26, 2026 13:28
# =============================================================================


def create_pr_tools(org: str, repo: str, pr_number: str) -> list:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still want to keep these here in BugZooka or have it part of our new agentic workflow that we are looking at?

4. **Categorize by Severity** using absolute percentage change (ignore sign):
- **Significant**: |change| >= 10%
- **Moderate**: 5% <= |change| < 10%
- **Significant**: |change| >= 8%
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we changing from 10 to 8 here?


BugZooka's PR analysis compares performance test results from a pull request against baseline metrics, classifies regressions and improvements, and — with the changes on this branch — autonomously investigates the PR's code changes to identify root causes.

**Before this branch:** The LLM receives performance metrics from Orion (via MCP tools) and can say "OVN CPU increased 15%" but has no visibility into the actual code changes, so it cannot explain *why* or recommend specific fixes.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we want to make it sound like a Before/After changelog?

Copy link
Copy Markdown
Collaborator

@vishnuchalla vishnuchalla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this idea but I think the tools here should be coded as our own custom version of GH MCP and be reused in here and in appropriate agentic workflows as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants