Commit ec056fa7 authored by Alper Akgun's avatar Alper Akgun

Merge branch '293679_introduce_dismissal_reason_for_vulnerability_feedback' into 'master'

Introduce dismissal reason for vulnerability feedback

See merge request gitlab-org/gitlab!50632
parents 4f003d30 f213e7a7
---
title: Add `dismissal_reason` column into the `vulnerability_feedback` table
merge_request: 50632
author:
type: added
# frozen_string_literal: true
class AddDismissalReasonIntoVulnerabilityFeedbackTable < ActiveRecord::Migration[6.0]
DOWNTIME = false
def up
add_column :vulnerability_feedback, :dismissal_reason, :smallint
end
def down
remove_column :vulnerability_feedback, :dismissal_reason
end
end
9018fed4aab19642fafee3e50bf41be422fc3f8256d0b5d78c8a70fc96f4090f
\ No newline at end of file
...@@ -17645,7 +17645,8 @@ CREATE TABLE vulnerability_feedback ( ...@@ -17645,7 +17645,8 @@ CREATE TABLE vulnerability_feedback (
comment_author_id integer, comment_author_id integer,
comment text, comment text,
comment_timestamp timestamp with time zone, comment_timestamp timestamp with time zone,
finding_uuid uuid finding_uuid uuid,
dismissal_reason smallint
); );
CREATE SEQUENCE vulnerability_feedback_id_seq CREATE SEQUENCE vulnerability_feedback_id_seq
......
...@@ -14,6 +14,7 @@ module Vulnerabilities ...@@ -14,6 +14,7 @@ module Vulnerabilities
attr_accessor :vulnerability_data attr_accessor :vulnerability_data
enum dismissal_reason: { acceptable_risk: 0, false_positive: 1, mitigating_control: 2, used_in_tests: 3, not_applicable: 4 }
enum feedback_type: { dismissal: 0, issue: 1, merge_request: 2 }, _prefix: :for enum feedback_type: { dismissal: 0, issue: 1, merge_request: 2 }, _prefix: :for
enum category: ::Enums::Vulnerability.report_types enum category: ::Enums::Vulnerability.report_types
......
...@@ -11,6 +11,7 @@ RSpec.describe Vulnerabilities::Feedback do ...@@ -11,6 +11,7 @@ RSpec.describe Vulnerabilities::Feedback do
) )
} }
it { is_expected.to define_enum_for(:category) } it { is_expected.to define_enum_for(:category) }
it { is_expected.to define_enum_for(:dismissal_reason) }
describe 'associations' do describe 'associations' do
it { is_expected.to belong_to(:project) } it { is_expected.to belong_to(:project) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment