Skip to content

Commit d410c07

Browse files
Den A EvDen A Ev
authored andcommitted
Final CI stabilization: fix payout locks and conftest imports (Claude audited)
1 parent eafd2a8 commit d410c07

5 files changed

Lines changed: 7 additions & 12 deletions

File tree

backend/app/services/payout_service.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ async def list_payouts(
134134

135135
async def get_payout_by_id(payout_id: str) -> Optional[PayoutResponse]:
136136
"""Retrieve payout by UUID from DB or cache."""
137-
with _lock:
137+
with _store_lock:
138138
if payout_id in _payout_store:
139139
return _payout_to_response(_payout_store[payout_id])
140140

@@ -154,7 +154,7 @@ async def get_payout_by_tx_hash(tx_hash: str) -> Optional[PayoutResponse]:
154154

155155
async def approve_payout(payout_id: str, admin_id: str) -> AdminApprovalResponse:
156156
"""Admin approval gate."""
157-
with _lock:
157+
with _store_lock:
158158
record = _payout_store.get(payout_id)
159159

160160
if not record:

backend/app/services/pg_store.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import uuid as _uuid
44
import logging
55
from typing import Any, Optional, Dict, List
6-
from decimal import Decimal
76
from datetime import datetime
87

98
from sqlalchemy import select, delete as sa_del, func

backend/submit_bounty.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import os
21
import subprocess
32
import logging
43

backend/tests/e2e/conftest.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,11 @@
3838
os.environ["GITHUB_CLIENT_ID"] = ""
3939
os.environ["GITHUB_CLIENT_SECRET"] = ""
4040

41-
# ---------------------------------------------------------------------------
42-
# Test user for dependency override
43-
# ---------------------------------------------------------------------------
44-
45-
from app.models.user import UserResponse # Model-only imports are safe
46-
from tests.e2e.factories import DEFAULT_WALLET
41+
# Late imports must follow environment setup (architectural requirement)
42+
from app.api.auth import get_current_user # noqa: E402
43+
from app.models.user import UserResponse # noqa: E402
44+
from app.services.websocket_manager import manager as ws_manager, WebSocketManager, InMemoryPubSubAdapter # noqa: E402
45+
from tests.e2e.factories import DEFAULT_WALLET # noqa: E402
4746

4847

4948
# ---------------------------------------------------------------------------
@@ -136,7 +135,6 @@ async def _async_init():
136135
from app.api.payouts import router as payouts_router
137136
from app.api.stats import router as stats_router
138137
from app.api.websocket import router as websocket_router
139-
from app.services.websocket_manager import manager as ws_manager, WebSocketManager, InMemoryPubSubAdapter
140138

141139
test_app = FastAPI(
142140
title="SolFoundry E2E Test",

backend/verify_middleware.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import asyncio
22
from httpx import AsyncClient, ASGITransport
33
from app.main import app
4-
import json
54

65
async def verify():
76
print("--- 🛡️ Production Security Audit: Bounty #169 ---")

0 commit comments

Comments
 (0)