Bai 2223 generalise scanners away from security#3139
Merged
Conversation
…ed documentation, and new Scan model properties
Member
Author
|
Closes #2349 |
…and display more scan states
PE39806
requested changes
Jan 30, 2026
JRB66955
requested changes
Jan 30, 2026
ON93754
reviewed
Feb 2, 2026
PE39806
requested changes
Feb 13, 2026
PE39806
requested changes
Feb 17, 2026
backend/src/services/scan.ts
Outdated
Comment on lines
27
to
31
| scanners.startScans(file).then( | ||
| await ((resultsArray) => { | ||
| updateFileWithResults(file._id, resultsArray) | ||
| }), | ||
| ) |
Contributor
There was a problem hiding this comment.
I think this isn't quite right and, instead, should be:
Suggested change
| scanners.startScans(file).then( | |
| await ((resultsArray) => { | |
| updateFileWithResults(file._id, resultsArray) | |
| }), | |
| ) | |
| const resultsArray = await scanners.startScans(file) | |
| await updateFileWithResults(file._id, resultsArray) |
The current approach is non-blocking on updateFileWithResults as .then returns a Promise and essentially ignores await, but it should be blocking as we only want to run ScanModel.find after the results are saved.
GB907762
reviewed
Feb 17, 2026
GB907762
previously approved these changes
Feb 18, 2026
PE39806
requested changes
Feb 18, 2026
GB907762
previously approved these changes
Feb 19, 2026
ARADDCC002
reviewed
Feb 19, 2026
| import log from '../../services/log.js' | ||
| import { ArtefactTypeKeys } from '../../types/types.js' | ||
|
|
||
| //TODO Remove file-specific mentions, but do I replace with artefact? or keep bare? |
Member
There was a problem hiding this comment.
Does this still need to be done
| 'toolName' | 'scannerVersion' | 'state' | 'summary' | 'additionalInfo' | 'lastRunAt' | ||
| > | ||
|
|
||
| //TODO this may need to change |
| @@ -0,0 +1,42 @@ | |||
| import ScanModel, { ModelScanSummary, ScanSummary, SeverityLevelKeys } from '../models/Scan.js' | |||
Member
There was a problem hiding this comment.
I had a migration script start with 030 so worth updating the number
backend/src/models/Scan.ts
Outdated
| fileId: string | ||
| } | ||
| | { | ||
| //TODO - Change this - if necessary - when implementing image scanning. |
Member
There was a problem hiding this comment.
Do we still need to do this?
GB907762
approved these changes
Feb 19, 2026
JRB66955
approved these changes
Feb 19, 2026
PE39806
approved these changes
Feb 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As Bailo moves towards more generalised scanners — the scanning of images and scanning of "vulnerabilities" over "viruses" — the file scanning functionality needs to be generalised/repurposed for the inclusion of other artefact types.