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
-
I have included changelog trailers, or none are needed. (Does this MR need a changelog?) -
I have added/updated documentation, or it's not needed. (Is documentation required?) -
I have properly separated EE content from FOSS, or this MR is FOSS only. (Where should EE code go?) -
I have added information for database reviewers in the MR description, or it's not needed. (Does this MR have database related changes?) -
I have self-reviewed this MR per code review guidelines. -
This MR does not harm performance, or I have asked a reviewer to help assess the performance impact. (Merge request performance guidelines) -
I have followed the style guides. -
This change is backwards compatible across updates, or this does not apply.
Availability and Testing
-
I have added/updated tests following the Testing Guide, or it's not needed. (Consider all test levels. See the Test Planning Process.) -
I have tested this MR in all supported browsers, or it's not needed. -
I have informed the Infrastructure department of a default or new setting change per definition of done, or it's not needed.
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