summaryrefslogtreecommitdiff
path: root/app/controllers/projects/pipelines_controller.rb
Commit message (Collapse)AuthorAgeFilesLines
* Exclude coverage data from the pipelines pageYorick Peterse2018-05-171-1/+1
| | | | | | | | 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.
* Preload pipeline data for project pipelinesYorick Peterse2018-05-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Limit the number of pipelines to countYorick Peterse2018-05-171-11/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Enable update_(build|pipeline) for maintainersJan Provaznik2018-05-151-0/+4
|
* Merge branch 'fix-failed-jobs-tab' into 'master'Grzegorz Bizon2018-05-081-1/+1
|\ | | | | | | | | Fix failed jobs tab See merge request gitlab-org/gitlab-ce!18520
| * Respect permissions when showing Failed JobsKamil Trzciński2018-05-061-1/+1
| |
* | Merge branch '33697-pipelines-json-endpoint' into 'master'Kamil Trzciński2018-05-071-3/+12
|\ \ | | | | | | | | | | | | | | | | | | Resolve "CI retry/cancel job or pipeline redirect the user and can't be open in a new tab" Closes #33697 See merge request gitlab-org/gitlab-ce!18451
| * | Fix syntax errorKamil Trzciński2018-05-021-1/+1
| | |
| * | Add stages_ajax endpoint to serve old HTMLKamil Trzciński2018-05-021-0/+9
| | |
| * | Fix stage.json endpointKamil Trzciński2018-04-231-1/+1
| | |
| * | Add proper stage.json dataKamil Trzciński2018-04-231-3/+3
| |/
* | Accept variable params in create_paramsMatija Čupić2018-04-181-1/+1
|/
* Track and act upon the number of executed queriesquery-countsYorick Peterse2018-02-011-0/+6
| | | | | | | | | | | This ensures that we have more visibility in the number of SQL queries that are executed in web requests. The current threshold is hardcoded to 100 as we will rarely (maybe once or twice) change it. In production and development we use Sentry if enabled, in the test environment we raise an error. This feature is also only enabled in production/staging when running on GitLab.com as it's not very useful to other users.
* Load commit in batches for pipelines#indexZeger-Jan van de Weg2017-12-191-0/+2
| | | | | | | | | | 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.
* move `lib/ci/charts.rb` into `lib/gitlab/ci/charts.rb`Maxim Rydkin2017-09-121-4/+4
|
* Create and use project path helpers that only need a project, no namespaceDouwe Maan2017-07-051-3/+3
|
* Remove references to build in pipeline chartsZ.J. van de Weg2017-06-231-1/+1
| | | | | | | Being the good boyscouts, but mainly because of [the comment in the review](https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/12378#note_33302115) the words used for classes and variables are changed to not use builds anymore.
* Improve performance for pipeline chartsZ.J. van de Weg2017-06-231-0/+5
| | | | | Achieved by using another table, which both has better indexes and is smaller. Now the data provided for the user is more valueable too.
* Allow to access pipelines even if they are disabled, but only present jobs ↵Kamil Trzcinski2017-06-131-1/+0
| | | | and commit statuses without giving ability to access them
* Merge branch 'master' into feature/gb/persist-pipeline-stagesGrzegorz Bizon2017-06-051-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (524 commits) Improve user experience around slash commands in instant comments Fix LFS timeouts when trying to save large files retryable? is now available for CommitStatus Resolve "Documentation of `.gitlab-ci.yml` states incorrect example for variables" Fix test failures Add slugify project path to CI enviroment variables Fixed typo: craeted -> created 32118 Make New environment empty state btn lowercase Expose import_status in Projects API 32832 Remove overflow from comment form for confidential issues and vertically aligns confidential issue icon Fix test failures Allow manual bypass of auto_sign_in_with_provider Fix keys seed Allow users to be hard-deleted from the API fixup some classnames and media queries Enable the Style/PreferredHashMethods cop Lint our factories creation in addition to their build Don’t schedule workers from inside transactions Allow scheduling from after_commit hooks Forbid Sidekiq scheduling in transactions ... Conflicts: app/serializers/pipeline_entity.rb db/schema.rb spec/factories/ci/stages.rb spec/lib/gitlab/import_export/safe_model_attributes.yml spec/services/ci/create_pipeline_service_spec.rb spec/spec_helper.rb
| * Introduce source to pipeline entitytrigger-sourceKamil Trzcinski2017-05-311-1/+1
| |
* | Rename pipeline methods related to legacy stagesGrzegorz Bizon2017-06-011-1/+1
|/
* Enable the Style/TrailingCommaInLiteral copRémy Coutable2017-05-101-1/+1
| | | | | | Use the EnforcedStyleForMultiline: no_comma option. Signed-off-by: Rémy Coutable <remy@rymai.me>
* Merge request widget redesignFatih Acet2017-05-091-3/+3
|
* Real time pipeline show actionZeger-Jan van de Weg2017-05-061-5/+17
|
* Merge branch '24883-build-failure-summary-page' into 'master' Phil Hughes2017-05-051-5/+17
|\ | | | | | | | | | | | | Build failures summary page for pipelines Closes #24883 See merge request !10719
| * Hides pipeline ‘Failed Jobs’ tab when no jobs have failedJames Edwards-Jones2017-05-051-1/+5
| |
| * Build failures summary page for pipelinesJames Edwards-Jones2017-05-051-6/+14
| |
* | Use wrap_parameters in pipelines controllerGrzegorz Bizon2017-05-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | This makes it possible to workaround a bug in `safe_constantize` which caused a `LoadError` exception when doing ``` "Pipeline".safe_constantize LoadError: Unable to autoload constant Pipeline, expected /home/grzesiek/gdk/gitlab/app/models/ci/pipeline.rb to define it ``` See https://github.com/rails/rails/issues/28854 for more details.
* | Respond with no content for pipeline JSON actionsGrzegorz Bizon2017-05-051-6/+2
| |
* | Retry and cancel endpoints send 204 json response. Request is made with type ↵Filipa Lacerda2017-05-051-2/+18
| | | | | | | | json
* | - Add new parameters for Pipeline APIShinya Maeda2017-05-031-5/+5
|/ | | | - Expand PipelinesFinder functions
* Merge branch '8998_skip_pending_commits_if_not_head' into 'master' Kamil Trzciński2017-04-071-1/+1
|\ | | | | | | | | Add auto-cancel for pending pipelines on branch, if they are not HEAD See merge request !9362
| * replaced one more helper with presenterRydkin Maxim2017-04-041-1/+1
| |
* | Set the Etag cache polling intervalToon Claes2017-04-061-0/+2
|/
* Fix rspec failureShinya Maeda2017-03-231-2/+1
|
* with_status to only_statusShinya Maeda2017-03-231-1/+1
|
* Expose only status. ci_cd_status to status. Support abstract class.Shinya Maeda2017-03-231-1/+2
|
* Add api points for ci cd status. Add favicon.Shinya Maeda2017-03-231-0/+6
|
* Cleaning up navigational order - ProjectKushal Pandya2017-03-021-1/+10
|
* Adds Pending and Finished tabs to pipelines pageFilipa Lacerda2017-02-161-2/+10
| | | | Fix broken test
* Include resources to speed up pipelines serializerGrzegorz Bizon2017-01-051-1/+0
|
* Merge branch 'master' into auto-pipelines-vueGrzegorz Bizon2016-12-211-0/+10
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (367 commits) Set “Remove branch” button to default size remove unused helper method reduce common code even further to satisfy rake flay remove button class size alteration from revert and cherry pick links factor out common code to satisfy rake flay homogenize revert and cherry-pick button styles generated by commits_helper apply margin on alert banners only when there is one or more alerts Rename MattermostNotificationService back to MattermostService Rename SlackNotificationService back to SlackService Fix stage and pipeline specs and rubocop offenses Added QueryRecorder to test N+1 fix on Milestone#show Use gitlab-workhorse 1.2.1 Make 'unmarked as WIP' message more consistent Improve specs for Files API Allow unauthenticated access to Repositories Files API GET endpoints Add isolated view spec for pipeline stage partial Move test for HTML stage endpoint to controller specs Fix sizing of avatar circles; add border Fix broken test Fix broken test Changes after review ... Conflicts: app/assets/stylesheets/pages/pipelines.scss app/controllers/projects/pipelines_controller.rb app/views/projects/pipelines/index.html.haml spec/features/projects/pipelines/pipelines_spec.rb
| * Add tests for stage API endpointKamil Trzcinski2016-12-201-3/+1
| |
| * Render stage dropdown in separate API call as HTMLKamil Trzcinski2016-12-191-0/+12
| | | | | | | | | | | | | | | | ``` Endpoint: /group/project/pipelines/id/stage.json?stage=name Call: stage_namespace_project_pipeline_path(pipeline.project.namespace, pipeline.project, pipeline, stage: stage.name) ```
* | Remove unused updated_atKamil Trzcinski2016-12-151-1/+0
| |
* | Fix rubocop offenses in code related to pipelinesGrzegorz Bizon2016-12-151-14/+21
| |
* | Add prototype of pipelines serializer with paginationGrzegorz Bizon2016-12-071-0/+1
| |
* | fix conflictRegis2016-12-021-1/+9
|\ \ | |/
| * Adds tests for tabs in the rspec for pipelinesFilipa Lacerda2016-11-301-2/+6
| | | | | | | | | | | | | | | | Adds tests for the Linked Tabs class Removes event listener Adds builds