summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'eager-loading-issue-parser' into 'master' Douwe Maan2016-06-152-1/+16
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Eager load project relations in IssueParser ## What does this MR do? This changes the ReferenceParser class to eager load various associations. This in turn results in the permissions checking code (e.g. the `Ability` model) to _not_ run dozens if not hundreds of extra SQL queries depending on the amount of references involved (in a single document). ## Are there points in the code the reviewer needs to double check? No. ## Why was this MR needed? In !4410 it was revealed a _lot_ of a queries came from the `Ability` model and the code it would call. In many cases this was because the code would simply get a project, then get the owners; or get a group, then get some association of that. Eager loading these associations is a fairly simple solution and greatly cuts down the number of queries. ## What are the relevant issue numbers? None. ## Does this MR meet the acceptance criteria? - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - [x] ~~[Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)~~ - [x] ~~API support added~~ - [ ] Tests - [x] ~~Added for this feature/bug~~ - [ ] All builds are passing - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [ ] Branch has no merge conflicts with `master` (if you do - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) See merge request !4675
| * Eager load project relations in IssueParserYorick Peterse2016-06-152-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | By eager loading these associations we can greatly cut down the number of SQL queries executed when processing documents with lots of references, especially in cases where there are references belonging to the same project. Since these associations are so specific to the reference parsing process and the permissions checking process that follows it I opted to include them directly in IssueParser instead of using something like a scope. Once we have a need for it we can move this code to a scope or method.
* | Merge branch 'stanhu/gitlab-ce-fix-error-500-false-binary-negative'Douwe Maan2016-06-1510-5/+27
|\ \
| * | Fix Error 500 when viewing a blob with binary characters after the 1024-byte ↵Stan Hu2016-06-1210-5/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mark Here was the problem: 1. When determining whether a given blob is viewable text, gitlab_git reads the first 1024 bytes and checks with Linguist whether it is a text or binary file. 2. If the blob is text, GitLab will attempt to display it. 3. However, if the text has binary characters after the first 1024 bytes, then GitLab will attempt to load the entire contents, but the encoding will be ASCII-8BIT since there are binary characters. 4. The Error 500 results when GitLab attempts to display a mix UTF-8 and ASCII-8BIT. To fix this, we load as much data as we are willing to display so that the detection will work properly. Requires an update to gitlab_git: gitlab-org/gitlab_git!86 Closes #13826
* | | Merge branch 'list-items' into 'master' Jacob Schatz2016-06-154-6/+7
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove div between ul and li ## What does this MR do? Adds `container_class`to `ul` instead of `div` for valid HTML ## What are the relevant issue numbers? https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/4592#note_12420843 See merge request !4633
| * | | Remove div between ul and lilist-itemsAnnabel Dunstone2016-06-134-6/+7
| | | |
* | | | Merge branch 'zj-system-notes-not-awardable' into 'master' Douwe Maan2016-06-151-0/+4
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Award Emoji can't be awarded on system notes backend See merge request !4668
| * | | | Award Emoji can't be awarded on system notes backendzj-system-notes-not-awardableZ.J. van de Weg2016-06-151-0/+4
| | | | |
* | | | | Merge branch 'environments-and-deployments' into 'master' Rémy Coutable2016-06-1546-40/+880
|\ \ \ \ \ | |_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add environments and deployments This MR is a continuation of https://gitlab.com/gitlab-org/gitlab-ce/issues/17009. The current implementation is as follow: 1. We have two new tables: `environments` and `deployments`. 2. We have a new tab: `Environments` under `Pipelines` where you can see all you environments and add a new one. 3. We add a new option to `.gitlab-ci.yml` to track where we should create a deployment for environment. 4. If environment in `.gitlab-ci.yml` is specified it will create a deployment. **If environment does not exist it will be created.** (this got changed) 5. The deployment is always successful and shows the time of the action, in that case a build that presumably should do deployment. In the future we could extend deployment with statuses: success, failure. We could extend deployments with information that this is partial or full deployment. 6. User have to create environments that he will track first. 7. User can remove environments. 8. User can retry/rollback past deployment (in that case we retry past build). The new build when succeeds it will create a new deployment. 9. Currently environment have only one parameter: `name`. In the future it should have: `variables`, `credentials` and possibly `runners` and maybe other resources. 10. Currently deployment have this parameters: `sha`, `ref`, `deployable (in this case a build)`, `user (who triggered a deployment)`, `created_at`. The `.gitlab-ci.yml`: ``` deploy to production: stage: deploy script: dpl travis... environment: production ``` What needs to be done: - [x] Write initial implementation - [x] Improve implementation (@ayufan) - [x] Write tests (@ayufan) - [x] Improve UX of the forms (cc @markpundsack) - reviewed by @markpundsack - [x] Improve implementation of the views (cc @jschatz1) - done by @iamphill - [x] Write .gitlab-ci.yml documentation for `environments` - done by @ayufan - [ ] Write user documentation (@ayufan and @markpundsack) See merge request !4605
| * | | | Use validate and required for environment and projectKamil Trzcinski2016-06-152-3/+3
| | | | |
| * | | | Make project_id, iid unique for deploymentsKamil Trzcinski2016-06-152-2/+469
| | | | |
| * | | | Validate project and environment instead of only requiringKamil Trzcinski2016-06-153-473/+6
| | | | |
| * | | | Make `project_id` and `environment_id` nullableenvironments-and-deploymentsKamil Trzcinski2016-06-153-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | This is done to make belongs_to with required to properly validate association. Otherwise `ActiveRecord::StatementInvalid` is raised.
| * | | | Create_deployment ability is need to create retry or rollback deploymentKamil Trzcinski2016-06-152-3/+3
| | | | |
| * | | | Add CHANGELOGKamil Trzcinski2016-06-151-0/+1
| | | | |
| * | | | Make environments_spec more feature-specKamil Trzcinski2016-06-151-57/+56
| | | | |
| * | | | Improve cyclomatic of ability::allowedKamil Trzcinski2016-06-151-15/+1
| | | | |
| * | | | Improve forms and specsKamil Trzcinski2016-06-156-20/+22
| | | | |
| * | | | Improve validationsKamil Trzcinski2016-06-156-34/+31
| | | | |
| * | | | Improve design after reviewKamil Trzcinski2016-06-1414-69/+59
| | | | |
| * | | | Merge remote-tracking branch 'origin/master' into environments-and-deploymentsKamil Trzcinski2016-06-1439-543/+1040
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | # Conflicts: # db/schema.rb
| * | | | | Update scss to make the views look nicerKamil Trzcinski2016-06-145-9/+13
| | | | | |
| * | | | | Merge remote-tracking branch 'origin/master' into environments-and-deploymentsKamil Trzcinski2016-06-1424-108/+817
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | # Conflicts: # lib/ci/gitlab_ci_yaml_processor.rb
| * | | | | | Test environment controller specsKamil Trzcinski2016-06-143-1/+168
| | | | | | |
| * | | | | | Properly create a new deployment after build successKamil Trzcinski2016-06-142-6/+68
| | | | | | |
| * | | | | | Authorize environments controller actionsKamil Trzcinski2016-06-144-2/+48
| | | | | | |
| * | | | | | Add gitlab-ci.yml documentation for environmentsKamil Trzcinski2016-06-141-0/+27
| | | | | | |
| * | | | | | Add specs for models and servicesKamil Trzcinski2016-06-1412-28/+139
| | | | | | |
| * | | | | | Validate environment name with regexKamil Trzcinski2016-06-144-10/+78
| | | | | | |
| * | | | | | Make retry action on pipeline to save a userKamil Trzcinski2016-06-142-3/+5
| | | | | | |
| * | | | | | Merge remote-tracking branch 'origin/master' into environments-and-deploymentsKamil Trzcinski2016-06-14109-647/+1420
| |\ \ \ \ \ \
| * | | | | | | Improved viewsPhil Hughes2016-06-134-46/+44
| | | | | | | |
| * | | | | | | Add deployment viewsKamil Trzcinski2016-06-119-33/+74
| | | | | | | |
| * | | | | | | Added initial version of deploymentsKamil Trzcinski2016-06-1022-111/+311
| | | | | | | |
| * | | | | | | commit statusKamil Trzcinski2016-06-108-0/+138
| | |_|_|_|_|/ | |/| | | | |
* | | | | | | Merge branch 'seed-fu-award-emoji' into 'master' Douwe Maan2016-06-152-0/+37
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Seed Award Emoji while seeding the database ## What does this MR do? Lets `rake dev:setup` create award emoji on _some_ awardables. Seemed overkill to give all that privilege. See merge request !4555
| * | | | | | | Random selection now also works for MySQLseed-fu-award-emojiZ.J. van de Weg2016-06-152-3/+7
| | | | | | | |
| * | | | | | | Near half of the Issues get Award Emoji when seedingZ.J. van de Weg2016-06-151-4/+4
| | | | | | | |
| * | | | | | | Skip system notes from receiving award emojiZ.J. van de Weg2016-06-151-4/+10
| | | | | | | |
| * | | | | | | Seed Award Emoji while seeding the databaseZ.J. van de Weg2016-06-151-0/+27
| | |_|_|_|/ / | |/| | | | |
* | | | | | | Merge branch 'fix-header-logo-link' into 'master' Jacob Schatz2016-06-152-7/+1
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the logo in header not being an anchor link. ## What does this MR do? Adds an actual link to the Tanuki in the header instead of a `Turbolinks.visit()`. ## Are there points in the code the reviewer needs to double check? Do we care that this reverts the Safari issue fixed in !2690? I feel bad, but it's hacky and there's not a great way to fix it here. ## Why was this MR needed? You couldn't open the home page in a new tab before, it was very annoying. ## What are the relevant issue numbers? Fixes #18604 cc: @rspeicher See merge request !4661
| * | | | | | | Fix #18604, logo in header wasn't an anchor link.fix-header-logo-linkConnor Shea2016-06-142-7/+1
| | | | | | | |
* | | | | | | | Merge branch 'project-move-dropdown-search' into 'master' Jacob Schatz2016-06-153-0/+21
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed issue with move dropdown not being searchable ## What does this MR do? Adds the ability to search the project move dropdown. ## What are the relevant issue numbers? Closes #18634 ## Screenshots (if relevant) ![search](/uploads/f10a9a16b608308c1b3c66f186f57f80/search.gif) See merge request !4666
| * | | | | | | | Added test to dropdown searchPhil Hughes2016-06-151-0/+16
| | | | | | | | |
| * | | | | | | | Fixed issue with move dropdown not being searchableproject-move-dropdown-searchPhil Hughes2016-06-152-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Closes #18634
* | | | | | | | | Merge branch '17333-u2f-only-after-authenticator' into 'master' Douwe Maan2016-06-154-43/+40
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't allow U2F set up unless an authenticator app is set up Closes #17333 # TODO - [ ] #17333 Authenticator should be set up before enabling U2F - [x] Implementation - [x] Fix/add tests - [x] Refactor - [x] Wait for [build](https://gitlab.com/gitlab-org/gitlab-ce/commit/964c98a3c427cac6e3de88ddc74a9f172ee9742d/builds) to pass - [x] Assign to endboss for review - [x] Address @DouweM's comments - [x] No need for `javascript:void(0)` - [x] Add screenshots - [ ] Wait for merge # Screenshots ![Screen_Shot_2016-06-15_at_8.18.03_AM](/uploads/26531fa7f6e5d7617fd11d1779021b4f/Screen_Shot_2016-06-15_at_8.18.03_AM.png) ![Screen_Shot_2016-06-15_at_8.18.37_AM](/uploads/ceaae97a987a15d3e04dd76aa8a944bd/Screen_Shot_2016-06-15_at_8.18.37_AM.png) ![Screen_Shot_2016-06-15_at_8.18.47_AM](/uploads/394224d5fcff759d5acc3bf39a138530/Screen_Shot_2016-06-15_at_8.18.47_AM.png) See merge request !4585
| * | | | | | | | | Fix teaspoon spec.17333-u2f-only-after-authenticatorTimothy Andrew2016-06-151-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - We added a `current_user.two_factor_via_otp?` check to the view. When rendering the view via the teaspoon fixture, `current_user` is `nil`.
| * | | | | | | | | Update `u2f_spec` to cover U2F being disabled until authenticator is set up.Timothy Andrew2016-06-151-34/+23
| | | | | | | | | |
| * | | | | | | | | Don't allow clicking on "Setup New U2F Device" unless an authenticator app ↵Timothy Andrew2016-06-152-8/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | has been set up. - Also change the help message to indicate that an authenticator app is now a prerequisite for U2F.
* | | | | | | | | | Merge branch '18451-track-new-redis-connections' into 'master' Douwe Maan2016-06-153-1/+18
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Resolve "Track the number of new Redis connections per transaction" ## What does this MR do? Add a new metric counter, `new_redis_connections`, that contains the number of calls to `Redis::Client#connect` in the current transaction. ## Are there points in the code the reviewer needs to double check? Not sure. I tested this in kind of a brute-force way: 1. Add a debugger in the monkey-patched `connect` method. 2. With metrics enabled, start the app and load a page. 3. The first Redis connection is created by `Rack::Attack` and isn't in a transaction, but still works fine. 4. The second Redis connection is within a transaction (the page load), and increments the counter. 5. If I reload the page, neither debugger is hit. 6. If I use a Redis client and do `CLIENT KILL` on my two existing clients, then reload the page, I get 3 and 4 again. 7. If I disable metrics collection, the debugger never gets hit. ## Why was this MR needed? We may have a Redis connection leak somewhere, so adding metrics will let us track this. ## What are the relevant issue numbers? Closes #18451. ## Screenshots (if relevant) Hahaha nope, not relevant. ## Does this MR meet the acceptance criteria? - [ ] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - [ ] API support added - [ ] Tests - [ ] Added for this feature/bug - [ ] All builds are passing - [ ] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [ ] Branch has no merge conflicts with `master` (if you do - rebase it please) - [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) cc @yorickpeterse See merge request !4649