Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion Containerfile.tests
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ RUN pip install --no-cache-dir \
rpm \
rpkg \
specfile \
"logdetective-mcp>=0.5.0"
"logdetective-mcp>=0.5.0" \
"sentry-sdk>=2.13.0"

# Verify no malicious litellm_init.pth was introduced by compromised litellm packages (e.g. 1.82.7, 1.82.8)
RUN MALICIOUS=$(find /usr /opt -name "litellm_init.pth" 2>/dev/null); \
Expand Down
11 changes: 8 additions & 3 deletions ymir/sweep/tests/unit/test_y_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
tests stub that tool and assert the verdict → SweepResult.action mapping.
"""

from unittest.mock import patch

import pytest

from ymir.common import CVEEligibilityResult, TriageEligibility
Expand Down Expand Up @@ -137,10 +139,13 @@ async def test_never_with_error_is_error(monkeypatch):
async def test_tool_raises_is_error(monkeypatch):
_patch_tool(monkeypatch, raises=RuntimeError("Jira unreachable"))

result = await YStreamSweep().is_unblocked(make_issue(), _COMMENT_DATA)
with patch("ymir.sweep.y_stream.sentry_sdk.capture_exception") as mock_capture:
result = await YStreamSweep().is_unblocked(make_issue(), _COMMENT_DATA)

assert result.action == "error"
assert "Jira unreachable" in result.detail
assert result.action == "error"
assert "Jira unreachable" in result.detail
mock_capture.assert_called_once()
assert isinstance(mock_capture.call_args[0][0], RuntimeError)


@pytest.mark.asyncio
Expand Down
3 changes: 3 additions & 0 deletions ymir/sweep/y_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
shipped" rule).
"""

import sentry_sdk

from ymir.common import CVEEligibilityResult, TriageEligibility
from ymir.common.constants import JiraLabels
from ymir.supervisor.supervisor_types import FullIssue
Expand Down Expand Up @@ -58,6 +60,7 @@ async def is_unblocked(self, issue: FullIssue, comment_data: CommentData) -> Swe
try:
output = await CheckCveTriageEligibilityTool().run(input={"issue_key": issue_key})
except Exception as exc:
sentry_sdk.capture_exception(exc)
return SweepResult(
issue_key=issue_key,
action="error",
Expand Down
Loading