Commit Graph

147 Commits

Author SHA1 Message Date
GitLab Bot ed7568cc80 Add latest changes from gitlab-org/gitlab@master 2020-10-16 09:09:06 +00:00
GitLab Bot 7dc8bd3c16 Add latest changes from gitlab-org/gitlab@master 2020-09-15 21:09:35 +00:00
GitLab Bot 4fa04f789e Add latest changes from gitlab-org/gitlab@master 2020-09-02 12:10:35 +00:00
GitLab Bot 202268ad93 Add latest changes from gitlab-org/gitlab@master 2020-08-21 09:10:08 +00:00
GitLab Bot 325318e2dd Add latest changes from gitlab-org/gitlab@master 2020-08-17 09:10:08 +00:00
GitLab Bot 80ddaef34d Add latest changes from gitlab-org/gitlab@master 2020-08-12 00:09:52 +00:00
GitLab Bot db73de5d6d Add latest changes from gitlab-org/gitlab@master 2020-08-07 21:10:07 +00:00
GitLab Bot 7dc3246696 Add latest changes from gitlab-org/gitlab@master 2020-07-07 00:08:58 +00:00
GitLab Bot ce06ce825b Add latest changes from gitlab-org/gitlab@master 2020-07-06 15:08:42 +00:00
GitLab Bot 901af2a0dd Add latest changes from gitlab-org/gitlab@master 2020-06-23 18:09:28 +00:00
GitLab Bot e829ca213b Add latest changes from gitlab-org/gitlab@master 2020-06-22 15:09:27 +00:00
GitLab Bot 908a54b624 Add latest changes from gitlab-org/gitlab@master 2020-06-05 21:08:27 +00:00
GitLab Bot 8b0ef13236 Add latest changes from gitlab-org/gitlab@master 2020-06-03 18:08:28 +00:00
GitLab Bot c9d79ef3b5 Add latest changes from gitlab-org/gitlab@master 2020-05-26 15:08:17 +00:00
GitLab Bot 0d8e625e4c Add latest changes from gitlab-org/gitlab@master 2020-05-25 15:07:58 +00:00
GitLab Bot 8f306a7dc5 Add latest changes from gitlab-org/gitlab@master 2020-05-21 06:08:25 +00:00
GitLab Bot 1e9d859394 Add latest changes from gitlab-org/gitlab@master 2020-05-15 06:08:40 +00:00
GitLab Bot 0e65189f85 Add latest changes from gitlab-org/gitlab@master 2020-05-13 09:08:37 +00:00
GitLab Bot 2c15256184 Add latest changes from gitlab-org/gitlab@master 2020-05-13 06:08:02 +00:00
GitLab Bot d4f8f25db6 Add latest changes from gitlab-org/gitlab@master 2020-05-07 00:11:11 +00:00
GitLab Bot e33f87ac0f Add latest changes from gitlab-org/gitlab@master 2020-04-21 15:21:10 +00:00
GitLab Bot 254ec28f54 Add latest changes from gitlab-org/gitlab@master 2020-04-09 21:09:19 +00:00
GitLab Bot 42f41de465 Add latest changes from gitlab-org/gitlab@master 2020-04-03 06:09:14 +00:00
GitLab Bot abae8f34f3 Add latest changes from gitlab-org/gitlab@master 2020-03-31 21:08:05 +00:00
GitLab Bot 116d4e56e8 Add latest changes from gitlab-org/gitlab@master 2020-03-26 06:08:40 +00:00
GitLab Bot 154b9bae14 Add latest changes from gitlab-org/gitlab@master 2020-03-17 21:09:16 +00:00
GitLab Bot cd52759ee3 Add latest changes from gitlab-org/gitlab@master 2020-03-12 12:09:17 +00:00
GitLab Bot ac1dca43ba Add latest changes from gitlab-org/gitlab@master 2020-03-09 12:07:45 +00:00
GitLab Bot cefe554b7c Add latest changes from gitlab-org/gitlab@master 2020-02-18 06:09:06 +00:00
GitLab Bot 1078b7bf25 Add latest changes from gitlab-org/gitlab@master 2020-02-11 09:08:39 +00:00
GitLab Bot 7351a484d7 Add latest changes from gitlab-org/gitlab@master 2020-02-10 12:08:59 +00:00
GitLab Bot 0c6bc5443a Add latest changes from gitlab-org/gitlab@master 2020-02-07 21:08:39 +00:00
GitLab Bot db24ab2b72 Add latest changes from gitlab-org/gitlab@master 2020-01-28 12:08:44 +00:00
GitLab Bot e3e300557f Add latest changes from gitlab-org/gitlab@master 2020-01-08 12:07:59 +00:00
GitLab Bot ac9d41902b Add latest changes from gitlab-org/gitlab@master 2019-12-24 15:07:44 +00:00
GitLab Bot 8723197387 Add latest changes from gitlab-org/gitlab@master 2019-12-05 12:07:43 +00:00
GitLab Bot 4e516dbff9 Add latest changes from gitlab-org/gitlab@master 2019-11-13 12:06:22 +00:00
GitLab Bot b3e4ec8e8a Add latest changes from gitlab-org/gitlab@master 2019-10-23 09:06:03 +00:00
GitLab Bot 914ea32e0e Add latest changes from gitlab-org/gitlab@master 2019-10-16 09:07:51 +00:00
GitLab Bot 77a7772c3b Add latest changes from gitlab-org/gitlab@master 2019-10-08 09:06:09 +00:00
GitLab Bot 587794b4b8 Add latest changes from gitlab-org/gitlab@master 2019-10-02 00:06:26 +00:00
Alex Ives 3e2b45870a Issue #39099: Add links for latest pipelines 2019-08-22 08:49:40 -05:00
Matija Čupić ae7f5faf67
Improve nplusone spec for PipelinesController#show 2019-08-19 21:02:28 +02:00
gfyoung 93a44e135b Add some frozen string to spec/**/*.rb
Adds frozen string to the following:

* spec/bin/**/*.rb
* spec/config/**/*.rb
* spec/controllers/**/*.rb

xref https://gitlab.com/gitlab-org/gitlab-ce/issues/59758
2019-04-15 10:17:05 +00:00
Stan Hu f2fa7c3299 Fix and expand Gitaly FindCommit caching
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/26248 added
support for deduplicating FindCommit requests using Gitaly ref name
caching. However, not all endpoints were covered, and in one case the
Gitaly wrapper wasn't actually surrounding the serialization step. We
can safely cache ref names between FindCommit calls for #index and #show
endpoints for merge requests and pipelines. This can significantly
reduce the number of FindCommit requests.
2019-04-04 13:42:58 -07:00
Stan Hu e37383d453 Cache FindCommit results in pipelines view
For each pipeline, the controller will call `Pipeline#latest?` to
determine if the pipeline's ref is the latest for that branch.
Since it's likely that the same branches are being used in each
pipeline, we can reduce Gitaly overhead by caching the results
of the FindCommit call.
2019-04-02 04:15:32 -07:00
Kamil Trzciński d4c7214799
[master] Pipelines section is available to unauthorized users 2019-01-31 16:52:50 +01:00
Rémy Coutable 3a2abc1d50
Enable the Layout/ExtraSpacing cop
Signed-off-by: Rémy Coutable <remy@rymai.me>
2019-01-24 13:05:45 +01:00
blackst0ne b44a2c801a Update specs to rails5 format
Updates specs to use new rails5 format.

The old format:
`get :show, { some: params }, { some: headers }`

The new format:
`get :show, params: { some: params }, headers: { some: headers }`
2018-12-19 10:04:31 +11:00
Michael Kozono 3640292bf2 Cache `Repository#exists?` false in RequestStore
* Only truthy values are cached in Redis.
* All values are cached in RequestStore and in an instance variable.
2018-09-27 18:22:37 -07:00
Steve Azzopardi c80abb40fc
Add retried jobs to pipeline stages
closes https://gitlab.com/gitlab-org/gitlab-ce/issues/50461
2018-09-13 17:31:52 +02:00
Yorick Peterse 7a233b37cd
Remove code for dynamically generating routes
This adds a database migration that creates routes for any projects and
namespaces that don't already have one. We also remove the runtime code
for dynamically creating routes, as this is no longer necessary.
2018-07-25 16:41:29 +02:00
Rémy Coutable b7b3a059f9
Allow 2 more queries in spec/controllers/projects/pipelines_controller_spec.rb
Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-07-05 13:28:46 +02:00
Bob Van Landuyt 04b046587f Add pipeline lists to GraphQL
This adds Keyset pagination to GraphQL lists. PoC for that is
pipelines on merge requests and projects.

When paginating a list, the base-64 encoded id of the ordering
field (in most cases the primary key) can be passed in the `before` or
`after` GraphQL argument.
2018-07-04 10:53:39 +02:00
Douwe Maan 290ca339ad Merge branch 'feature/customizable-favicon' into 'master'
Customizable favicon

Closes #15661

See merge request gitlab-org/gitlab-ce!14497
2018-06-07 16:54:41 +00:00
Alexis Reigel 949c30d42b
remove all .ico favicon variations, use png always
the ci status icons are generated client side, wo we don't need the
static files anymore.
2018-06-05 16:20:22 +02:00
Grzegorz Bizon 3662f14769 Improve specs for pipelines controller 2018-05-29 17:19:39 +02:00
Grzegorz Bizon bc9a0e10b5 Reduce amount of expected pipeline serialization queries in specs 2018-05-23 14:22:22 +02:00
Grzegorz Bizon dab3ae39a2 Do not paginate pipelines active relation twice 2018-05-23 13:29:21 +02:00
Grzegorz Bizon 0b3cca568d Fix rubocop offense in pipeline controller specs 👮 2018-05-22 14:38:25 +02:00
Grzegorz Bizon ea35fd05bb Refactor pipeline preloader to split reponsibilities better 2018-05-22 13:55:05 +02:00
Grzegorz Bizon 76a7157c76 Abstract persisted/legacy stages in pipeline model 2018-05-22 13:04:07 +02:00
Grzegorz Bizon 6c63f96e0a Preload number of warnings in every stage in a pipeline
This makes it possible to avoid N+1 queries when loading pipelines
table.
2018-05-22 12:30:45 +02:00
Grzegorz Bizon 631bd9bf08 Use persisted stages to load pipelines index table 2018-05-21 15:13:32 +02:00
Yorick Peterse 878ca2e69b
Exclude coverage data from the pipelines page
When displaying a project's pipelines
(Projects::PipelinesController#index) we now exclude the coverage data.
This data was not used by the frontend, yet getting it would require one
SQL query per pipeline. These queries in turn could be quite expensive
on GitLab.com.
2018-05-17 13:53:00 +02:00
Yorick Peterse 70985aa19b
Limit the number of pipelines to count
When displaying the project pipelines dashboard we display a few tabs
for different pipeline states. For every such tab we count the number of
pipelines that belong to it. For large projects such as GitLab CE this
means having to count over 80 000 rows, which can easily take between 70
and 100 milliseconds per query.

To improve this we apply a technique we already use for search results:
we limit the number of rows to count. The current limit is 1000, which
means that if more than 1000 rows are present for a state we will show
"1000+" instead of the exact number. The SQL queries used for this
perform much better than a regular COUNT, even when a project has a lot
of pipelines.

Prior to these changes we would end up running a query like this:

    SELECT COUNT(*)
    FROM ci_pipelines
    WHERE project_id = 13083
    AND status IN ('success', 'failed', 'canceled')

This would produce a plan along the lines of the following:

    Aggregate  (cost=3147.55..3147.56 rows=1 width=8) (actual time=501.413..501.413 rows=1 loops=1)
      Buffers: shared hit=17116 read=861 dirtied=2
      ->  Index Only Scan using index_ci_pipelines_on_project_id_and_ref_and_status_and_id on ci_pipelines  (cost=0.56..2984.14 rows=65364 width=0) (actual time=0.095..490.263 rows=80388 loops=1)
            Index Cond: (project_id = 13083)
            Filter: ((status)::text = ANY ('{success,failed,canceled}'::text[]))
            Rows Removed by Filter: 2894
            Heap Fetches: 353
            Buffers: shared hit=17116 read=861 dirtied=2
    Planning time: 1.409 ms
    Execution time: 501.519 ms

Using the LIMIT count technique we instead run the following query:

    SELECT COUNT(*)
    FROM (
        SELECT 1
        FROM ci_pipelines
        WHERE project_id = 13083
        AND status IN ('success', 'failed', 'canceled')
        LIMIT 1001
    ) for_count

This query produces the following plan:

    Aggregate  (cost=58.77..58.78 rows=1 width=8) (actual time=1.726..1.727 rows=1 loops=1)
      Buffers: shared hit=169 read=15
      ->  Limit  (cost=0.56..46.25 rows=1001 width=4) (actual time=0.164..1.570 rows=1001 loops=1)
            Buffers: shared hit=169 read=15
            ->  Index Only Scan using index_ci_pipelines_on_project_id_and_ref_and_status_and_id on ci_pipelines  (cost=0.56..2984.14 rows=65364 width=4) (actual time=0.162..1.426 rows=1001 loops=1)
                  Index Cond: (project_id = 13083)
                  Filter: ((status)::text = ANY ('{success,failed,canceled}'::text[]))
                  Rows Removed by Filter: 9
                  Heap Fetches: 10
                  Buffers: shared hit=169 read=15
    Planning time: 1.832 ms
    Execution time: 1.821 ms

While this query still uses a Filter for the "status" field the number
of rows that it may end up filtering (at most 1001) is small enough that
an additional index does not appear to be necessary at this time.

See https://gitlab.com/gitlab-org/gitlab-ce/issues/43132#note_68659234
for more information.
2018-05-17 13:52:59 +02:00
Matija Čupić a6866fbcab
Align elements of the hash literal parameter 2018-05-02 18:00:12 +02:00
Kamil Trzciński 6ea31cb7cd Add stages_ajax endpoint to serve old HTML 2018-05-02 00:05:03 +02:00
Zeger-Jan van de Weg c6edae3887
Load commit in batches for pipelines#index
Uses `list_commits_by_oid` on the CommitService, to request the needed
commits for pipelines. These commits are needed to display the user that
created the commit and the commit title.

This includes fixes for tests failing that depended on the commit
being `nil`. However, now these are batch loaded, this doesn't happen
anymore and the commits are an instance of BatchLoader.
2017-12-19 10:05:40 +01:00
Zeger-Jan van de Weg 3411fef1df
Cache commits on the repository model
Now, when requesting a commit from the Repository model, the results are
not cached. This means we're fetching the same commit by oid multiple times
during the same request. To prevent us from doing this, we now cache
results. Caching is done only based on object id (aka SHA).

Given we cache on the Repository model, results are scoped to the
associated project, eventhough the change of two repositories having the
same oids for different commits is small.
2017-10-27 12:49:11 +02:00
Jacopo 2f40dac352 Refactor `have_http_status` into `have_gitlab_http_status` in the specs 2017-10-20 10:13:18 +02:00
Zeger-Jan van de Weg 61f4d08b7b
Allow testing on Gitaly call count
Previous efforts were aimed at detecting N + 1 queries, general
regressions are hard to find and mitigate.
2017-10-16 13:25:51 +02:00
Mike Greiling 7b262c4356 Resolve "Precompiled assets with digest strings are ignored in CI" 2017-10-03 14:47:56 +00:00
Robert Speicher 72a7b30c9f Change all `:empty_project` to `:project` 2017-08-02 17:47:31 -04:00
Robert Speicher 9513bd18c4 Ensure all project factories use `:repository` trait or `:empty_project` 2017-08-01 14:51:52 -04:00
Lin Jen-Shin 7bd5e57125 Instead of adding master, stub_not_protect_default_branch 2017-07-18 23:48:14 +08:00
Lin Jen-Shin 28553dbc05 Update tests due to permission changes 2017-07-04 21:56:41 +08:00
Kamil Trzcinski 25b99a5b3b Update tests and application 2017-06-13 16:05:38 +02:00
Oswaldo Ferreira 34ba80392d Use :request_store hooks on specs 2017-06-09 18:18:36 -03:00
Z.J. van de Weg 63da91725e Improve pipeline size for query limit test
The pipeline was quite meagre in both stages and the number of groups.
This has been improved. Performance is not yet optimal, but to limit
this from sliding further this slippery slope, a hard limit has been
set.
2017-05-17 15:06:32 +02:00
Zeger-Jan van de Weg c17e6a6c68 Real time pipeline show action 2017-05-06 16:45:46 +00:00
Grzegorz Bizon 4f3dc19aaf Add specs for new pipeline action for JSON format 2017-05-05 09:32:13 +02:00
Jacopo ff76adb547 Unnecessary "include WaitForAjax" and "include ApiHelpers"
Removed all the unnecessary include of `WaitForAjax` and `ApiHelpers` in the specs.
Removed unnecessary usage of `api:true`
2017-04-21 22:32:02 +02:00
Luke "Jared" Bennett b544d8fade
Review changes, used eq instead of match 2017-04-17 13:18:40 +01:00
Luke "Jared" Bennett b24cb99856
Updated specs 2017-04-13 12:50:03 +01:00
Shinya Maeda a375d80eb0 Use detailed_status effectively. Remove unnecesarry context(nest). Add new context in merge_requests_controller_spec.rb and fix a bug. Correct description of spec. 2017-03-23 17:11:49 +09:00
Shinya Maeda 08a0bc5397 Add more specs 2017-03-23 17:11:49 +09:00
Shinya Maeda 38b1ec2cc0 Fix rspec failure 2017-03-23 17:11:49 +09:00
Shinya Maeda 3b63500297 3 lines to One line. Correct spec caption. 2017-03-23 17:11:49 +09:00
Shinya Maeda f8d6e81b92 Fix rubocop anger 2017-03-23 17:11:49 +09:00
Shinya Maeda 4fa4a2ce99 Add controllers spec 2017-03-23 17:11:48 +09:00
Douwe Maan ad640bc5f9 Use Namespace#full_path instead of #path where appropriate 2017-02-23 17:55:01 -06:00
Filipa Lacerda 66bca235c1 Adds missing tests for all status accepted in scope 2017-02-23 13:44:58 +00:00
Filipa Lacerda 0f36cfd7f5 Adds Pending and Finished tabs to pipelines page
Fix broken test
2017-02-16 22:25:01 +00:00
Grzegorz Bizon 63bb849145 Add controller specs for pipeline index API endpoint
[ci skip]
2016-12-21 15:13:43 +01:00
Grzegorz Bizon 2b486c2bb2 Fix stage and pipeline specs and rubocop offenses 2016-12-20 20:07:34 +01:00
Grzegorz Bizon 9c6480db89 Move test for HTML stage endpoint to controller specs 2016-12-20 15:57:39 +01:00