Update `XrayReport` model JSON schema & remove `xray_reports.file_checksum` column
The following discussion from !162313 (merged) should be addressed:
-
@mikolaj_wawrzyniak started a discussion: (+2 comments) nitpick: Have you considered extracting version string into a const to create SSoT from the start?
@lma-git
: I originally just hardcoded this number in because it will likely be temporary. If we proceed with deprecating Repository X-Ray, we would removescannerVersion
from the payload entirely.But extracting it to a const will clean it up and allow me to explain further in a comment. So I'll go ahead and do that.
Considerations
- Do we really need checksums anymore? See #479185 (comment 2140346559).
Proposal
- Update the
XrayReport
JSON schema:- Remove
scannerVersion
andchecksum
. - Change
fileName
tofile_path
. - Remove/update the fields above in
Ai::Context::Dependencies::ConfigFiles::Base
andAi::RepositoryXray::ScanDependenciesService
.
- Remove
- Remove the
xray_reports.file_checksum
database column.- NOTE: This will likely require a multi-step release approach (docs reference).
- Related issues:
### Proposal update
Due to the database-level constraints caused by the column file_checksum
not being nullable, we will encounter issues when we remove checksum
from the XRay Report schema as per the proposal above, including failing tests. Therefore, we're adding an additional step to add a migration that allows file_checksum
to be nullable before removing the field from the Xray Report schema.