Add source_xid attribute to the ErrorTracking in CreateVulnerabilityService class
Proposal
Add source_xid attribute to ErrorTracking
in CreateVulnerabilityService class.
The following discussion from !136138 (merged) should be addressed:
-
@brytannia started a discussion: (+3 comments) question: In case of the error, we will have similar error tracked in
CreateVulnerabilityService
, but it won't havesource_xid
param. What are purposes of each messages in this case?
The source_xid
parameter is helpful to have so that the origin of the advisory is known. Combined with the advisory_xid
attribute,
you can track down where an advisory came from easily.
Implementation plan
-
Add source_xid
toattr_reader
and initializesource_xid
in the advisory data object of the VulnerabilityScanning::Advisory class. -
Within the AdvisoryScanner class, include source_xid
in the creation of the Gitlab::VulnerabilityScanning::Advisory object in thevulnerability_scanning_advisory
method. This involves creating VulnerabilityScanning::Advisory from a data object that containssource_xid
. -
Update the factories and test cases accordingly. -
When using the CreateVulnerabilityService, ensure that source_xid
is passed to the ::Gitlab::ErrorTracking.track_exception methods.
Edited by Aditya Tiwari