summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'backport-ee-js-groups-api' into 'master' Robert Speicher2016-11-041-0/+3
|\ | | | | | | | | | | | | Backport Group API code that was added in EE only Group API code that was added in EE only. /cc @vsizov See merge request !7205
| * Backport Group API code that was added in EE onlybackport-ee-js-groups-apiRémy Coutable2016-10-311-0/+3
| | | | | | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* | Merge branch '24059-round-robin-repository-storage' into 'master' Douwe Maan2016-11-042-2/+3
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Resolve "Introduce round-robin project creation to spread load over multiple shards" ## What does this MR do? Allow multiple shards to be enabled in the admin settings page, balancing project creation across all enabled shards. ## Are there points in the code the reviewer needs to double check? * `f.select ..., multiple: true` isn't the most beautiful UI in the world, but switching to `collection_check_boxes` (or a facsimile thereof) isn't trivial * Should `pick_repository_storage` be a method of `ApplicationSetting`, or `Project`? It's going to accrete logic over time so perhaps it should be its own class already? * This is written to avoid the need for a database migration, so it is`serialize :repository_storage` without `, Array`. This is tested, but alternatives include: * Add a database migration * Write a custom Coder that will accept a String or Array in `load` and always `dump an Array. ## Why was this MR needed? ## Screenshots (if relevant) ![Screen_Shot_2016-11-03_at_14.42.41](/uploads/7de15d6c1b3fa60bb7a34d6a7d9f00ce/Screen_Shot_2016-11-03_at_14.42.41.png) ## Does this MR meet the acceptance criteria? - [X] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG.md) 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 [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html) - [X] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [X] Branch has no merge conflicts with `master` (if it does - rebase it please) - [X] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) ## What are the relevant issue numbers? Closes #24059 See merge request !7273
| * | Allow multiple repository storage shards to be enabled, and automatically ↵Nick Thomas2016-11-042-2/+3
| | | | | | | | | | | | round-robin between them
* | | Show log corresponding to env in admin/logsLukas Erlacher2016-11-031-2/+2
|/ / | | | | | | | | | | | | | | | | | | No matter which environment Gitlab was running as, the admin/logs view always showed production.log. This commit selects the logfile based on Rails.env. - Rename ProductionLogger to EnvironmentLogger - Make EnvironmentLogger logfile depend on env - Update spinach test for log tabs
* | Merge branch 'zj-expose-system-hooks' into 'master' Rémy Coutable2016-11-032-6/+10
|\ \ | | | | | | | | | | | | Expose more info for SystemHooks See merge request !6964
| * | Update docs and unexpose tokenZeger-Jan van de Weg2016-11-022-1/+2
| | |
| * | Be able to POST subscriptions for system hooksZ.J. van de Weg2016-10-311-2/+6
| | |
| * | Expose more data on the SystemHooks APIZ.J. van de Weg2016-10-311-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now exposed: - push_events - tag_push_events - enable_ssl_verification - token Fixes gitlab-org/gitlab-ce#23307
* | | Merge branch 'fix/import-export-symlink-vulnerability' into 'security'Douwe Maan2016-11-033-3/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix symlink vulnerability in Import/Export Replaces https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/2018 made by @james Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/23822 See merge request !2022 Signed-off-by: Rémy Coutable <remy@rymai.me>
* | | Merge branch 'fix/import-projectmember-security' into 'security'Douwe Maan2016-11-033-12/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix Import/Export foreign key issue to do with project members Cleans-up any foreign keys in `ProjectMember` - same as we do with the rest of the models when importing. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/23837 and https://gitlab.com/gitlab-org/gitlab-ce/issues/23739 See merge request !2020 Signed-off-by: Rémy Coutable <remy@rymai.me>
* | | Merge branch 'gpocentek/gitlab-ce-api-webhook-token' into 'master' Rémy Coutable2016-11-021-2/+4
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | This MR adds support for the `token` attribute in the project hook API. Feature requested on a dependant project: https://github.com/gpocentek/python-gitlab/issues/170 See merge request !7220
| * | | Ensure hook tokens are write-only in the APIgpocentek/gitlab-ce-api-webhook-tokenSean McGivern2016-11-011-1/+1
| | | |
| * | | Add support for token attr in project hooks APIGauvain Pocentek2016-11-012-3/+5
| | | | | | | | | | | | | | | | | | | | The UI allows to define a token to validate payload on the target URL, this patch adds the feature to the API.
* | | | Merge branch 'create_hooks_rake' into 'master' Rémy Coutable2016-11-021-3/+12
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add Rake task to create/repair GitLab Shell hooks symlinks ## What does this MR do? Adds a Rake task wrapper around `gitlab-shell` `bin/create_hooks` script. This makes it easier for an administrator to repair hooks symlinks without worrying about where repository data is located, etc. Just run this task and it takes care of everything based on current configuration. ## Are there points in the code the reviewer needs to double check? No. ## Why was this MR needed? `bin/create_hooks` was not well-documented. It requires parameters specifying where repository data is located. It also needs to be run by the `git` user. Wrapping it in a Rake task allows us to take current configuration in to account and makes it easier on the administrator. See merge request !5634
| * | | | Add Rake task to create/repair GitLab Shell hooks symlinksDrew Blessing2016-11-011-3/+12
| | | | |
* | | | | require rails/generators for generatorsYorick Peterse2016-11-011-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because this code resides in lib/ it may be eager loaded. Rails in turn doesn't define Rails::Generators by default unless you explicitly require "rails/generators".
* | | | | Merge branch 'background-migrations' into 'master'Robert Speicher2016-11-011-0/+13
|\ \ \ \ \ | |/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support for post deployment migrations Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/22133 See merge request !6572
| * | | | Support for post deployment migrationsbackground-migrationsYorick Peterse2016-10-311-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are regular Rails migrations that are executed by default. A user can opt-out of these migrations by setting an environment variable during the deployment process. Fixes gitlab-org/gitlab-ce#22133
* | | | | Fix project features default valuesFelipe Artur2016-11-012-8/+10
| | | | |
* | | | | Fix Markdown styling inside reference linkspanjan2016-11-015-42/+44
| |/ / / |/| | | | | | | | | | | Fixes: https://gitlab.com/gitlab-org/gitlab-ce/issues/18096
* | | | Merge branch 'zj-grape-branches' into 'master' Rémy Coutable2016-11-011-66/+57
|\ \ \ \ | |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | GrapeDSL for branches endpoints No changelog item as it doesn't change behaviour Cherry-picket from !6330 See merge request !6630
| * | | GrapeDSL for branches endpointszj-grape-branchesZ.J. van de Weg2016-10-311-66/+57
| | |/ | |/|
* | | Merge branch '22271-drone-tag-pipeline-build' into 'master' Douwe Maan2016-10-312-3/+3
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix lightweight tags not processed correctly by GitTagPushService ## What does this MR do? Fix lightweight tags not processed correctly by GitTagPushService ## Are there points in the code the reviewer needs to double check? No ## Why was this MR needed? Lightweight tags were being processed incorrectly, causing tag triggers to receive wrong information and not function properly. ## 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 [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html) - [ ] 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) ## What are the relevant issue numbers? Closes #22271 See merge request !6532
| * | Fix lightweight tags not processed correctly by GitTagPushService22271-drone-tag-pipeline-buildAlejandro Rodríguez2016-10-282-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | When we updated gitlab_git to 10.4.1, `tag.target` changed from pointing to the sha of the tag to the sha of the commit the tag points to. The problem is that only annotated tags have `object_sha`s, lightweight tags don't (it's nil), so (only) in their case we still need to use `tag.target`.
* | | Ignore teaspoon tasks in production environmentwinniehell2016-10-291-18/+20
| |/ |/|
* | Merge branch 'dz-internal-api-fullpath' into 'master' Dmitriy Zaporozhets2016-10-281-4/+9
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make internal api work with full repo path and name ## What does this MR do? Make internal api work with full repo path and name ## Why was this MR needed? So we can pass full repository path on filesystem from gitlab-shell instead of extracted one. We need this for nested groups support where project is can be nested under several groups. ## What are the relevant issue numbers? https://gitlab.com/gitlab-org/gitlab-ce/issues/2772 See merge request !7148
| * Refactor storage path extraction from full repo pathdz-internal-api-fullpathDmitriy Zaporozhets2016-10-281-6/+1
| | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
| * Make internal api work with full repo path instead of nameDmitriy Zaporozhets2016-10-271-4/+14
| | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* | Merge branch 'adam-fix-labels-find-or-create' into 'master' Douwe Maan2016-10-285-8/+8
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pass user instance to Labels::FindOrCreateService or skip_authorization: true ## What does this MR do? It fixes a bug described in #23694 when `project.owner` was passed to `Labels::FindOrCreateService`. `Labels::FindOrCreateService` expected a user instance and `project.owner` may return a group as well. This MR makes sure that we either pass a user instance or `skip_authorization: true`. ## Are there points in the code the reviewer needs to double check? - places where we pass `skip_authorization: true` ## Does this MR meet the acceptance criteria? - Tests - [x] Added for this feature/bug - [ ] All builds are passing - [ ] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html) - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if it does - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) ## What are the relevant issue numbers? Fixes #23694 See merge request !7093
| * | Pass user instance to Labels::FindOrCreateService or skip_authorization: trueadam-fix-labels-find-or-createAdam Niedzielski2016-10-285-8/+8
| | | | | | | | | | | | | | | | | | Do not pass project.owner because it may return a group and Labels::FindOrCreateService throws an error in this case. Fixes #23694.
* | | Merge branch 'use-optimistic-locking' into 'master' Stan Hu2016-10-281-0/+19
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use optimistic locking ## What does this MR do? Removes the usage of pessimistic locking in favor of optimistic which is way cheaper and doesn't block database operation. Since this is very simple change it should be safe. If we receive `StaleObjectError` message we will reload object a retry operations in lock. However, I still believe that we need this one: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7005 as this will reduce a load on Database and FS. This changes a behavior from: ### Pesimistic locking (previous behavior) #### For updating 1. SELECT * FOR UPDATE (other updates wait on this) 2. we update ci_pipeline 3. latest_build_status 4. enqueue: (use: transition :created -> :pending) 5. [state_machine] we are in state created, we can go to pending 6. [state_machine] ci_pipeline.status = created 7. [state_machine] ci_pipeline.save 8. [state_machine] after_transition: (if for success): PipelineSuccessWorker on Sidekiq 9. release DB lock #### If no update is required 1. SELECT * FOR UPDATE (other updates wait on this) 2. we update ci_pipeline 3. latest_build_status 4. we are in pending, we can't transition to pending, because it's forbidden 5. release DB lock ### Optimistic locking (implemented by this MR) #### For updating 1. latest_build_status 2. enqueue: (use `transition :created -> :pending`) 3. [state_machine] we are in state created, we can go to pending 4. [state_machine] ci_pipeline.status = created 5. [state_machine] ci_pipeline.save 6. [state_machine] [save] where(lock_version: ci_pipeline.lock_version).update_all(status: :created, updated_at: Time.now) 7. [state_machine] [save] unless we_updated_row then raise ObjectInconsistentError #### If no update is required 1. we update ci_pipeline 2. latest_build_status 3. we are in pending, we can't transition to pending, because it's forbidden ## Why was this MR needed? We have been seeing a number of problems when we migrated Pipeline/Build processing to Sidekiq. Especially we started seeing a lot of blocking queries. We used a pessimistic locking which doesn't seem to be required. This effectively allows us to fix our issues with blocked queries by using more efficient method of operation. ## What are the relevant issue numbers? Issues: https://gitlab.com/gitlab-com/infrastructure/issues/623 and https://gitlab.com/gitlab-com/infrastructure/issues/584, but also there's a bunch of Merge Requests that try to improve behavior of scheduled jobs. cc @pcarranza @yorickpeterse @stanhu See merge request !7040
| * | | Make retry_lock to not be infiniteuse-optimistic-lockingKamil Trzcinski2016-10-271-3/+7
| | | |
| * | | Add tests for optimistic lockingKamil Trzcinski2016-10-261-5/+7
| | | |
| * | | Use optimistic lockingKamil Trzcinski2016-10-261-0/+13
| | | |
* | | | Merge branch 'clean-up-issue_spec.js' into 'master' Rémy Coutable2016-10-281-0/+23
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace static fixture by generated one in issue_spec.js ## What does this MR do? - clean up `issue_spec.js` - introduce an alternative approach to #19445 - rename `rake teaspoon` to `rake teaspoon:tests` - introduce `rake teaspoon:fixtures` which generates fixtures using RSpec - introduce `rake teaspoon` which runs `rake teaspoon:fixtures` and `rake teaspoon:tests` ## Why was this MR needed? - many duplications - missing existence checks - missing conditions - static fixtures don't match real views ## Reasoning I want to explain some of my decisions here, so that they stay visible for future discussions. ### Why not HAML? - same number of HAML templates as number of fixtures (many input files) - embedded logic less readable - can not be rendered by JavaScript (because of inline Ruby) ### Why RSpec? - real controllers for fixtures - spys available for mocking - easily report failed fixture generations ### Why not magic_lamp? (#19445) - introduces another dependency/tool - needs to run a server concurrently to teaspoon - makes it harder to use a JavaScript test runner - static HTML files serve faster See merge request !6059
| * | | | Replace static issue fixtures by script (!6059)winniehell2016-10-281-0/+23
| | | | |
* | | | | Merge branch 'fix/make-github-import-retryable' into 'master' Sean McGivern2016-10-288-23/+112
|\ \ \ \ \ | |/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | | Modify GitHub importer to be retryable Closes #23533 See merge request !7003
| * | | | Fix typosfix/make-github-import-retryableAhmad Sherif2016-10-282-2/+2
| | | | |
| * | | | Abstract the use of imported[!?] and {current,increment}_page in GitHub importerAhmad Sherif2016-10-281-50/+34
| | | | |
| * | | | Use public_send instead of sendAhmad Sherif2016-10-281-1/+1
| | | | |
| * | | | Modify GitHub importer to be retryableAhmad Sherif2016-10-287-25/+130
| | | | |
* | | | | Merge branch '23890-api-should-accepts-boolean' into 'master' Sean McGivern2016-10-281-0/+1
|\ \ \ \ \ | |/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | API: Fix booleans not recognized as such when using the `to_boolean` helper Fixes #22831 Fixes #23890 See merge request !7149
| * | | | API: Fix booleans not recognized as such when using the `to_boolean` helper23890-api-should-accepts-booleanRémy Coutable2016-10-271-0/+1
| | |/ / | |/| | | | | | | | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* | | | Merge branch 'fix/gh-import-bugs' into 'master' Sean McGivern2016-10-282-13/+23
|\ \ \ \ | |/ / / |/| | | | | | | | | | | | | | | | | | | Fix couple of GitHub importing bugs Fix a bug in GH comment importing and label applying for imported MRs. See merge request !7139
| * | | Fix importing MR comments from GitHubfix/gh-import-bugsAhmad Sherif2016-10-271-6/+7
| | | |
| * | | Fix applying labels for GitHub-imported MRsAhmad Sherif2016-10-272-7/+16
| | |/ | |/|
* | | Merge branch '21645-mail_room_sentinel'Douwe Maan2016-10-272-1/+14
|\ \ \ | |/ / |/| |
| * | Updated mail_room and added sentinel support to Reply by Email21645-mail_room_sentinelGabriel Mazetto2016-10-262-1/+14
| | |
* | | Merge branch '5613-backups-fail' into 'master' Douwe Maan2016-10-271-16/+76
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backups fail occasionally with "tar: ./objects: file changed as we read it" error - [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 - [x] All builds are passing - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] 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) Closes #5613 See merge request !5814