Class: Ci::DailyBuildGroupReportResultsFinder

Inherits:
Object
  • Object
show all
Includes:
Gitlab::Allowable
Defined in:
app/finders/ci/daily_build_group_report_results_finder.rb

Constant Summary collapse

MAX_ITEMS =
1_000
REPORT_WINDOW =
90.days
DATE_FORMAT_ALLOWED =
'%Y-%m-%d'

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Gitlab::Allowable

#can?

Constructor Details

#initialize(params: {}, current_user: nil) ⇒ DailyBuildGroupReportResultsFinder

Returns a new instance of DailyBuildGroupReportResultsFinder.


29
30
31
32
# File 'app/finders/ci/daily_build_group_report_results_finder.rb', line 29

def initialize(params: {}, current_user: nil)
  @params = params
  @current_user = current_user
end

Instance Attribute Details

#current_userObject (readonly)

Returns the value of attribute current_user.


27
28
29
# File 'app/finders/ci/daily_build_group_report_results_finder.rb', line 27

def current_user
  @current_user
end

#paramsObject (readonly)

Returns the value of attribute params.


27
28
29
# File 'app/finders/ci/daily_build_group_report_results_finder.rb', line 27

def params
  @params
end

Instance Method Details

#executeObject


34
35
36
37
38
39
# File 'app/finders/ci/daily_build_group_report_results_finder.rb', line 34

def execute
  return Ci::DailyBuildGroupReportResult.none unless query_allowed?

  collection = Ci::DailyBuildGroupReportResult.by_projects(params[:project])
  filter_report_results(collection)
end