gitlab-ce/lib/gitlab/ci
Yorick Peterse 19428e8008
Preload pipeline data for project pipelines
When displaying the pipelines of a project we now preload the following
data:

1. Authors of the commits that belong to these pipelines
2. The number of warnings per pipeline, which is used by
   Ci::Pipeline#has_warnings?

== Commit Authors

Previously this data was queried for every Commit separately, leading to
20 SQL queries being executed in the worst case. With an average of 3 to
5 milliseconds per SQL query this could result in 100 milliseconds being
spent in _just_ getting Commit authors.

To preload this data Commit#author now uses BatchLoader (through
Commit#lazy_author), and a separate module
Gitlab::Ci::Pipeline::Preloader is used to ensure all authors are loaded
before they are used.

== Number of warnings

This changes Ci::Pipeline#has_warnings? so it supports preloading of the
number of warnings per pipeline. This removes the need for executing a
COUNT(*) query for every pipeline just to see if it has any warnings or
not.
2018-05-17 13:53:00 +02:00
..
build Fix build variables policy after renaming methods 2018-03-30 11:29:05 +02:00
config Do not raise when validating variables expression 2018-03-27 14:46:58 +02:00
pipeline Preload pipeline data for project pipelines 2018-05-17 13:53:00 +02:00
status Merge branch 'fix/gb/fix-pipeline-statuses-illustrations' into 'master' 2018-04-12 07:54:48 +00:00
trace Merge branch 'live-trace-v2' into live-trace-v2-efficient-destroy-all 2018-05-02 14:46:57 +09:00
variables Fix file-specific variables collection item option 2018-04-11 10:07:15 +02:00
ansi2html.rb Adds Rubocop rule for line break around conditionals 2018-01-11 16:34:01 +00:00
charts.rb CI charts now include the current day 2018-03-06 17:01:26 +01:00
config.rb Changes ci/lints controller to use authorize before action 2018-03-26 17:03:12 -06:00
cron_parser.rb [Rails5] Fix TZInfo::InvalidTimezoneIdentifier exception 2018-04-29 10:10:36 +11:00
mask_secret.rb
model.rb
trace.rb Merge branch 'live-trace-v2-efficient-destroy-all' into 'master' 2018-05-07 12:01:32 +00:00
yaml_processor.rb Make ci/lint page context aware: 2018-03-26 17:03:11 -06:00