summaryrefslogtreecommitdiff
path: root/app/presenters
diff options
context:
space:
mode:
Diffstat (limited to 'app/presenters')
-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
-rw-r--r--app/presenters/dev_ops_report/metric_presenter.rb (renamed from app/presenters/dev_ops_score/metric_presenter.rb)0
-rw-r--r--app/presenters/gitlab/whats_new/item_presenter.rb22
-rw-r--r--app/presenters/project_presenter.rb4
8 files changed, 36 insertions, 40 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
diff --git a/app/presenters/dev_ops_score/metric_presenter.rb b/app/presenters/dev_ops_report/metric_presenter.rb
index e7363293435..e7363293435 100644
--- a/app/presenters/dev_ops_score/metric_presenter.rb
+++ b/app/presenters/dev_ops_report/metric_presenter.rb
diff --git a/app/presenters/gitlab/whats_new/item_presenter.rb b/app/presenters/gitlab/whats_new/item_presenter.rb
deleted file mode 100644
index 9f66e19ade0..00000000000
--- a/app/presenters/gitlab/whats_new/item_presenter.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module WhatsNew
- class ItemPresenter
- DICTIONARY = {
- core: 'Free',
- starter: 'Bronze',
- premium: 'Silver',
- ultimate: 'Gold'
- }.freeze
-
- def self.present(item)
- if Gitlab.com?
- item['packages'] = item['packages'].map { |p| DICTIONARY[p.downcase.to_sym] }
- end
-
- item
- end
- end
- end
-end
diff --git a/app/presenters/project_presenter.rb b/app/presenters/project_presenter.rb
index 55b550d8544..e13ef7a3811 100644
--- a/app/presenters/project_presenter.rb
+++ b/app/presenters/project_presenter.rb
@@ -17,7 +17,7 @@ class ProjectPresenter < Gitlab::View::Presenter::Delegated
MAX_TOPICS_TO_SHOW = 3
def statistic_icon(icon_name = 'plus-square-o')
- sprite_icon(icon_name, css_class: 'icon gl-mr-2')
+ sprite_icon(icon_name, css_class: 'icon gl-mr-2 gl-text-gray-500')
end
def statistics_anchors(show_auto_devops_callout:)
@@ -239,7 +239,7 @@ class ProjectPresenter < Gitlab::View::Presenter::Delegated
AnchorData.new(false,
statistic_icon + _('New file'),
new_file_path,
- 'missing')
+ 'dashed')
end
end