summaryrefslogtreecommitdiff
path: root/spec/controllers
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'mr-conflict-notification' into 'master'Douwe Maan2018-05-242-2/+2
|\ | | | | | | | | MR unmergeable notification See merge request gitlab-org/gitlab-ce!18042
| * Add cannot_be_merged_recheck merge_statuslulalala2018-05-172-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | First, transitions between can_be_merged & cannot_be_merged are removed, as they are currently blocked in `check_if_can_be_merged`. `can_be_merge` always returns to `unchecked` first, before it can transition to `cannot_be_merged` (and vice versa). We want to avoid repeated notification triggered by repeated transition between `cannot_be_merged` & `unchecked`. So we added `cannot_be_merged_recheck` state, similar to `unchecked`, but as a mean to remember it’s from cannot_be_merged. See https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/18042/#note_65945407 Since `unchecked` and `cannot_be_merged_recheck` both mean “we are in the middle of checking if it is mergeable”, quite often we need to see if merge_status is in either one of them, so `check_state?` is added to achieve this.
* | Render 404 when prometheus adapter is disabled in Prometheus metrics controllerTiago Botelho2018-05-231-25/+48
| |
* | Exclude coverage data from the pipelines pageYorick Peterse2018-05-171-0/+6
| | | | | | | | | | | | | | | | 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.
* | Limit the number of pipelines to countYorick Peterse2018-05-171-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Merge branch 'zj-workhorse-commit-patch-diff' into 'master'Grzegorz Bizon2018-05-171-28/+5
|\ \ | | | | | | | | | | | | | | | | | | Workhorse to send raw diff and patch for commits Closes gitaly#1196 See merge request gitlab-org/gitlab-ce!18974
| * | Workhorse to send raw diff and patch for commitsZeger-Jan van de Weg2018-05-161-28/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prior to this change, this was done through unicorn. In theory this could time out. Workhorse has been sending these raw patches and diffs for a long time and is stable in doing so. Added bonus is the fact that `Commit#to_patch` can be removed. `Commit#to_diff` too, which closes https://gitlab.com/gitlab-org/gitaly/issues/324 Closes https://gitlab.com/gitlab-org/gitaly/issues/1196
* | | Allow group runners to be viewed/edited in APIDylan Griffith2018-05-161-3/+3
|/ /
* | Fix cross-origin errors when attempting to download JavaScript attachmentsStan Hu2018-05-131-0/+15
|/ | | | | | | | | If you upload a file with a .js extension, Rails' cross-origin JavaScript protection will prevent a user from downloading the file with a 422 error. Setting the content-type to `text/plain` will allow the user to download the file as a plaintext file. Closes #45826
* [Rails5] Fix spec/controllers/projects/jobs_controller_spec.rbb-rails5-fix-spec-controllers-projects-jobs_controller_spec-rbblackst0ne2018-05-111-12/+12
| | | | | In Rails 5.0 `response.content_type` does not return charset which is expected in specs. This commit replaces `response.content_type` with `response.headers["Content-Type"]` in specs.
* Merge branch '10244-ux-improvements-for-group-runners' into 'master'Kamil Trzciński2018-05-071-0/+74
|\ | | | | | | | | Improve UX For Group Runners See merge request gitlab-org/gitlab-ce!18649
| * Allow to pause,resume,show,edit,destroy group runners (#10244)Dylan Griffith2018-05-071-0/+74
| |
* | Merge branch '42099-port-push-mirroring-to-ce-ce-port-v-2' into 'master'Douwe Maan2018-05-071-0/+72
|\ \ | | | | | | | | | | | | | | | | | | CE backport of Backports Push Mirrors to CE Closes #42099 See merge request gitlab-org/gitlab-ce!18715
| * | Backports every CE related change from ee-5484 to CETiago Botelho2018-05-071-0/+72
| | |
* | | Merge branch 'live-trace-v2' into 'master'Grzegorz Bizon2018-05-071-1/+2
|\ \ \ | |/ / |/| | | | | | | | | | | | | | New CI Job live-trace architecture (v2) Closes #44935 See merge request gitlab-org/gitlab-ce!18169
| * | Merge branch 'master' into live-trace-v2Shinya Maeda2018-05-076-1/+273
| |\ \ | | |/
| * | Merge branch 'master' into live-trace-v2Shinya Maeda2018-05-033-33/+3
| |\ \
| * \ \ Merge branch 'master' into live-trace-v2Shinya Maeda2018-04-262-2/+60
| |\ \ \
| * \ \ \ Merge branch 'master' into live-trace-v2Shinya Maeda2018-04-243-5/+11
| |\ \ \ \
| * \ \ \ \ Merge branch 'master' into live-trace-v2Shinya Maeda2018-04-231-4/+1
| |\ \ \ \ \
| * \ \ \ \ \ Merge branch 'master' into live-trace-v2Shinya Maeda2018-04-202-1/+28
| |\ \ \ \ \ \
| * \ \ \ \ \ \ Merge branch 'master' into live-trace-v2Shinya Maeda2018-04-176-7/+114
| |\ \ \ \ \ \ \
| * \ \ \ \ \ \ \ Merge branch 'master' into live-trace-v2Shinya Maeda2018-04-064-78/+175
| |\ \ \ \ \ \ \ \
| * | | | | | | | | Fix HttpIO and specShinya Maeda2018-04-061-1/+2
| | | | | | | | | |
* | | | | | | | | | Add signature verification badge to compare viewMarc2018-05-071-78/+232
| | | | | | | | | |
* | | | | | | | | | Merge branch '33697-pipelines-json-endpoint' into 'master'Kamil Trzciński2018-05-071-2/+37
|\ \ \ \ \ \ \ \ \ \ | |_|_|_|_|_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | | | | | | | Merge branch 'master' into 33697-pipelines-json-endpointMatija Čupić2018-05-022-3/+3
| |\ \ \ \ \ \ \ \ \
| * | | | | | | | | | Align elements of the hash literal parameterMatija Čupić2018-05-021-4/+4
| | | | | | | | | | |
| * | | | | | | | | | Add stages_ajax endpoint to serve old HTMLKamil Trzciński2018-05-021-2/+37
| | |_|_|_|_|_|_|/ / | |/| | | | | | | |
* | | | | | | | | | Reuses `InternalRedirect` when possibleBob Van Landuyt2018-05-042-1/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `InternalRedirect` prevents Open redirect issues by only allowing redirection to paths on the same host. It cleans up any unwanted strings from the path that could point to another host (fe. //about.gitlab.com/hello). While preserving the querystring and fragment of the uri. It is already used by: - `TermsController` - `ContinueParams` - `ImportsController` - `ForksController` - `SessionsController`: Only for verifying the host in CE. EE allows redirecting to a different instance using Geo.
* | | | | | | | | | Enforces terms in the web applicationBob Van Landuyt2018-05-043-0/+153
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This enforces the terms in the web application. These cases are specced: - Logging in: When terms are enforced, and a user logs in that has not accepted the terms, they are presented with the screen. They get directed to their customized root path afterwards. - Signing up: After signing up, the first screen the user is presented with the screen to accept the terms. After they accept they are directed to the dashboard. - While a session is active: - For a GET: The user will be directed to the terms page first, after they accept the terms, they will be directed to the page they were going to - For any other request: They are directed to the terms, after they accept the terms, they are directed back to the page they came from to retry the request. Any information entered would be persisted in localstorage and available on the page.
* | | | | | | | | | Allow a user to accept/decline termsBob Van Landuyt2018-05-041-1/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a user accepts, we store this in the agreements to keep track of which terms they accepted. We also update the flag on the user.
* | | | | | | | | | Display terms to a userBob Van Landuyt2018-05-041-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When terms are present, they can be viewed on `/-/users/terms`.
* | | | | | | | | | Merge branch 'master' into feature/runner-per-groupDylan Griffith2018-05-033-33/+3
|\ \ \ \ \ \ \ \ \ \ | | |_|_|_|_|_|_|_|/ | |/| | | | | | | |
| * | | | | | | | | Load branches on new merge request page asynchronouslyWinnie Hellmann2018-05-021-30/+0
| | |/ / / / / / / | |/| | | | | | |
| * | | | | | | | Display and revoke active sessionsAlexis Reigel ( 🌴 may 2nd - may 9th 🌴 )2018-05-021-1/+1
| | | | | | | | |
| * | | | | | | | Fix file_store for artifacts and lfs when savingKamil Trzciński2018-05-011-2/+2
| |/ / / / / / /
* | | | | | | | Fix spec/features/admin/admin_runners_spec.rb + test style improvementsDylan Griffith2018-05-011-7/+13
| | | | | | | |
* | | | | | | | Merge branch 'master' into siemens-runner-per-groupDylan Griffith2018-04-262-2/+60
|\ \ \ \ \ \ \ \ | |/ / / / / / /
| * | | | | | | Merge branch 'zj-storage-path-deprecation' into 'master'Douwe Maan2018-04-251-2/+2
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Legacy disk path refactor Closes gitaly#1111 See merge request gitlab-org/gitlab-ce!18364
| | * | | | | | | Gitlab::Shell works on shard name, not pathZeger-Jan van de Weg2018-04-251-2/+2
| | | |_|_|_|_|/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Direct disk access is done through Gitaly now, so the legacy path was deprecated. This path was used in Gitlab::Shell however. This required the refactoring in this commit. Added is the removal of direct path access on the project model, as that lookup wasn't needed anymore is most cases. Closes https://gitlab.com/gitlab-org/gitaly/issues/1111
| * | | | | | | Merge branch 'jej/refactor-omniauth-controller' into 'master'Douwe Maan2018-04-241-0/+58
| |\ \ \ \ \ \ \ | | |/ / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor OmniauthCallbacksController to remove duplication Closes #26559 See merge request gitlab-org/gitlab-ce!16694
| | * | | | | | Refactor OmniauthCallbacksController to remove duplicationJames Edwards-Jones2018-04-221-0/+58
| | | |_|_|_|/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | Moves LDAP to its own controller with tests Provides path forward for implementing GroupSaml
* | | | | | | Merge branch 'master' into siemens-runner-per-groupDylan Griffith2018-04-243-5/+11
|\ \ \ \ \ \ \ | |/ / / / / /
| * | | | | | Resolve "Namespace factory is problematic"Lin Jen-Shin2018-04-233-5/+11
| |/ / / / /
* | | | | | restrict projects ci controller to project runnersAlexis Reigel2018-04-231-0/+11
|/ / / / /
* | | | | Removes 'no job log' from trace actionMayra Cabrera2018-04-221-4/+1
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'No job log' message is no longer necessary since we returned an image when a build does not have a trace. See https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/18278 for more details Closes #45625
* | | | Merge branch '45507-fix-repository-archive-url' into 'master'Douwe Maan2018-04-191-0/+24
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix specifying a non-default ref when requesting an archive using the legacy URL Closes #45507 See merge request gitlab-org/gitlab-ce!18468
| * | | | Fix specifying a non-default ref when requesting an archive using the legacy URLNick Thomas2018-04-191-0/+24
| | |_|/ | |/| |
* | | | Resolve "Show `failure_reason` in jobs view content section"Mayra Cabrera2018-04-191-1/+4
|/ / /