-
Notifications
You must be signed in to change notification settings - Fork 14.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update report_vuln to support tracking origin #19817
Update report_vuln to support tracking origin #19817
Conversation
@@ -116,13 +115,13 @@ def report_service(opts) | |||
end | |||
|
|||
if opts[:task] | |||
Mdm::TaskService.create( | |||
Mdm::TaskService.where( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without this change, multiple entries were being created
end | ||
|
||
ret[:service] = service | ||
service |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A hash was never being returned from this method, the value assigned to the hash entry was being returned - i.e. the Mdm::Service
983fd26
to
d59c6f0
Compare
d59c6f0
to
c768ec8
Compare
@@ -8,4 +8,61 @@ | |||
it { is_expected.to respond_to :find_or_create_service } | |||
it { is_expected.to respond_to :services } | |||
it { is_expected.to respond_to :report_service } | |||
|
|||
describe '#report_service', if: !ENV['REMOTE_DB'] do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the API for the remote db needs more work for existing functionality to be tested; but will mark this as skipped for now: #18439
Note: Looks like this might be a weird pattern, as if a module is rerun multiple times - it will try to upsert the vuln model - and replace existing 'origin' definitions. This means if the user wants to see where a vuln came from - it will be the last reported module run. This might be fine, but for the scenario of regenerating older reports - the link between the task run and the associated vuln may now no longer exist. This might be an existing problem with our data model though. |
Will close this off; I don't think a single |
Update
report_vuln
to support tracking originVerification