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/gitlab/ci/parsers/security/concerns/deprecated_syntax.rb')
-rw-r--r--lib/gitlab/ci/parsers/security/concerns/deprecated_syntax.rb36
1 files changed, 36 insertions, 0 deletions
diff --git a/lib/gitlab/ci/parsers/security/concerns/deprecated_syntax.rb b/lib/gitlab/ci/parsers/security/concerns/deprecated_syntax.rb
new file mode 100644
index 00000000000..24613a441be
--- /dev/null
+++ b/lib/gitlab/ci/parsers/security/concerns/deprecated_syntax.rb
@@ -0,0 +1,36 @@
+# frozen_string_literal: true
+
+module Gitlab
+ module Ci
+ module Parsers
+ module Security
+ module Concerns
+ module DeprecatedSyntax
+ extend ActiveSupport::Concern
+
+ included do
+ extend ::Gitlab::Utils::Override
+
+ override :parse_report
+ end
+
+ def report_data
+ @report_data ||= begin
+ data = super
+
+ if data.is_a?(Array)
+ data = {
+ "version" => self.class::DEPRECATED_REPORT_VERSION,
+ "vulnerabilities" => data
+ }
+ end
+
+ data
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+end