Skip to content

Preliminary testing agent#399

Open
martinky82 wants to merge 7 commits intopackit:mainfrom
martinky82:preliminary-testing-agent
Open

Preliminary testing agent#399
martinky82 wants to merge 7 commits intopackit:mainfrom
martinky82:preliminary-testing-agent

Conversation

@martinky82
Copy link
Copy Markdown
Contributor

TODO:

  • Write new tests or update the old ones to cover new functionality.
  • Update doc-strings where appropriate.
  • Update or write new documentation in packit/packit.dev.
  • ‹fill in›

Fixes

Related to

Merge before/after

RELEASE NOTES BEGIN

Packit now supports automatic ordering of ☕ after all checks pass.

RELEASE NOTES END

martinky82 and others added 7 commits October 30, 2025 14:15
Implement a new `preliminary-testing` supervisor workflow that automates
the evaluation of preliminary testing (gating and CI checks) for RHEL
Jira issues. Previously, QE engineers had to manually verify test results
and set the Preliminary Testing field — this agent handles it automatically.

The workflow uses an AI agent (BeeAI ToolCallingAgent) to analyze test
results from two sources:

1. GreenWave gating status — fetches and interprets the HTML page from
   gating-status.osci.redhat.com for the build NVR when available.

2. OSCI results in MR comments — discovers linked merge requests via the
   Jira dev-status API, then fetches MR notes from GitLab to find OSCI
   "Results for pipeline ..." comments.

The workflow gracefully degrades when only one source is available (e.g.
no build NVR set yet, or no linked MRs).

Entry conditions: issue must be In Progress, Preliminary Testing not
already Pass, and at least one of Fixed in Build NVR or linked PRs.

Outcomes:
- Tests passed + Test Coverage set → sets Preliminary Testing = Pass
- Tests passed + Test Coverage missing → flags for human attention
- Tests failed/not running/error → flags for human attention
- Tests running/pending → reschedules for later

New files:
- supervisor/preliminary_testing_handler.py — main workflow handler
- supervisor/preliminary_testing_analyst.py — AI agent for analysis
- supervisor/tools/fetch_greenwave.py — BeeAI tool for GreenWave HTML
- supervisor/tools/fetch_gitlab_mr_notes.py — BeeAI tool for MR notes

Modified files:
- supervisor/jira_utils.py — add set_preliminary_testing() and
  get_issue_pull_requests() (Jira dev-status API)
- supervisor/main.py — add preliminary-testing CLI command
- Makefile — add preliminary-testing make target
- README-supervisor.md — document the new workflow

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new 'preliminary-testing' workflow. This workflow leverages an AI agent to analyze Jira issues, GreenWave gating status, and GitLab merge request comments to determine if a build has passed preliminary testing. The changes include adding a new make preliminary-testing target, updating the README with detailed documentation for this workflow, and implementing new Python modules for the handler, the AI analyst, and tools to fetch data from Jira, GreenWave, and GitLab. A review comment suggests improving the ValueError message in preliminary_testing_handler.py for better debuggability by including the specific state value.

Comment on lines +191 to +193
raise ValueError(
f"Unknown testing state: {analysis.state}"
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The ValueError raised in the match statement should include the specific state value in the error message to improve debuggability.

Suggested change
raise ValueError(
f"Unknown testing state: {analysis.state}"
)
raise ValueError(
f"Unknown testing state: {analysis.state!r}"
)

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.

1 participant