Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
9d78b01
Add mr_testing_analyzer agent
martinky82 Oct 19, 2026
2878a79
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 19, 2026
40d6b5d
Merge branch 'main' into main
martinky82 Oct 20, 2026
c61e4ba
Merge branch 'main' into main
martinky82 Oct 20, 2026
d17bd43
mr_testing_analyst: address PR #880 review feedback
martinky82 Nov 3, 2026
0835baf
mr_testing: fix CI failures (ymir-tools packaging, ruff lint)
martinky82 Nov 3, 2026
89a616a
Merge branch 'main' into main
martinky82 Nov 3, 2026
0c9e43e
Merge branch 'main' into main
martinky82 Nov 4, 2026
cc1c6b4
mr_testing_analyst: address second round of PR #880 review feedback
martinky82 Nov 4, 2026
7376c30
Merge branch 'main' into merge-changes
martinky82 Nov 6, 2026
74572cc
Merge branch 'main' into merge-changes
martinky82 Nov 10, 2026
45077fc
Merge branch 'main' into merge-changes
martinky82 Nov 11, 2026
32468c6
Merge branch 'main' into merge-changes
martinky82 Nov 16, 2026
dc3ffd8
mr_testing_analyst: use history of earlier analyses when analyzing te…
martinky82 Nov 16, 2026
8d21394
use better wording for the analysis review request in thread
martinky82 Nov 16, 2026
1022b51
One more wording change
martinky82 Nov 16, 2026
9ce2741
Merge branch 'main' into merge-changes
martinky82 Nov 16, 2026
9ac16b0
Merge branch 'main' into merge-changes
martinky82 Nov 18, 2026
0e3a0f0
Merge branch 'main' into merge-changes
martinky82 Nov 19, 2026
936d8ef
mr_testing_analyst: address third round of PR #880 review feedback
martinky82 Nov 6, 2026
ab432b0
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 20, 2026
8362196
Merge branch 'main' into merge-changes
martinky82 Nov 20, 2026
fe2d113
mr_testing_analyst: fix pre-commit lint errors
martinky82 Nov 20, 2026
c6e89f8
mr_testing_analyst: fetch gating test logs locally with aiohttp
martinky82 Nov 24, 2026
13bfbdf
mr_testing_analyst: trace under linked Jira issues, not the MR URL
martinky82 Nov 24, 2026
c3337ca
trace_server: decode issue key in GET /traces/<issue>
martinky82 Nov 25, 2026
dc3dfbb
observability: raise span attribute limit so jira.issue survives
martinky82 Nov 25, 2026
87557c6
greenwave: read Testing Farm results in full and summarize per testcase
martinky82 Nov 25, 2026
fcd8c9d
mr_testing: add per-plan pass/fail counts to anewa's table
martinky82 Nov 25, 2026
afa0e75
observability: raise span attribute limit to 8192
martinky82 Nov 25, 2026
3412437
mr_testing: keep full comment bodies out of the workflow trace
martinky82 Nov 25, 2026
56afd9e
Merge branch 'main' into merge-changes
martinky82 Nov 25, 2026
da04a34
agents: log model replies that have no text or tool call
martinky82 Nov 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,16 @@ run-preliminary-testing-agent-standalone:
-e IGNORE_NEEDS_ATTENTION=$(IGNORE_NEEDS_ATTENTION) \
preliminary-testing-agent

.PHONY: run-mr-testing-analyst-agent-standalone
run-mr-testing-analyst-agent-standalone:
$(COMPOSE_AGENTS) run --rm \
-e MR_URL=$(MR_URL) \
-e DRY_RUN=$(DRY_RUN) \
-e POC=$(POC) \
-e NO_JIRA_COMMENTS=$(NO_JIRA_COMMENTS) \
-e GATING=$(GATING) \
mr-testing-analyst-agent


# Common utility targets

Expand Down
6 changes: 6 additions & 0 deletions README-agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,7 @@ make JIRA_ISSUE=RHEL-12345 run-triage-agent-standalone
make PACKAGE=httpd VERSION=2.4.62 JIRA_ISSUE=RHEL-12345 BRANCH=c10s run-rebase-agent-standalone
make PACKAGE=httpd UPSTREAM_PATCHES=https://github.com/... JIRA_ISSUE=RHEL-12345 BRANCH=c10s run-backport-agent-standalone
make PACKAGE=httpd JIRA_ISSUE=RHEL-12345 BRANCH=c10s run-rebuild-agent-standalone
DRY_RUN=true make MR_URL=https://gitlab.com/redhat/rhel/rpms/expat/-/merge_requests/108 run-mr-testing-analyst-agent-standalone

# Or with dry-run
DRY_RUN=true make JIRA_ISSUE=RHEL-12345 run-triage-agent-standalone
Expand All @@ -468,6 +469,11 @@ make JIRA_ISSUE=RHEL-12345 FORCE_CVE_TRIAGE=true run-triage-agent-standalone

Use commas to delimit multiple patch/commit URLs in `UPSTREAM_PATCHES`.

The MR testing analyst agent finds the Jira issues an MR resolves from the `Resolves: RHEL-XXXXX` footers in
its commit messages (and, as a fallback, its description). Without `MR_URL` it runs in queue mode, consuming
`Task`s from `mr_testing_queue` whose metadata is `{"mr_url": "...", "gating": false}`; nothing enqueues them
yet, so push them by hand when testing (`gating: true` analyzes the OSCI gating pipeline instead of anewa/NEWA).

### CLI

The `ymir` CLI runs the triage workflow inside a container, orchestrated via
Expand Down
2 changes: 2 additions & 0 deletions THREAT_MODEL.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ redirects and other caller-supplied URLs before making a request.
| T7 | Attacker-influenced or malformed `jira_issue` string reaches a privileged filesystem operation (`shutil.rmtree`) without validation, deleting arbitrary directories on the shared clone volume | remote_auth | `clone_and_prep_sources`, `fork_and_prepare_dist_git` | Shared PVC `mcp-server-git-repos` (RWX, mounted by 6+ agent pods) | high | rare | mitigated | input validation rejects empty, absolute, or `..`-containing `jira_issue` values | commit `8b181341` (validate `jira_issue`), commit `3dad71ea` (don't ignore `shutil.rmtree` errors) |
| T8 | Non-employee or compromised Jira account forces automated processing of an arbitrary issue via the `ymir_todo` label or a webhook bot-mention command (see T12 for what a legitimately-triggered issue's *content* can still drive an agent to do) | remote_auth | `ymir_todo` Jira label; Jira webhook bot-mention commands | Dist-git write access, Jira write access, compute/API budget | high | rare | mitigated | fetcher verifies label-adder is a Red Hat Employee Jira-group member via changelog walk (not JQL); atomic label flip before enqueue (fail-closed); webhook handler verifies comment author is a Red Hat Employee Jira-group member via `GET /rest/api/3/user?expand=groups` before dispatching any command (fail-closed on missing `accountId` or API error) | none |
| T9 | Unbounded retention of Redis/Valkey queue data and Phoenix traces stores workflow state and tool inputs/outputs indefinitely | insider | Valkey queue storage; Phoenix trace PVC | Redis/Valkey task queues, Sumo Logic logs / OTEL traces | medium | likely | unmitigated | none — `data_retention_policy.md` explicitly flags this as unresolved; the 7-day cleanup job only covers git clones, not queues or traces | `data_retention_policy.md` self-identifies the gap |
| T15 | `mr_testing_analyst_agent.py` decides which GitLab MR comment to treat as anewa's/NEWA's/OSCI bot's own results (matched on body-text markers like `**ANEWA:**`, not comment author identity) and which Jira issues to post to, and reads Testing Farm `results.xml`/CI job traces for per-test detail — any authorized GitLab commenter (Developer role+) could post a comment spoofing one of these markers to influence what the agent parses as "results" | remote_auth | GitLab MR comment bodies (`parse_mr_test_results`, `parse_newa_mr_comment`, `parse_osci_results_comment`); Testing Farm `results.xml` / CI job traces / failed-test logs (gating: `get_pipeline_job_trace` and `fetch_test_logs` downloads; anewa: `fetch_testing_farm_results`) | GitLab PAT (comment/label writes), Jira write access (summary comments) | medium | possible | partially_mitigated | gating mode's log downloads (`fetch_test_logs`) only ever fetch from `artifacts.osci.redhat.com`, even though the log links come from the untrusted `results.xml`, and the ReasoningAgent reads only the resulting local copies; the ReasoningAgent itself never calls a GitLab/Jira write tool directly -- every post happens in a deterministic step (`act_on_result`) driven by structured output, not by the LLM acting on parsed comment content; an in-place comment "update" always targets the exact note the spoofed marker was read from (via its own numeric note ID), never an attacker-chosen target; gating mode's OSCI results-discussion resolution is likewise computed entirely in Python (the LLM only returns a boolean, `resolve_osci_discussion`) by matching the `<!--RESULTS_COMMENT-->` marker, resolvable/not-yet-resolved state, and the current run's own pipeline ID against the MR's actual discussions, never from a discussion ID supplied by the LLM; `format_mr_testing_comment` always emits a fixed template, so raw comment content is never reflected verbatim into a privileged write; the agent's prompt documents MR comment content as untrusted | `ymir/agents/mr_testing_analyst_agent.py`, `ymir/tools/privileged/mr_testing.py` |
| T1 | Unauthenticated public route grants direct read/write access to live automation task queues | remote_unauth | `redis-commander` OpenShift Route | Redis/Valkey task queues | medium | rare | unmitigated | no `HTTP_USER`/`HTTP_PASSWORD` configured; only Red Hat employees can tamper with it | none |
| T11 | Long-running Deployments (agents, mcp-gateway, phoenix) do not set `allowPrivilegeEscalation: false` or `capabilities: drop: [ALL]`, unlike CronJob pods which do | local_user | `openshift/deployment-*.yml` | Pod isolation guarantees | medium | rare | partially_mitigated | OpenShift's restrictive SCC already blocks privilege escalation and most capabilities cluster-wide regardless of pod spec, which is why this hasn't been prioritized; explicit `allowPrivilegeEscalation: false`/`capabilities: drop: [ALL]` would still be defense-in-depth against a future SCC relaxation | none |
| T14 | A single MR to the shared-rules registry can plant misleading or contradictory guidance in `AGENTS.md` content followed by agents across every package the rule set lists, multiplying the blast radius of one instruction relative to a per-package `AGENTS.md` (which only affects one package); a compromised or careless contributor could steer fix strategy, patch conventions, or spec BuildRequires/Requires additions for many packages at once | insider | `get_maintainer_rules`, `get_shared_rules`; `rules/shared-rules/registry.yaml`, `rules/shared-rules/<rule_set>/AGENTS.md`, `rules/<package>/AGENTS.md` | Source, patches, and spec-file changes produced by agents | high | possible | partially_mitigated | CI validates registry structure only (valid YAML, referenced `AGENTS.md` exists, no orphaned entries), not content; MR review does not guarantee a reviewer catches subtly wrong or malicious guidance across every listed package; the non-overridable behaviors list (target branch, CVE eligibility, Jira transitions, build triggering, MR creation) bounds what any rules content can influence regardless of source; human review still expected before the resulting dist-git MR merges (not code-enforced — see T2) | `ymir/tools/privileged/shared_rules.py`, `ymir/tools/privileged/maintainer_rules.py` |
Expand Down Expand Up @@ -193,3 +194,4 @@ The Konflux validation boundary update (2026-10-14) was checked against
| Treat all Jira-issue- and MR-comment-derived text as untrusted at the prompt level; add a confirmation/second-check step before high-impact privileged actions (push, Jira status change) whose triggering content originated from unverified external sources | T2 | partial | L |
| Sandbox spec-file macro/shell expansion (restrict or strip `%(...)` shell macros, run `specfile`/`rpmbuild` parsing in a locked-down subprocess with no credential/network access) before processing untrusted patches, upstream tarballs, or dist-git history; see [PACKIT-4796](https://redhat.atlassian.net/browse/PACKIT-4796) | T10, T3 | partial | M |
| Make sure we are logging the content of SKIP_GATEWAY_CHECK environment variable | T2 | partial | S |
| Verify the actual GitLab author of a comment matched by `**ANEWA:**`/NEWA/OSCI-bot markers against a known automation-account allow-list before treating it as that bot's own results, instead of relying on body-text markers alone | T15 | partial | S |
7 changes: 7 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,13 @@ services:
command: ["python", "-m", "ymir.agents.preliminary_testing_agent"]
profiles: ["agents"]

mr-testing-analyst-agent:
<<: *beeai-agent-c10s
environment:
<<: *beeai-env
command: ["python", "-m", "ymir.agents.mr_testing_analyst_agent"]
profiles: ["agents"]

issue-verification-agent:
<<: *beeai-agent-c10s
environment:
Expand Down
5 changes: 3 additions & 2 deletions trace_server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
import time
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
from pathlib import Path
from urllib.parse import parse_qs, urlparse
from urllib.parse import parse_qs, unquote, urlparse

from google.protobuf.json_format import MessageToDict
from opentelemetry.proto.collector.trace.v1.trace_service_pb2 import (
Expand Down Expand Up @@ -928,7 +928,8 @@ def do_GET(self):
logger.debug("Listed %d issues", len(issues))
self._send_json(200, {"issues": issues})
elif path.startswith("/traces/"):
issue = path[len("/traces/") :]
# The UI percent-encodes the issue key, so decode it before matching stored keys.
issue = unquote(path[len("/traces/") :])
try:
spans = query_spans(issue, params)
except Exception as e:
Expand Down
Loading
Loading