Commit f213e7a7 authored by Mehmet Emin INAC's avatar Mehmet Emin INAC Committed by Alper Akgun

Introduce dismissal reason for vulnerability feedback

parent 1371e8d5
---
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 (
comment_author_id integer,
comment text,
comment_timestamp timestamp with time zone,
finding_uuid uuid
finding_uuid uuid,
dismissal_reason smallint
);
CREATE SEQUENCE vulnerability_feedback_id_seq
......
......@@ -14,6 +14,7 @@ module Vulnerabilities
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 category: ::Enums::Vulnerability.report_types
......
......@@ -11,6 +11,7 @@ RSpec.describe Vulnerabilities::Feedback do
)
}
it { is_expected.to define_enum_for(:category) }
it { is_expected.to define_enum_for(:dismissal_reason) }
describe 'associations' do
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