gitlab-org--gitlab-foss/spec/lib
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
..
api Validate project path prior to hitting the database. 2018-04-13 15:59:45 +02:00
backup Bump Gitaly to 0.98.0 2018-05-07 14:10:04 +02:00
banzai Fix commit trailer rendering when Gravatar is disabled 2018-04-25 17:32:51 +02:00
bitbucket
constraints [CE] Add Naming/FileName rule checking expected class/module per filename 2018-03-08 12:56:54 +00:00
container_registry
gitaly Gitaly Server info for admin panel 2018-01-31 08:54:45 +01:00
gitlab Preload pipeline data for project pipelines 2018-05-17 13:53:00 +02:00
google_api Modify cluster creation API method to enable legacy_apac as default 2018-02-22 15:27:56 -06:00
json_web_token
mattermost Merge branch 'fj-15329-services-callbacks-ssrf' into 'security-10-6' 2018-03-21 14:39:21 +00:00
microsoft_teams
omni_auth/strategies Adds spec for omni_auth jwt strategy 2018-04-26 17:03:09 +01:00
rspec_flaky Improve the architecture of RspecFlaky classes by introducing a new RspecFlaky::Report class 2018-04-10 15:38:40 +02:00
system_check
additional_email_headers_interceptor_spec.rb
after_commit_queue_spec.rb
disable_email_interceptor_spec.rb
event_filter_spec.rb
expand_variables_spec.rb
extracts_path_spec.rb
feature_spec.rb
file_size_validator_spec.rb fix specs 2018-02-02 09:28:15 -05:00
forever_spec.rb Handle limit for datetime attributes on MySQL 2018-04-06 22:28:44 -05:00
gitlab_spec.rb Move Settings to its own file, isolate it from Rails and introduce Gitlab.root 2018-04-23 12:20:30 +02:00
milestone_array_spec.rb
system_check_spec.rb
uploaded_file_spec.rb Add direct_upload setting for artifacts 2018-04-05 15:01:14 +02:00