gitlab-org--gitlab-foss/spec
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
..
bin
config
controllers Limit the number of pipelines to count 2018-05-17 13:52:59 +02:00
db/production Enable prometheus metrics by default 2018-05-07 08:46:23 +00:00
factories Backport cluster factory changes from EE 2018-05-13 12:36:51 +02:00
features Resolve "Opening Project with invite but without accepting leads to 404 error page" 2018-05-17 09:19:47 +00:00
finders show only groups an admin is a member of in dashboards/grops 2018-05-01 09:24:21 +00:00
fixtures Adjust board lists header text color 2018-05-14 19:05:20 -03:00
helpers Adjust spec to build correct path when storage path ends in slash 2018-05-09 12:56:03 +02:00
initializers Remove method call to deprecated method 2018-05-11 08:57:06 +02:00
javascripts Merge branch '45462-sha-object' into 'master' 2018-05-14 09:54:28 +00:00
lib Preload pipeline data for project pipelines 2018-05-17 13:53:00 +02:00
mailers Resolve "Opening Project with invite but without accepting leads to 404 error page" 2018-05-17 09:19:47 +00:00
migrations Add a unique and not null constraint on the project_features.project_id column 2018-05-15 14:20:14 +02:00
models Preload pipeline data for project pipelines 2018-05-17 13:53:00 +02:00
policies Enable update_(build|pipeline) for maintainers 2018-05-15 08:18:22 +00:00
presenters Only show push-to-master authorized users 2018-04-24 13:59:41 +02:00
requests Allow admin to assign shared runner to project through API 2018-05-16 10:52:28 +02:00
routing
rubocop/cop Revert the addition of goldiloader 2018-04-18 15:51:39 +02:00
serializers Enable update_(build|pipeline) for maintainers 2018-05-15 08:18:22 +00:00
services Merge branch 'ce-5968-extract-ee-specific-files-lines-for-clusters-related-files' into 'master' 2018-05-15 08:59:09 +00:00
sidekiq/cron
support Delete remote uploads 2018-05-16 08:58:07 +02:00
tasks Gitlab::Shell works on shard name, not path 2018-04-25 13:36:22 +02:00
unicorn
uploaders apply feedback 2018-05-09 19:57:08 +00:00
validators
views Project Sidebar: Split CI/CD into CI/CD and Operations 2018-05-16 11:16:33 +00:00
workers Merge branch '42099-port-push-mirroring-to-ce-ce-port-v-2' into 'master' 2018-05-07 15:15:57 +00:00
factories_spec.rb
fast_spec_helper.rb Improve fast specs helper to autoload the library 2018-05-11 13:33:10 +02:00
rails_helper.rb
rake_helper.rb
simplecov_env.rb
spec_helper.rb Support resetting of Prometheus metrics between test runs 2018-05-09 14:33:42 -07:00