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 'app/presenters/ci')
-rw-r--r--app/presenters/ci/build_presenter.rb2
-rw-r--r--app/presenters/ci/build_runner_presenter.rb18
-rw-r--r--app/presenters/ci/pipeline_artifacts/code_coverage_presenter.rb2
-rw-r--r--app/presenters/ci/pipeline_artifacts/code_quality_mr_diff_presenter.rb25
-rw-r--r--app/presenters/ci/pipeline_presenter.rb3
5 files changed, 34 insertions, 16 deletions
diff --git a/app/presenters/ci/build_presenter.rb b/app/presenters/ci/build_presenter.rb
index 03cbb57eb84..51a81158f78 100644
--- a/app/presenters/ci/build_presenter.rb
+++ b/app/presenters/ci/build_presenter.rb
@@ -50,3 +50,5 @@ module Ci
end
end
end
+
+Ci::BuildPresenter.prepend_if_ee('EE::Ci::BuildPresenter')
diff --git a/app/presenters/ci/build_runner_presenter.rb b/app/presenters/ci/build_runner_presenter.rb
index ffa33dc9f15..dbb77143e2e 100644
--- a/app/presenters/ci/build_runner_presenter.rb
+++ b/app/presenters/ci/build_runner_presenter.rb
@@ -93,22 +93,10 @@ module Ci
end
def refspec_for_persistent_ref
- #
- # End-to-end test coverage for CI fetching seems to not be strong, so we
- # are using a feature flag here to close the confidence gap. My (JV)
- # confidence about the change is very high but if something is wrong
- # with it after all, this would cause all CI jobs on gitlab.com to fail.
- #
- # The roll-out will be tracked in
+ # Use persistent_ref.sha because it sometimes causes 'git fetch' to do
+ # less work. See
# https://gitlab.com/gitlab-com/gl-infra/scalability/-/issues/746.
- #
- if Feature.enabled?(:scalability_ci_fetch_sha, type: :ops)
- # Use persistent_ref.sha because it causes 'git fetch' to do less work.
- # See https://gitlab.com/gitlab-com/gl-infra/scalability/-/issues/746.
- "+#{pipeline.persistent_ref.sha}:#{pipeline.persistent_ref.path}"
- else
- "+#{pipeline.persistent_ref.path}:#{pipeline.persistent_ref.path}"
- end
+ "+#{pipeline.persistent_ref.sha}:#{pipeline.persistent_ref.path}"
end
def persistent_ref_exist?
diff --git a/app/presenters/ci/pipeline_artifacts/code_coverage_presenter.rb b/app/presenters/ci/pipeline_artifacts/code_coverage_presenter.rb
index 098e839132c..6312bd44118 100644
--- a/app/presenters/ci/pipeline_artifacts/code_coverage_presenter.rb
+++ b/app/presenters/ci/pipeline_artifacts/code_coverage_presenter.rb
@@ -2,7 +2,7 @@
module Ci
module PipelineArtifacts
- class CodeCoveragePresenter < ProcessablePresenter
+ class CodeCoveragePresenter < Gitlab::View::Presenter::Delegated
include Gitlab::Utils::StrongMemoize
def for_files(filenames)
diff --git a/app/presenters/ci/pipeline_artifacts/code_quality_mr_diff_presenter.rb b/app/presenters/ci/pipeline_artifacts/code_quality_mr_diff_presenter.rb
new file mode 100644
index 00000000000..2fe3104fe69
--- /dev/null
+++ b/app/presenters/ci/pipeline_artifacts/code_quality_mr_diff_presenter.rb
@@ -0,0 +1,25 @@
+# frozen_string_literal: true
+
+module Ci
+ module PipelineArtifacts
+ class CodeQualityMrDiffPresenter < Gitlab::View::Presenter::Delegated
+ include Gitlab::Utils::StrongMemoize
+
+ def for_files(filenames)
+ quality_files = raw_report["files"].select { |key| filenames.include?(key) }
+
+ { files: quality_files }
+ end
+
+ private
+
+ def raw_report
+ strong_memoize(:raw_report) do
+ self.each_blob do |blob|
+ Gitlab::Json.parse(blob).with_indifferent_access
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/app/presenters/ci/pipeline_presenter.rb b/app/presenters/ci/pipeline_presenter.rb
index f3bb63b31c3..0c68c33cbbe 100644
--- a/app/presenters/ci/pipeline_presenter.rb
+++ b/app/presenters/ci/pipeline_presenter.rb
@@ -11,6 +11,9 @@ module Ci
{ unknown_failure: 'Unknown pipeline failure!',
config_error: 'CI/CD YAML configuration error!',
external_validation_failure: 'External pipeline validation failed!',
+ activity_limit_exceeded: 'Pipeline activity limit exceeded!',
+ size_limit_exceeded: 'Pipeline size limit exceeded!',
+ job_activity_limit_exceeded: 'Pipeline job activity limit exceeded!',
deployments_limit_exceeded: 'Pipeline deployments limit exceeded!' }
end