Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

Bai 2223 generalise scanners away from security#3139

Merged
IR96334 merged 40 commits intomainfrom
BAI-2223-generalise-scanners-away-from-security
Feb 19, 2026
Merged

Bai 2223 generalise scanners away from security#3139
IR96334 merged 40 commits intomainfrom
BAI-2223-generalise-scanners-away-from-security

Conversation

@IR96334
Copy link
Member

@IR96334 IR96334 commented Jan 26, 2026

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.

@IR96334
Copy link
Member Author

IR96334 commented Jan 27, 2026

Closes #2349

@IR96334 IR96334 marked this pull request as ready for review January 29, 2026 11:07
@PE39806 PE39806 linked an issue Jan 30, 2026 that may be closed by this pull request
@IR96334 IR96334 added the enhancement New feature or request label Feb 5, 2026
Comment on lines 27 to 31
scanners.startScans(file).then(
await ((resultsArray) => {
updateFileWithResults(file._id, resultsArray)
}),
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
GB907762 previously approved these changes Feb 18, 2026
@GB907762 GB907762 self-requested a review February 18, 2026 16:01
@GB907762 GB907762 dismissed their stale review February 18, 2026 16:05

Failing tests

Copy link
Contributor

@PE39806 PE39806 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drop all of the rerunFileScan tests in backend/test/services/file.spec.ts. They're duplicated from backend/test/services/scan.spec.ts where they all run properly.

GB907762
GB907762 previously approved these changes 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?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this still need to be done

'toolName' | 'scannerVersion' | 'state' | 'summary' | 'additionalInfo' | 'lastRunAt'
>

//TODO this may need to change
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

@@ -0,0 +1,42 @@
import ScanModel, { ModelScanSummary, ScanSummary, SeverityLevelKeys } from '../models/Scan.js'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a migration script start with 030 so worth updating the number

fileId: string
}
| {
//TODO - Change this - if necessary - when implementing image scanning.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need to do this?

@IR96334 IR96334 merged commit ceff28b into main Feb 19, 2026
23 checks passed
@IR96334 IR96334 deleted the BAI-2223-generalise-scanners-away-from-security branch February 19, 2026 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Changes affecting server-side logic, APIs, data processing, or internal services. documentation Improvements or additions to documentation enhancement New feature or request frontend Changes affecting the user-facing interface, client-side code, or presentation layer. helm Pull requests that update helm code javascript Pull requests that update Javascript code model artefact management ready for review tests Improvements or additions to unit tests and / or end to end tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generalise scanners away from security

7 participants

Comments