fix: mark admin/platform queries as SVC-005 exceptions
These queries are intentionally not vendor-scoped: - inventory_service: get_vendors_with_inventory_admin (admin cross-vendor) - background_tasks_service: get_running_test_runs (platform-level) - marketplace_product_service: get_inventory_info (admin/internal) - feature_service: Feature query (platform-level, not vendor-scoped) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -45,6 +45,7 @@ class BackgroundTasksService:
|
|||||||
|
|
||||||
def get_running_test_runs(self, db: Session) -> list[TestRun]:
|
def get_running_test_runs(self, db: Session) -> list[TestRun]:
|
||||||
"""Get currently running test runs"""
|
"""Get currently running test runs"""
|
||||||
|
# noqa: SVC-005 - Platform-level, TestRuns not vendor-scoped
|
||||||
return db.query(TestRun).filter(TestRun.status == "running").all()
|
return db.query(TestRun).filter(TestRun.status == "running").all()
|
||||||
|
|
||||||
def get_import_stats(self, db: Session) -> dict:
|
def get_import_stats(self, db: Session) -> dict:
|
||||||
|
|||||||
@@ -444,6 +444,7 @@ class FeatureService:
|
|||||||
raise TierNotFoundError(tier_code)
|
raise TierNotFoundError(tier_code)
|
||||||
|
|
||||||
# Validate feature codes exist
|
# Validate feature codes exist
|
||||||
|
# noqa: SVC-005 - Features are platform-level, not vendor-scoped
|
||||||
valid_codes = {
|
valid_codes = {
|
||||||
f.code for f in db.query(Feature.code).filter(Feature.is_active == True).all() # noqa: E712
|
f.code for f in db.query(Feature.code).filter(Feature.is_active == True).all() # noqa: E712
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -754,6 +754,7 @@ class InventoryService:
|
|||||||
self, db: Session
|
self, db: Session
|
||||||
) -> AdminVendorsWithInventoryResponse:
|
) -> AdminVendorsWithInventoryResponse:
|
||||||
"""Get list of vendors that have inventory entries (admin only)."""
|
"""Get list of vendors that have inventory entries (admin only)."""
|
||||||
|
# noqa: SVC-005 - Admin function, intentionally cross-vendor
|
||||||
vendors = (
|
vendors = (
|
||||||
db.query(Vendor).join(Inventory).distinct().order_by(Vendor.name).all()
|
db.query(Vendor).join(Inventory).distinct().order_by(Vendor.name).all()
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -436,6 +436,7 @@ class MarketplaceProductService:
|
|||||||
InventorySummaryResponse if inventory found, None otherwise
|
InventorySummaryResponse if inventory found, None otherwise
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
|
# noqa: SVC-005 - Admin/internal function for inventory lookup by GTIN
|
||||||
inventory_entries = db.query(Inventory).filter(Inventory.gtin == gtin).all()
|
inventory_entries = db.query(Inventory).filter(Inventory.gtin == gtin).all()
|
||||||
if not inventory_entries:
|
if not inventory_entries:
|
||||||
return None
|
return None
|
||||||
|
|||||||
Reference in New Issue
Block a user