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
74 changes: 0 additions & 74 deletions .github/workflows/build-push-images.yml

This file was deleted.

55 changes: 23 additions & 32 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,62 +17,53 @@ on:

jobs:
pre-commit:
name: Pre-commit CI
name: Pre-commit Hooks CI
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12"]
timeout-minutes: 15
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/checkout@v6

- name: Setup Python
uses: actions/setup-python@v4
- name: "Set up Python"
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
python-version-file: "pyproject.toml"

- name: Install the latest version of uv
uses: astral-sh/setup-uv@v5
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
cache-dependency-glob: ".pre-commit-config.yaml"
version: "0.10.9"

- name: Install dependencies
run: |
uv sync --group ci
alias pip="uv pip" # Trick pre-commit to use uv
- name: Install the project
run: uv sync --locked --all-extras --dev

- name: Run Pre-commit
run: |
uv run pre-commit run --show-diff-on-failure --color=always --all-files

unit_tests:
name: Unit Tests
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/checkout@v6

- name: Setup Python
uses: actions/setup-python@v4
- name: "Set up Python"
uses: actions/setup-python@v6
with:
python-version: 3.12
python-version-file: "pyproject.toml"

- name: Install the latest version of uv
uses: astral-sh/setup-uv@v5
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
cache-dependency-glob: ".pre-commit-config.yaml"
version: "0.10.9"

- name: Install dependencies
run: |
uv sync --group ci
alias pip="uv pip" # T
- name: Install the project
run: uv sync --locked --all-extras --dev

- name: Run Tests
run: |
uv run pytest tests/unit_tests
uv run pytest tests

# Llama firewall is not yet supported
# security_tests:
Expand Down
23 changes: 0 additions & 23 deletions .github/workflows/poetry-update.yml

This file was deleted.

17 changes: 0 additions & 17 deletions .github/workflows/pre-commit-autoupdate.yml

This file was deleted.

32 changes: 16 additions & 16 deletions .github/workflows/scan-dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,32 @@ on:
- main
- develop
paths:
- '**/poetry.lock'
- '**/uv.lock'
push:
branches:
- main
- develop
paths:
- '**/poetry.lock'
- '**/uv.lock'

jobs:
safety_scan:
name: Safety Scan
pip_audit:
name: pip-audit
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v4
- name: "Set up Python"
uses: actions/setup-python@v6
with:
python-version: '3.10'
python-version-file: "pyproject.toml"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install safety
- name: Run safety check
run: |
safety check --full-report
- name: Install uv
uses: astral-sh/setup-uv@v7

- name: Install the project
run: uv sync --locked --all-extras --dev

- uses: pypa/gh-action-pip-audit@v1.1.0
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ repos:
language: system
types: [python]
args: ["--config-file=mypy.ini"]
exclude: ^legacy/

- repo: https://github.com/crate-ci/typos
rev: v1.42.1
Expand Down
2 changes: 1 addition & 1 deletion bandit.yaml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
exclude_dirs: ['legacy']
exclude_dirs: ['tests']
8 changes: 6 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,19 @@ sre-agent-run-diagnosis-quality-eval = "sre_agent.eval.diagnosis_quality.run:mai
[dependency-groups]
dev = [
"mypy>=1.19.1",
"pre-commit>=4.5.1",
"pytest>=9.0.2",
]
eval = [
"opik>=1.10.38",
]

[build-system]
requires = ["uv_build>=0.9.28,<0.10.0"]
requires = ["uv_build>=0.9.28,<0.11.0"]
build-backend = "uv_build"

[tool.hatch.build.targets.wheel]
packages = ["src/sre_agent"]

[tool.pytest.ini_options]
addopts = "--cov=sre_agent --cov-report term-missing"
testpaths = ["tests"]
1 change: 1 addition & 0 deletions src/sre_agent/eval/diagnosis_quality/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,6 @@ When the server is running, open [http://localhost:5173/](http://localhost:5173/
Run command:

```bash
uv sync --group eval
uv run sre-agent-run-diagnosis-quality-eval
```
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from opik.evaluation.metrics import base_metric, score_result


class AffectedServicesMatch(base_metric.BaseMetric):
class AffectedServicesMatch(base_metric.BaseMetric): # type: ignore[misc]
"""Score overlap between predicted and expected affected services."""

def __init__(self, name: str = "affected_services_match") -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from opik.evaluation.metrics import GEval, base_metric, score_result


class RootCauseCorrectness(base_metric.BaseMetric):
class RootCauseCorrectness(base_metric.BaseMetric): # type: ignore[misc]
"""Judge whether the root cause matches the expected issue."""

def __init__(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from opik.evaluation.metrics import GEval, base_metric, score_result


class SuggestedFixesQuality(base_metric.BaseMetric):
class SuggestedFixesQuality(base_metric.BaseMetric): # type: ignore[misc]
"""Judge whether suggested fixes are correct and actionable."""

def __init__(
Expand Down
1 change: 1 addition & 0 deletions src/sre_agent/eval/tool_call/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ When the server is running, open [http://localhost:5173/](http://localhost:5173/
Run command:

```bash
uv sync --group eval
uv run sre-agent-run-tool-call-eval
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from sre_agent.eval.tool_call.metrics.span_tools import extract_tool_names


class ExpectedToolSelectOrder(base_metric.BaseMetric):
class ExpectedToolSelectOrder(base_metric.BaseMetric): # type: ignore[misc]
"""Validate the expected tool selection order."""

def __init__(self, name: str = "expected_tool_select_order"):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from sre_agent.eval.tool_call.metrics.span_tools import extract_tool_names


class ExpectedToolSelection(base_metric.BaseMetric):
class ExpectedToolSelection(base_metric.BaseMetric): # type: ignore[misc]
"""Validate the expected tool selection."""

def __init__(self, name: str = "expected_tool_selection"):
Expand Down
1 change: 1 addition & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Tests package for the SRE Agent."""
6 changes: 6 additions & 0 deletions tests/test_dummy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
"""Dummy test file for pytest."""


def test_dummy() -> None:
"""A dummy test."""
assert True
Loading