Commit Graph

556 Commits

Author SHA1 Message Date
Shinya Maeda 32f825c648 Add tests for each new code 2018-06-06 17:49:48 +09:00
Grzegorz Bizon 809a50fcbf Merge branch 'master' into 'backstage/gb/use-persisted-stages-to-improve-pipelines-table'
Conflicts:
   app/models/ci/pipeline.rb
2018-06-05 07:39:59 +00:00
Shinya Maeda eb05d475b7 Fix wording in spec. Add PIPELINE_IID in examples of debugged variables in documants. 2018-06-04 12:12:02 +09:00
Shinya Maeda e8ecae7e0b Reveert build_relations and simply add a line for creating iid 2018-06-02 11:55:42 +09:00
Shinya Maeda c89e57842e Use shared examples for populate spec 2018-06-01 15:46:15 +09:00
Shinya Maeda c418d68765 Remove unneccesary spec 2018-06-01 15:41:33 +09:00
Shinya Maeda f7f60ab54a Add spec for variables expressions with pipeline iid 2018-06-01 14:53:00 +09:00
Shinya Maeda 4beeb60255 Fix populate_spec 2018-06-01 14:36:52 +09:00
Shinya Maeda 0e22b50df8 Add spec for variables expression 2018-05-30 16:42:55 +09:00
Grzegorz Bizon 1af2274b41 Restore lazy loading of pipeline commits in preloader 2018-05-25 13:45:08 +02:00
Grzegorz Bizon dab3ae39a2 Do not paginate pipelines active relation twice 2018-05-23 13:29:21 +02:00
Grzegorz Bizon f89f232d19 Simplify pipelines preloader implementation 2018-05-23 10:22:28 +02:00
Grzegorz Bizon ea35fd05bb Refactor pipeline preloader to split reponsibilities better 2018-05-22 13:55:05 +02:00
Shinya Maeda 8e92e25b62 Remvoe disable_ddl_transaction! and redandant RecordNotUnique exception rescue 2018-05-22 15:21:45 +09:00
Shinya Maeda f61666c0d7 Merge branch 'master' into per-project-pipeline-iid 2018-05-22 14:32:40 +09:00
Kamil Trzciński 46d5ab68b7 Merge branch 'feature/gb/add-regexp-variables-expression' into 'master'
Add support for variables expression regexp syntax

Closes #43601

See merge request gitlab-org/gitlab-ce!18902
2018-05-18 12:08:12 +00:00
Grzegorz Bizon af9b0bfbae Simplify untrusted regexp factory method 2018-05-18 10:14:10 +02:00
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
Grzegorz Bizon 61d55b56ab Update variables expressions statement specs 2018-05-17 12:55:19 +02:00
Grzegorz Bizon 8b3e21b66b Add variables expression pattern validation support 2018-05-17 12:44:46 +02:00
Grzegorz Bizon a1f1e08670 Add anti-corruption layer above expressions pattern matching 2018-05-17 12:35:20 +02:00
Grzegorz Bizon f52de2f73c Make variables expression pattern case-sensitivity explicit 2018-05-15 15:18:18 +02:00
Grzegorz Bizon 7babc59e47 Use parameterized RSpec to improve variables expressions specs 2018-05-15 13:15:38 +02:00
Grzegorz Bizon 65f4e7b2a1 Add support for pattern matching in variables expressions 2018-05-15 13:04:18 +02:00
Grzegorz Bizon 475d2edf04 Reorganize exceptions in pipeline expressions module 2018-05-15 12:37:09 +02:00
Grzegorz Bizon f16f2b5994 Add pattern matching variables expression lexeme 2018-05-14 15:03:10 +02:00
Grzegorz Bizon ac65257c40 Raise variables statement exception if pattern is invalid 2018-05-14 14:38:08 +02:00
Grzegorz Bizon b784a985f2 Do not raise if variable expression can not be evaluated 2018-05-14 14:27:07 +02:00
Grzegorz Bizon 8b736c91fc Implement variables expression untrusted pattern lexeme 2018-05-11 13:29:05 +02:00
Shinya Maeda a74184eb5e Fix static analysys 2018-05-11 16:52:48 +09:00
Shinya Maeda 46fa3089c8 Rescue RecordNotUnique when pipeline is created with non-unique iid 2018-05-11 16:49:18 +09:00
Shinya Maeda 1f39fcd112 Merge branch 'master' into live-trace-v2 2018-05-07 11:59:43 +09:00
Shinya Maeda e1ad8ca6d0 Test trace_spec on both conditions - ci_enable_live_trace is on/off 2018-05-04 19:49:26 +09:00
Matija Čupić c6e394bb84
Improve variable comparison 2018-05-04 12:35:36 +02:00
Shinya Maeda 30464bceaa Merge branch 'master' into live-trace-v2 2018-05-03 14:21:06 +09:00
Matija Čupić fc42ba6c5d
Merge branch 'master' into 44059-specify-variables-when-executing-a-manual-pipeline-from-the-ui 2018-05-02 15:54:06 +02:00
Grzegorz Bizon 0fd0b64be6 Use stages position column to track stage index 2018-05-01 14:30:44 +02:00
Grzegorz Bizon b337a086d5 Merge branch 'master' into backstage/gb/migrate-pipeline-stages-index
* master: (106 commits)
2018-05-01 14:24:39 +02:00
Jose d3327e0dfa Merge branch 'master' into 44059-specify-variables-when-executing-a-manual-pipeline-from-the-ui 2018-04-30 17:00:16 -05:00
Shinya Maeda 0a4e57f3d7 Merge branch 'master' into live-trace-v2 2018-04-27 23:11:15 +09:00
Shinya Maeda 9d6fe7bfdf Refactoring ci_job_trace to ci_build_trace 2018-04-26 15:06:04 +09:00
Shinya Maeda 4eb67ccff3 Merge branch 'master' into live-trace-v2 2018-04-26 14:23:36 +09:00
Grzegorz Bizon 37b9a441c1 Merge branch 'master' into 'backstage/gb/migrate-pipeline-stages-index'
# Conflicts:
#   db/schema.rb
2018-04-25 13:40:13 +00:00
Grzegorz Bizon e4d6984465 Do not save associated records for pipeline builds twice 2018-04-25 13:35:40 +02:00
Grzegorz Bizon c9dc51111d Rename stage index column name to priority column 2018-04-24 15:48:10 +02:00
Bob Van Landuyt 35a49922e6 Allow admins to push to empty repos 2018-04-24 14:06:59 +02:00
Grzegorz Bizon cae3092f23 Fix specs creating a pipeline stage with implicit index 2018-04-24 11:07:37 +02:00
Grzegorz Bizon f0d59b95f1 Validate presence of a stage index in the model 2018-04-24 11:07:37 +02:00
Shinya Maeda 8a7654a52b Fix statis analysys 2018-04-23 15:20:55 +09:00
Matija Čupić 317477fc67
Extend Gitlab::Ci::Pipeline::Chain::Command with variables_attributes 2018-04-18 19:28:59 +02:00