Skip to content

Add request and response to SupportingMessage

What does this MR do?

This MR adds requests and responses to Supporting Messages as described in #267489. It removes the NULL constraint on the request and response reference to evidences, as now they can be linked to either evidences or supporting messages.

Requests/Responses can be associated with either the evidence itself or the supporting messages that are associated with the evidence. We can have a structure that looks like this:

Evidence
|- Request
|- Response
|- Supporting Message
  |- Request
  |- Response

So in this instance we have to separate the associations.

Screenshots or Screencasts (strongly suggested)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Database

Migration

== 20210719182944 AddRequestResponseToSupporingMessage: migrating =============
-- change_column_null(:vulnerability_finding_evidence_requests, :vulnerability_finding_evidence_id, true)
   -> 0.0021s
-- change_column_null(:vulnerability_finding_evidence_responses, :vulnerability_finding_evidence_id, true)
   -> 0.0008s
-- add_reference(:vulnerability_finding_evidence_requests, :vulnerability_finding_evidence_supporting_message, {:index=>{:name=>"finding_evidence_requests_on_supporting_evidence_id"}, :foreign_key=>{:on_delete=>:cascade}})
   -> 0.0113s
-- add_reference(:vulnerability_finding_evidence_responses, :vulnerability_finding_evidence_supporting_message, {:index=>{:name=>"finding_evidence_responses_on_supporting_evidence_id"}, :foreign_key=>{:on_delete=>:cascade}})
   -> 0.0051s
== 20210719182944 AddRequestResponseToSupporingMessage: migrated (0.0194s) ====

Rollback

== 20210719182944 AddRequestResponseToSupporingMessage: reverting =============
-- remove_reference(:vulnerability_finding_evidence_responses, :vulnerability_finding_evidence_supporting_message, {:index=>{:name=>"finding_evidence_responses_on_supporting_evidence_id"}, :foreign_key=>{:on_delete=>:cascade}})
   -> 0.0119s
-- remove_reference(:vulnerability_finding_evidence_requests, :vulnerability_finding_evidence_supporting_message, {:index=>{:name=>"finding_evidence_requests_on_supporting_evidence_id"}, :foreign_key=>{:on_delete=>:cascade}})
   -> 0.0039s
-- change_column_null(:vulnerability_finding_evidence_responses, :vulnerability_finding_evidence_id, false)
   -> 0.0012s
-- change_column_null(:vulnerability_finding_evidence_requests, :vulnerability_finding_evidence_id, false)
   -> 0.0011s
== 20210719182944 AddRequestResponseToSupporingMessage: reverted (0.0211s) ====

Related to #267489

Edited by Jonathan Schafer

Merge request reports

Loading