Repository navigation
Conversation
Reviewer's GuideTestsAdd focused tests for staff audit change tracking, actor attribution, row serialization and redaction, and previous-value capture.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 55 minutes. View limit details
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="gateway/tests/test_admin_audit.py" line_range="107" />
<code_context>
+
+
+def test_get_actor_reads_the_configured_session_key():
+ request = _request(admin_id="staff-123", admin_email="staff@example.com")
+
+ assert asyncio.run(_backend().get_actor(request)) == "staff-123"
</code_context>
<issue_to_address>
**Configured actor lookup goes unverified**
When `get_actor` is changed to use a fixed `admin_id` key or actor value instead of the configured key, `test_get_actor_reads_the_configured_session_key` still passes if `get_actor` reads the literal `"admin_id"` or returns `"staff-123"`, because `_backend()` uses that same key and the request supplies that value. Production config uses `admin_user`, so this regression can go unnoticed and audit actions lose staff attribution.
Configure the test backend with a distinct key and assert that its value is used even when the session contains a different `admin_id`.
</issue_to_address>Sourcery assessment
Approval pending. 1 finding to address first.
Blocking findings: gateway/tests/test_admin_audit.py:107
|
Hi maintainers, The latest commit ( Could someone with the required repository permissions approve the workflow run so CI can execute? Thanks! |
Summary
StaffAuditBackendchanged-field tracking and no-op updates.remember().This is a test-only contribution; no production code is changed.
Validation
pytest tests/test_admin_audit.py -v— 18 passed, with one existing Starlette/httpx deprecation warning.Part of #46.
Summary by Sourcery
Tests:
Summary by CodeRabbit