Phase 2: add volume scan engine MVP - #15
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 33219c046f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const cleanup = cleanupMissingScannedArtifacts({ | ||
| volumeId, | ||
| seenStorageKeys: runState.seenStorageKeys, | ||
| dryRun, | ||
| }); |
There was a problem hiding this comment.
Skip destructive cleanup when scan had read/upsert errors
In runVolumeAutoScanBatch, scan failures are downgraded to warnings (for example readdirSync/statSync and upsert errors around lines 452-539), but the code still unconditionally calls cleanupMissingScannedArtifacts here. If a subtree is unreadable (e.g., EPERM) or node/blob upsert fails, those files are never added to seenStorageKeys, so cleanup misclassifies existing rows as missing and soft-deletes their nodes/blobs metadata even though the files still exist on disk. This makes partial scans destructive instead of best-effort.
Useful? React with 👍 / 👎.
| } catch (err) { | ||
| sendJson(res, 500, errorResponse('INTERNAL', String(err))); |
There was a problem hiding this comment.
Return 404 when requested volume does not exist
This handler maps every failure from createOrReuseVolumeAutoScanJob to HTTP 500, but that function explicitly throws Volume not found when the volume UUID is absent. As a result, POST /admin/volumes/{volume_id}/scan returns INTERNAL instead of NOT_FOUND for missing volumes, which conflicts with the endpoint contract and prevents clients from handling nonexistent resources correctly.
Useful? React with 👍 / 👎.
|
Reviewed Codex review note post-merge: no inline actionable threads were present. Scan MVP changes were validated by CI pass before merge. |
Summary
POST /admin/volumes/{volume_id}/scanendpoint with optionaldry_runrequest.scripts/dev_server.mjswith directory walk, symlink/permission handling, and node/blob upsert by path.VOLUME_AUTO_SCANand expose volume scan-state fields in volume responses.Validation
node --check scripts/dev_server.mjsnpx @redocly/cli lint openapi/openapi.yaml(pass with existing warnings only)