Skip to content
Snippets Groups Projects
Commit 65126746 authored by Alex Ives's avatar Alex Ives :speech_balloon:
Browse files

Add support for tfplan.json report

Added support for `terraform` report type in ci yml. This is a special
json file added as a part of !26830
to handle showing terraform results in merge requests

Relates to #207527
parent 36c6c71f
No related branches found
No related tags found
No related merge requests found
......@@ -31,7 +31,8 @@ class JobArtifact < ApplicationRecord
metrics: 'metrics.txt',
lsif: 'lsif.json',
dotenv: '.env',
cobertura: 'cobertura-coverage.xml'
cobertura: 'cobertura-coverage.xml',
terraform: 'tfplan.json'
}.freeze
INTERNAL_TYPES = {
......@@ -59,7 +60,8 @@ class JobArtifact < ApplicationRecord
dast: :raw,
license_management: :raw,
license_scanning: :raw,
performance: :raw
performance: :raw,
terraform: :raw
}.freeze
TYPE_AND_FORMAT_PAIRS = INTERNAL_TYPES.merge(REPORT_TYPES).freeze
......@@ -129,7 +131,8 @@ class JobArtifact < ApplicationRecord
network_referee: 14, ## runner referees
lsif: 15, # LSIF data for code navigation
dotenv: 16,
cobertura: 17
cobertura: 17,
terraform: 18 # Transformed json
}
enum file_format: {
......
---
title: Add support for tfplan.json report
merge_request: 27148
author:
type: added
......@@ -14,7 +14,7 @@ class Reports < ::Gitlab::Config::Entry::Node
ALLOWED_KEYS =
%i[junit codequality sast dependency_scanning container_scanning
dast performance license_management license_scanning metrics lsif
dotenv cobertura].freeze
dotenv cobertura terraform].freeze
attributes ALLOWED_KEYS
......@@ -36,6 +36,7 @@ class Reports < ::Gitlab::Config::Entry::Node
validates :lsif, array_of_strings_or_string: true
validates :dotenv, array_of_strings_or_string: true
validates :cobertura, array_of_strings_or_string: true
validates :terraform, array_of_strings_or_string: true
end
end
......
......@@ -46,6 +46,7 @@
:lsif | 'lsif.json'
:dotenv | 'build.dotenv'
:cobertura | 'cobertura-coverage.xml'
:terraform | 'tfplan.json'
end
with_them do
......
......@@ -34,6 +34,7 @@
job_artifacts_container_scanning job_artifacts_dast
job_artifacts_license_management job_artifacts_license_scanning
job_artifacts_performance job_artifacts_lsif
job_artifacts_performance job_artifacts_terraform
job_artifacts_codequality job_artifacts_metrics scheduled_at
job_variables waiting_for_resource_at job_artifacts_metrics_referee
job_artifacts_network_referee job_artifacts_dotenv
......
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