Class: Ci::PipelineArtifacts::CodeQualityMrDiffPresenter

Inherits:
Gitlab::View::Presenter::Delegated show all
Includes:
Gitlab::Utils::StrongMemoize
Defined in:
app/presenters/ci/pipeline_artifacts/code_quality_mr_diff_presenter.rb

Instance Method Summary collapse

Methods included from Gitlab::Utils::StrongMemoize

#clear_memoization, #strong_memoize, #strong_memoized?

Methods inherited from Gitlab::View::Presenter::Delegated

#initialize

Methods included from Gitlab::Utils::DelegatorOverride

#delegator_override, #delegator_override_with, #delegator_target, validator, validators, verify!

Methods included from Gitlab::View::Presenter::Base

#__subject__, #can?, #declarative_policy_delegate, #is_a?, #present, #url_builder, #web_path, #web_url

Methods included from Gitlab::Allowable

#can?

Methods included from Gitlab::Routing

add_helpers, includes_helpers, redirect_legacy_paths, url_helpers

Constructor Details

This class inherits a constructor from Gitlab::View::Presenter::Delegated

Instance Method Details

#for_files(merge_request) ⇒ Object


8
9
10
11
12
13
14
# File 'app/presenters/ci/pipeline_artifacts/code_quality_mr_diff_presenter.rb', line 8

def for_files(merge_request)
  filenames = merge_request.new_paths
  mr_diff_report = raw_report(merge_request.id)
  quality_files = mr_diff_report["files"]&.select { |key| filenames.include?(key) }

  { files: quality_files }
end