Repository navigation
Add CodSpeed performance benchmarks for the backend - #1773
codspeed[bot] wants to merge 1 commit into
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: Repository: ContextualWisdomLab/naruon/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Congrats! CodSpeed is installed 🎉
You will start to see performance impacts in the reports once the benchmarks are run from your default branch.
|
There was a problem hiding this comment.
Pull request overview
OpenCode reviewed the current-head product diff. Coverage is a separate gate.
Changed files
.github/workflows/codspeed.yml— GitHub Actions review jobREADME.md— repository behaviorbackend/README.md— API and service runtimebackend/pyproject.toml— API and service runtimebackend/tests/benchmarks/__init__.py— regression suitebackend/tests/benchmarks/test_bench_core.py— regression suitebackend/uv.lock— API and service runtime
Changed behavior
flowchart LR
PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
Evidence --> S1["Workflow: codspeed.yml"]
S1 --> I1["GitHub Actions review job"]
I1 --> R1["Review risk: Workflow: codspeed.yml"]
R1 --> V1["actionlint plus required checks"]
Evidence --> S2["Repository file: README.md"]
S2 --> I2["repository behavior"]
I2 --> R2["Review risk: Repository file: README.md"]
R2 --> V2["required checks"]
Evidence --> S3["Backend: README.md (3 files)"]
S3 --> I3["API and service runtime"]
I3 --> R3["Review risk: Backend: README.md (3 files)"]
R3 --> V3["backend tests"]
Evidence --> S4["Test: __init__.py (2 files)"]
S4 --> I4["regression suite"]
I4 --> R4["Review risk: Test: __init__.py (2 files)"]
R4 --> V4["targeted test run"]
Findings
No source-backed product finding is synthesized from the coverage gate. A coverage miss belongs in the status comment.
- Head SHA:
dad2902ce3ad4fe6657deb98ab3ad4f634778ede - Workflow run: 36093653489
- Workflow attempt: 1
- Coverage gate:
failure
Review outcome
Coverage is a gate, not the review. This body reviews the changed product files.
Changed-File Evidence Map
flowchart LR
PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
Evidence --> S1["Workflow: codspeed.yml"]
S1 --> I1["GitHub Actions review job"]
I1 --> R1["Review risk: Workflow: codspeed.yml"]
R1 --> V1["actionlint plus required checks"]
Evidence --> S2["Repository file: README.md"]
S2 --> I2["repository behavior"]
I2 --> R2["Review risk: Repository file: README.md"]
R2 --> V2["required checks"]
Evidence --> S3["Backend: README.md (3 files)"]
S3 --> I3["API and service runtime"]
I3 --> R3["Review risk: Backend: README.md (3 files)"]
R3 --> V3["backend tests"]
Evidence --> S4["Test: __init__.py (2 files)"]
S4 --> I4["regression suite"]
I4 --> R4["Review risk: Test: __init__.py (2 files)"]
R4 --> V4["targeted test run"]
OpenCode Review Overview
Coverage evidence did not pass, so approval is blocked. The formal pull-request review is the source-backed diff review, not this status comment. |
|
Admission correction — exact current head |
Summary
This PR sets up continuous performance testing with CodSpeed for the FastAPI backend, using
pytest-codspeedin CPU simulation mode.Changes
backend/tests/benchmarks/test_bench_core.py: 10 benchmarks covering CPU-bound backend hot paths:parse_eml_byteson a realistic multipart email (plain + HTML + CSV attachment, long References header) and on the threading reply fixturestrip_html_markupon an HTML document with scripts, entities, comments and angle-bracket emails, plus the plain-text fast pathcontains_html_markupextract_reference_idson a long folded References header with duplicatesrankweave) across 500 candidatesevaluate_calendar_conflicts_from_icsagainst a 100-event existing calendarevaluate_accessRBAC/ABAC decisions for 300 requestspytest.importorskip("pytest_codspeed"), so the existingApplication CIrun (which installs fromrequirements-hashes.txtwithout the plugin) simply skips it and is unaffected.backend/pyproject.toml/backend/uv.lock:pytest-codspeed==5.0.3added to thedevdependency group (pinned like the other dev dependencies). The runtime hashed requirement files are untouched..github/workflows/codspeed.yml: new workflow running on PRs and pushes todevelop/master(plusworkflow_dispatchfor backtesting). It follows the existing CI conventions (harden-runner, commit-SHA pinned actions, Python 3.14,persist-credentials: false), installs dependencies withuv sync --frozen --group dev, and runsCodSpeedHQ/actionv5.2.1 insimulationmode with OIDC authentication (no token secret needed).backend/README.md.Running locally
cd backend uv sync --group dev uv run pytest tests/benchmarks --codspeedNext steps
develop, and subsequent PRs will get performance reports comparing against it.@pytest.mark.benchmarktests underbackend/tests/benchmarks/.