Commit c7fef435 authored by Avielle Wolfe's avatar Avielle Wolfe Committed by Bob Van Landuyt

Move Vulnerable out of EE module

It doesn't need to be there since it doesn't exist in CE,
and it lets us avoid overriding Rubocop's dislike for EE
modules being required inside classes.
parent 63804884
# frozen_string_literal: true
module EE
module Vulnerable
extend ActiveSupport::Concern
def latest_vulnerabilities
Vulnerabilities::Occurrence
.for_pipelines(all_pipelines.with_vulnerabilities.latest_successful_ids_per_project)
end
def latest_vulnerabilities_with_sha
Vulnerabilities::Occurrence
.for_pipelines_with_sha(all_pipelines.with_vulnerabilities.latest_successful_ids_per_project)
end
def all_vulnerabilities
Vulnerabilities::Occurrence
.for_pipelines(all_pipelines.with_vulnerabilities.success)
end
end
end
# frozen_string_literal: true
module Vulnerable
def latest_vulnerabilities
Vulnerabilities::Occurrence
.for_pipelines(all_pipelines.with_vulnerabilities.latest_successful_ids_per_project)
end
def latest_vulnerabilities_with_sha
Vulnerabilities::Occurrence
.for_pipelines_with_sha(all_pipelines.with_vulnerabilities.latest_successful_ids_per_project)
end
def all_vulnerabilities
Vulnerabilities::Occurrence
.for_pipelines(all_pipelines.with_vulnerabilities.success)
end
end
......@@ -10,7 +10,7 @@ module EE
extend ::Gitlab::Utils::Override
prepended do
include ::EE::Vulnerable # rubocop: disable Cop/InjectEnterpriseEditionModule
include Vulnerable
include TokenAuthenticatable
include InsightsFeature
......
......@@ -3,7 +3,7 @@ require 'spec_helper'
describe Group do
let(:group) { create(:group) }
it_behaves_like EE::Vulnerable
it_behaves_like Vulnerable
it { is_expected.to include_module(EE::Group) }
describe 'associations' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
shared_examples_for EE::Vulnerable do
shared_examples_for Vulnerable do
let(:project) { create(:project, namespace: group) }
let(:external_project) { create(:project) }
let(:failed_pipeline) { create(:ci_pipeline, :failed, project: 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