Skip to content
Snippets Groups Projects
Unverified Commit 6f7b5408 authored by Tetiana Chupryna's avatar Tetiana Chupryna
Browse files

Drop FF drop_license_management_artifact

Remove this flag as this type is deperecated
parent bfe2457a
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -74,7 +74,6 @@ class JobArtifact < ApplicationRecord
dependency_scanning: :raw,
container_scanning: :raw,
dast: :raw,
license_management: :raw,
license_scanning: :raw,
 
# All these file formats use `raw` as we need to store them uncompressed
Loading
Loading
@@ -199,8 +198,8 @@ class JobArtifact < ApplicationRecord
container_scanning: 7, ## EE-specific
dast: 8, ## EE-specific
codequality: 9, ## EE-specific
license_management: 10, ## EE-specific
license_scanning: 101, ## EE-specific till 13.0
license_management: 10, ## EE-specific, deprecated
license_scanning: 101, ## EE-specific
performance: 11, ## EE-specific till 13.2
metrics: 12, ## EE-specific
metrics_referee: 13, ## runner referees
Loading
Loading
@@ -234,8 +233,6 @@ class JobArtifact < ApplicationRecord
}
 
def validate_supported_file_format!
return if Feature.disabled?(:drop_license_management_artifact, project, default_enabled: true)
if UNSUPPORTED_FILE_TYPES.include?(self.file_type&.to_sym)
errors.add(:base, _("File format is no longer supported"))
end
Loading
Loading
Loading
Loading
@@ -9537,8 +9537,8 @@ CREATE TABLE application_settings (
throttle_authenticated_packages_api_period_in_seconds integer DEFAULT 15 NOT NULL,
throttle_unauthenticated_packages_api_enabled boolean DEFAULT false NOT NULL,
throttle_authenticated_packages_api_enabled boolean DEFAULT false NOT NULL,
deactivate_dormant_users boolean DEFAULT false NOT NULL,
whats_new_variant smallint DEFAULT 0,
deactivate_dormant_users boolean DEFAULT false NOT NULL,
encrypted_spam_check_api_key bytea,
encrypted_spam_check_api_key_iv bytea,
floc_enabled boolean DEFAULT false NOT NULL,
Loading
Loading
@@ -13771,9 +13771,9 @@ CREATE TABLE incident_management_oncall_rotations (
length_unit smallint NOT NULL,
starts_at timestamp with time zone NOT NULL,
name text NOT NULL,
ends_at timestamp with time zone,
active_period_start time without time zone,
active_period_end time without time zone,
ends_at timestamp with time zone,
CONSTRAINT check_5209fb5d02 CHECK ((char_length(name) <= 200))
);
 
Loading
Loading
@@ -14306,7 +14306,8 @@ CREATE TABLE labels (
description_html text,
type character varying,
group_id integer,
cached_markdown_version integer
cached_markdown_version integer,
remove_on_close boolean DEFAULT false NOT NULL
);
 
CREATE SEQUENCE labels_id_seq
Loading
Loading
@@ -14889,11 +14890,11 @@ ALTER SEQUENCE milestones_id_seq OWNED BY milestones.id;
 
CREATE TABLE namespace_admin_notes (
id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL,
namespace_id bigint NOT NULL,
note text,
CONSTRAINT check_e9d2e71b5d CHECK ((char_length(note) <= 1000))
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL,
CONSTRAINT check_e9d2e71b5d CHECK ((char_length(note) <= 255))
);
 
CREATE SEQUENCE namespace_admin_notes_id_seq
Loading
Loading
@@ -16202,8 +16203,8 @@ CREATE TABLE plan_limits (
ci_max_artifact_size_api_fuzzing integer DEFAULT 0 NOT NULL,
ci_pipeline_deployments integer DEFAULT 500 NOT NULL,
pull_mirror_interval_seconds integer DEFAULT 300 NOT NULL,
daily_invites integer DEFAULT 0 NOT NULL,
rubygems_max_file_size bigint DEFAULT '3221225472'::bigint NOT NULL,
daily_invites integer DEFAULT 0 NOT NULL,
terraform_module_max_file_size bigint DEFAULT 1073741824 NOT NULL,
helm_max_file_size bigint DEFAULT 5242880 NOT NULL,
ci_registered_group_runners integer DEFAULT 1000 NOT NULL,
Loading
Loading
@@ -22552,6 +22553,8 @@ CREATE INDEX index_boards_epic_boards_on_group_id ON boards_epic_boards USING bt
 
CREATE INDEX index_boards_epic_list_user_preferences_on_epic_list_id ON boards_epic_list_user_preferences USING btree (epic_list_id);
 
CREATE INDEX index_boards_epic_list_user_preferences_on_user_id ON boards_epic_list_user_preferences USING btree (user_id);
CREATE INDEX index_boards_epic_lists_on_epic_board_id ON boards_epic_lists USING btree (epic_board_id);
 
CREATE UNIQUE INDEX index_boards_epic_lists_on_epic_board_id_and_label_id ON boards_epic_lists USING btree (epic_board_id, label_id) WHERE (list_type = 1);
Loading
Loading
@@ -23782,7 +23785,7 @@ CREATE INDEX index_notes_on_discussion_id ON notes USING btree (discussion_id);
 
CREATE INDEX index_notes_on_line_code ON notes USING btree (line_code);
 
CREATE INDEX index_notes_on_note_trigram ON notes USING gin (note gin_trgm_ops);
CREATE INDEX index_notes_on_note_gin_trigram ON notes USING gin (note gin_trgm_ops);
 
CREATE INDEX index_notes_on_noteable_id_and_noteable_type_and_system ON notes USING btree (noteable_id, noteable_type, system);
 
Loading
Loading
@@ -26937,6 +26940,9 @@ ALTER TABLE ONLY packages_debian_project_distributions
ALTER TABLE ONLY packages_rubygems_metadata
ADD CONSTRAINT fk_rails_95a3f5ce78 FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE CASCADE;
 
ALTER TABLE ONLY boards_epic_list_user_preferences
ADD CONSTRAINT fk_rails_95eac55851 FOREIGN KEY (epic_list_id) REFERENCES boards_epic_lists(id) ON DELETE CASCADE;
ALTER TABLE ONLY packages_pypi_metadata
ADD CONSTRAINT fk_rails_9698717cdd FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE CASCADE;
 
Loading
Loading
@@ -27492,6 +27498,9 @@ ALTER TABLE ONLY resource_state_events
ALTER TABLE ONLY packages_debian_group_components
ADD CONSTRAINT fk_rails_f5f1ef54c6 FOREIGN KEY (distribution_id) REFERENCES packages_debian_group_distributions(id) ON DELETE CASCADE;
 
ALTER TABLE ONLY boards_epic_list_user_preferences
ADD CONSTRAINT fk_rails_f5f2fe5c1f FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
ALTER TABLE ONLY incident_management_oncall_shifts
ADD CONSTRAINT fk_rails_f6eef06841 FOREIGN KEY (participant_id) REFERENCES incident_management_oncall_participants(id) ON DELETE CASCADE;
 
Loading
Loading
@@ -99,14 +99,10 @@
 
before do
stub_licensed_features(license_scanning: true)
stub_feature_flags(drop_license_management_artifact: false)
create(:ee_ci_build, :license_scanning, pipeline: pipeline)
end
 
[:license_scanning, :license_management].each do |artifact_type|
let!(:build) { create(:ee_ci_build, artifact_type, pipeline: pipeline) }
it { is_expected.to be_truthy }
end
it { is_expected.to be_truthy }
end
 
describe '#security_reports' do
Loading
Loading
Loading
Loading
@@ -281,7 +281,6 @@
:container_scanning | :with_container_scanning_reports | :container_scanning
:dast | :with_dast_reports | :dast
:dependency_scanning | :with_dependency_scanning_reports | :dependency_scanning
:license_scanning | :with_license_management_reports | :license_scanning
:license_scanning | :with_license_scanning_reports | :license_scanning
:coverage_fuzzing | :with_coverage_fuzzing_reports | :coverage_fuzzing
:secret_detection | :with_secret_detection_reports | :secret_detection
Loading
Loading
@@ -292,7 +291,6 @@
subject { merge_request.enabled_reports[report_type] }
 
before do
stub_feature_flags(drop_license_management_artifact: false)
stub_licensed_features({ feature => true })
end
 
Loading
Loading
Loading
Loading
@@ -3,8 +3,8 @@
require 'spec_helper'
 
RSpec.describe Security::SyncReportsToApprovalRulesService, '#execute' do
let(:merge_request) { create(:merge_request) }
let(:project) { merge_request.project }
let!(:merge_request) { create(:merge_request) }
let!(:project) { merge_request.project }
let(:pipeline) { create(:ee_ci_pipeline, :success, project: project, merge_requests_as_head_pipeline: [merge_request]) }
let(:report_approver_rule) { create(:report_approver_rule, merge_request: merge_request, approvals_required: 2) }
let(:base_pipeline) { create(:ee_ci_pipeline, :success, project: project, ref: merge_request.target_branch, sha: merge_request.diff_base_sha) }
Loading
Loading
@@ -70,28 +70,14 @@
context "license compliance policy" do
let!(:license_compliance_rule) { create(:report_approver_rule, :license_scanning, merge_request: merge_request, approvals_required: 1) }
 
before do
stub_feature_flags(drop_license_management_artifact: false)
end
context "when a license violates the license compliance policy" do
let!(:software_license_policy) { create(:software_license_policy, :denied, project: project, software_license: denied_license) }
let!(:ci_build) { create(:ee_ci_build, :success, :license_scanning, pipeline: pipeline, project: project) }
let(:denied_license) { create(:software_license, name: license_name) }
let(:license_name) { ci_build.pipeline.license_scanning_report.license_names[0] }
 
context 'with a new report' do
let!(:ci_build) { create(:ee_ci_build, :success, :license_scanning, pipeline: pipeline, project: project) }
specify { expect { subject }.not_to change { license_compliance_rule.reload.approvals_required } }
specify { expect(subject[:status]).to be(:success) }
end
context 'with an old report' do
let!(:ci_build) { create(:ee_ci_build, :success, :license_management, pipeline: pipeline, project: project) }
specify { expect { subject }.not_to change { license_compliance_rule.reload.approvals_required } }
specify { expect(subject[:status]).to be(:success) }
end
specify { expect { subject }.not_to change { license_compliance_rule.reload.approvals_required } }
specify { expect(subject[:status]).to be(:success) }
end
 
context "when no licenses violate the license compliance policy" do
Loading
Loading
@@ -101,17 +87,6 @@
specify { expect { subject }.to change { license_compliance_rule.reload.approvals_required }.from(1).to(0) }
specify { expect(subject[:status]).to be(:success) }
end
context 'with an old report' do
let!(:ci_build) { create(:ee_ci_build, :success, :license_management, pipeline: pipeline, project: project) }
before do
stub_feature_flags(drop_license_management_artifact: false)
end
specify { expect { subject }.to change { license_compliance_rule.reload.approvals_required }.from(1).to(0) }
specify { expect(subject[:status]).to be(:success) }
end
end
 
context "when an unexpected error occurs" do
Loading
Loading
Loading
Loading
@@ -111,10 +111,6 @@
describe '.with_downloadable_artifacts' do
subject { described_class.with_downloadable_artifacts }
 
before do
stub_feature_flags(drop_license_management_artifact: false)
end
context 'when job does not have a downloadable artifact' do
let!(:job) { create(:ci_build) }
 
Loading
Loading
@@ -126,6 +122,8 @@
::Ci::JobArtifact::DOWNLOADABLE_TYPES.each do |type|
context "when job has a #{type} artifact" do
it 'returns the job' do
pp ::Ci::JobArtifact::INTERNAL_TYPES
pp ::Ci::JobArtifact::REPORT_TYPES
job = create(:ci_build)
create(
:ci_job_artifact,
Loading
Loading
Loading
Loading
@@ -333,30 +333,12 @@
 
let(:artifact) { build(:ci_job_artifact, file_type: :license_management, file_format: :raw) }
 
context 'when license_management is supported' do
before do
stub_feature_flags(drop_license_management_artifact: false)
end
it { is_expected.to be_valid }
end
context 'when license_management is not supported' do
before do
stub_feature_flags(drop_license_management_artifact: true)
end
it { is_expected.not_to be_valid }
end
it { is_expected.not_to be_valid }
end
 
describe 'validates file format' do
subject { artifact }
 
before do
stub_feature_flags(drop_license_management_artifact: false)
end
described_class::TYPE_AND_FORMAT_PAIRS.except(:trace).each do |file_type, file_format|
context "when #{file_type} type with #{file_format} format" do
let(:artifact) { build(:ci_job_artifact, file_type: file_type, file_format: file_format) }
Loading
Loading
Loading
Loading
@@ -4874,7 +4874,6 @@ def create_build(pipeline, coverage, name)
subject { merge_request.enabled_reports[report_type] }
 
before do
stub_feature_flags(drop_license_management_artifact: false)
stub_licensed_features({ feature => true })
end
 
Loading
Loading
Loading
Loading
@@ -74,9 +74,6 @@
end
 
before_all do
# Test correctly behaviour of deprecated artifact because it can be still in use
stub_feature_flags(drop_license_management_artifact: false)
# Make sure that build has both `stage_id` and `stage` because FactoryBot
# can reset one of the fields when assigning another. We plan to deprecate
# and remove legacy `stage` column in the future.
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment