Correct and clean up xray_report payload schema & factory

What does this MR do and why?

In #479185 (closed), we updated the Projects::XrayReport model's payload JSON schema. There was a small typo in the issue which said to use file_path, but it was supposed to be the plural file_paths. This is because when we save the report in Ai::RepositoryXray::ScanDependenciesService, we merge multiple payloads and combine the file paths into a string array.

This MR:

  • Updates the Xray payload JSON schema with file_paths and defines it as a string array.
    • NOTE: This does not affect any existing code/behaviour because:
      • (a) we currently don't make use of the file_paths value anywhere, and
      • (b) the JSON schema is not and has never been restrictive so far (i.e. no required fields), so it won't throw validation errors.
  • Updates the xray_reports factory and related specs to more accurately reflect actual values saved to the database.

References

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Leaminn Ma

Merge request reports

Loading