Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/banzai/reference_parser')
-rw-r--r--lib/banzai/reference_parser/base_parser.rb5
-rw-r--r--lib/banzai/reference_parser/vulnerability_parser.rb16
2 files changed, 20 insertions, 1 deletions
diff --git a/lib/banzai/reference_parser/base_parser.rb b/lib/banzai/reference_parser/base_parser.rb
index c4d7e40b46c..3dfea8ee895 100644
--- a/lib/banzai/reference_parser/base_parser.rb
+++ b/lib/banzai/reference_parser/base_parser.rb
@@ -178,7 +178,10 @@ module Banzai
collection.where(id: to_query).each { |row| cache[row.id] = row }
end
- ids.uniq.map { |id| cache[id] }.compact
+ ids.each_with_object([]) do |id, array|
+ row = cache[id]
+ array << row if row
+ end
else
collection.where(id: ids)
end
diff --git a/lib/banzai/reference_parser/vulnerability_parser.rb b/lib/banzai/reference_parser/vulnerability_parser.rb
new file mode 100644
index 00000000000..143f2605927
--- /dev/null
+++ b/lib/banzai/reference_parser/vulnerability_parser.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+module Banzai
+ module ReferenceParser
+ # The actual parser is implemented in the EE mixin
+ class VulnerabilityParser < IssuableParser
+ self.reference_type = :vulnerability
+
+ def records_for_nodes(_nodes)
+ {}
+ end
+ end
+ end
+end
+
+Banzai::ReferenceParser::VulnerabilityParser.prepend_if_ee('::EE::Banzai::ReferenceParser::VulnerabilityParser')