Skip to content

Commit 3c22373

Browse files
martinky82claude
andcommitted
Refactor IssueHandler from supervisor to issue_verification_agent
Move the IssueHandler workflow from ymir/supervisor/ into a standalone BeeAI Framework agent at ymir/agents/issue_verification_agent.py, following the pattern established by preliminary_testing_agent. This includes: - New agent: issue_verification_agent with Workflow-based state machine - New sub-agent: testing_analyst for AI-driven test result analysis - New MCP tools: errata (GetErratum, GetErratumBuildNvr), testing_farm (GetTestingFarmRequest, ReproduceTestingFarmRequest), gitlab (SearchGitlabProjectMrs), jira (UpdateJiraComment, AddJiraAttachments, GetJiraAttachment) - New unprivileged tools: read_logfile, read_readme, search_resultsdb, analyze_ewa_testrun, read_attachment - Supporting modules: baseline_tests, compare_xunit, qe_data - Shared types added to ymir/common/models.py - New skill definition for issue_verification The supervisor's ErratumHandler remains unchanged for a follow-up. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 192a0d6 commit 3c22373

21 files changed

Lines changed: 3048 additions & 8 deletions

README-agents.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Three agents process tasks through Redis queues:
1111
- **Triage Agent**: Analyzes JIRA issues and determines resolution path. It uses title, description, fields, and comments to find out root cause of the issue. It can ask for clarification, create tasks for other agents or may take no action if not needed.
1212
- **Rebase Agent**: Updates packages to newer upstream versions. A Rebase is only to be chosen when the issue explicitly instructs you to "rebase" or "update". It looks for upstream references that are linked, attached and present in the description or comments in the issue.
1313
- **Backport Agent**: Applies specific fixes/patches to packages. It looks for patches that are linked, attached and present in the description or comments in the issue. It tries to apply the patch and resolve any conflicts that may arise during the backport process.
14+
- **Issue Verification Agent**: Manages the post-fix lifecycle of a JIRA issue — from merged MR through errata creation, testing analysis, and status transitions to RELEASE_PENDING. Migrated from the supervisor's `IssueHandler`.
1415

1516

1617
## Dry run mode

README-supervisor.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ This will have to be repeated when the ticket expires. (Exporting the kcm-cache
3838
socket to the container seems better, but I wasn't able to get it to work due
3939
to various difficult to work around permission issues.)
4040

41+
## Note on IssueHandler migration
42+
43+
The `IssueHandler` has been migrated to `ymir/agents/issue_verification_agent.py` as part of the BeeAI Framework refactoring. The supervisor still handles errata processing via `ErratumHandler`. For processing individual issues, prefer using the new agent directly (see README-agents.md).
44+
4145
## Processing a single issue or erratum
4246

4347
To process a single issue or erratum, you can run:

agents_as_skills/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# These files are skills built from agents
22

3+
## Available skills
4+
5+
- `backport/` — Backport fix agent
6+
- `preliminary_testing/` — Preliminary testing agent
7+
- `rebase/` — Rebase fix agent
8+
- `rebuild/` — Rebuild agent
9+
- `triage/` — Triage agent
10+
- `issue_verification/` — Issue verification agent (post-fix lifecycle management)
11+
312
## How to build
413

514
```bash
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
---
2+
description: >
3+
Runs the Issue Verification workflow for a JIRA issue, managing the lifecycle
4+
from merged MR through errata creation, testing analysis, and status transitions.
5+
arguments:
6+
jira_issue:
7+
description: "JIRA issue key (e.g. RHEL-12345)"
8+
required: true
9+
dry_run:
10+
description: "If true, don't make any changes to JIRA or other systems"
11+
required: false
12+
default: "false"
13+
ignore_needs_attention:
14+
description: "If true, process the issue even if it has ymir_needs_attention label"
15+
required: false
16+
default: "false"
17+
---
18+
19+
# Issue Verification Agent
20+
21+
Manages the lifecycle of a JIRA issue after a fix has been backported or rebased.
22+
23+
## MCP Tools Used
24+
25+
From the privileged gateway (`MCP_GATEWAY_URL`):
26+
27+
- `get_jira_details` — Fetch full JIRA issue details
28+
- `edit_jira_labels` — Add/remove labels
29+
- `add_jira_comment` — Add comments
30+
- `change_jira_status` — Transition issue status
31+
- `update_jira_comment` — Update existing comments
32+
- `add_jira_attachments` — Add attachments to issues
33+
- `search_gitlab_project_mrs` — Search for merge requests
34+
- `get_erratum` — Get erratum details
35+
- `get_erratum_build_nvr` — Get build NVR from erratum
36+
- `get_testing_farm_request` — Get Testing Farm request status
37+
- `reproduce_testing_farm_request` — Reproduce a test run with different build
38+
39+
## Workflow Steps
40+
41+
1. **fetch_and_validate_issue** — Fetch JIRA issue, check labels/components
42+
2. **check_errata_status** — Branch based on whether errata link exists
43+
3. **run_before_errata** — Check for merged MRs, wait for errata creation
44+
4. **run_after_errata** — Validate preliminary testing, test coverage, move status
45+
5. **analyze_testing** — Call testing_analyst sub-agent for test result analysis (INTEGRATION status)
46+
6. **check_reproduction** — Check status of baseline test reproduction
47+
48+
## Output Schema
49+
50+
```json
51+
{
52+
"status": "string — description of what happened",
53+
"reschedule_in": "float — seconds until next check (-1 means don't reschedule)"
54+
}
55+
```
56+
57+
## How to Run
58+
59+
```python
60+
from ymir.agents.issue_verification_agent import run_issue_verification
61+
62+
result = await run_issue_verification(
63+
jira_issue="RHEL-12345",
64+
dry_run=True,
65+
ignore_needs_attention=False,
66+
)
67+
print(result.status, result.reschedule_in)
68+
```
69+
70+
Or standalone:
71+
72+
```bash
73+
JIRA_ISSUE=RHEL-12345 DRY_RUN=true python -m ymir.agents.issue_verification_agent
74+
```

0 commit comments

Comments
 (0)