summaryrefslogtreecommitdiff
path: root/lib/gitlab
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'stanhu/gitlab-ce-fix-error-500-with-mr-images' into 'master' Douwe Maan2016-11-151-5/+8
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix Error 500 when creating a merge request that contains an image that was deleted and added _Originally opened at !4816 by @stanhu._ - - - ## What does this MR do? This MR fixes an Error 500 when creating a merge request that contains an image that was deleted and added. Before, when displaying the before and after image, the code would always retrieve the image from the parent commit. However, in a diff, this could cause two different problems: The "before" image may not actually be the image you want to compare against (regression of #14327) It may appear as though a file was modified when it was really just added during the diff ## Are there points in the code the reviewer needs to double check? There may be a more elegant to fix this bug. ## What are the relevant issue numbers? Closes #3893, gitlab-org/gitlab-ee#678 See merge request !7457
| * Fix Error 500 when creating a merge request that contains an image that was ↵stanhu/gitlab-ce-fix-error-500-with-mr-imagesStan Hu2016-11-141-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | deleted and added Steps to reproduce: 1. Start with a repo with an image 2. Add a commit to delete the image 3. Add another commit to replace the image with another image In a diff comparison, we really just compare about what the image was before the diff, not the direct parent of the last commit. This MR fixes that. Closes #3893, gitlab-org/gitlab-ee#678 Signed-off-by: Rémy Coutable <remy@rymai.me>
* | Merge branch 'fix_saml_ldap_link' into 'master' Douwe Maan2016-11-151-0/+2
|\ \ | |/ |/| | | | | | | | | Omniauth auto link LDAP user falls back to find by DN when user cannot be found by uid Unfortunately, SAML IDs can be an LDAP UID, DN, or something else entirely. UID and DN are most common, though. This adds a fallback scenario so we first try to find a matching LDAP user by UID, then by DN. This will fix a problem for the customer in https://gitlab.zendesk.com/agent/tickets/43298 See merge request !7002
| * Omniauth auto link LDAP user falls back to find by DN when user cannot be ↵Drew Blessing2016-11-101-0/+2
| | | | | | | | found by uid
* | Merge branch 'fix/improve-naming-convention-in-ci-config' into 'master' Kamil Trzciński2016-11-1429-105/+103
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Improve naming convention in ci configuration module ## What does this MR do? This MR improves the naming convention in CI configuration module to reflect the domain design better. ## What are the relevant issue numbers? Related to #15060 See merge request !7448
| * | Fix indentation in CI variables entry classGrzegorz Bizon2016-11-141-1/+1
| | |
| * | Change name of method for setting CI config entriesGrzegorz Bizon2016-11-144-26/+26
| | |
| * | Improve naming convention in ci configuration modulefix/improve-naming-convention-in-ci-configGrzegorz Bizon2016-11-1429-104/+102
| | |
* | | Merge branch 'sh-fix-sidekiq-throttling-init' into 'master' Robert Speicher2016-11-141-1/+1
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Only turn on Sidekiq throttling if column exists If the database has not been migrated properly, the initializer for Sidekiq will fail to start and cause the whole Rails server to crash. This change checks the existence for the column and allows Rails to start even if the setting has not been added as a database column. Closes #24452 See merge request !7446
| * | | Only turn on Sidekiq throttling if application settings existssh-fix-sidekiq-throttling-initStan Hu2016-11-121-1/+1
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | If the database has not been migrated properly, the initializer for Sidekiq will fail to start and cause the whole Rails server to crash. This change checks the existence for the column and allows Rails to start even if the setting has not been added as a database column. Closes #24452
* | | Merge branch 'user_filter_auth' into 'master' Rémy Coutable2016-11-143-14/+61
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Centralized all LDAP config logic in to `Gitlab::LDAP::Config`. We had varying configuration for devise/omniauth and other things. For example, `user_filter` was never taken in to account for devise/omniauth so a user object would always be created, even if the user did not match the user_filter. Fixes gitlab-org/gitlab-ce#21195, https://gitlab.com/gitlab-org/gitlab-ce/issues/15396 and gitlab-org/gitlab-ce#13296 See merge request !6606
| * | | Centralize LDAP config/filter logicDrew Blessing2016-11-113-14/+61
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | Centralize all LDAP config logic in `GitLab::LDAP::Config`. Previously, some logic was in the Devise initializer and it was not honoring the `user_filter`. If a user outside the configured `user_filter` signed in, an account would be created but they would then be denied access. Now that logic is centralized, the filter is honored and users outside the filter are never created.
* | | Merge branch 'repository-name-emojis' into 'master' Rémy Coutable2016-11-141-3/+3
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | Added ability to put emojis into repository name ## Are there points in the code the reviewer needs to double check? Ensure that regexp used is correct, I used the following list: http://www.unicode.org/Public/emoji/1.0/emoji-data.txt See merge request !7420
| * | Added ability to put emojis into repository nameVincent Composieux2016-11-121-3/+3
| |/ | | | | | | Added ability to put emojis into repository name
* | Merge branch 'sidekiq-job-throttling' into 'master' Douwe Maan2016-11-112-0/+28
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow certain Sidekiq jobs to be throttled ## What does this MR do? Allows certain slow running Sidekiq jobs to be throttled. It is disabled by default and can be enabled via the Application Settings. ![Screen_Shot_2016-11-04_at_4.51.24_PM](/uploads/a1f1d24c693fcdb278602765cd404d94/Screen_Shot_2016-11-04_at_4.51.24_PM.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) - Tests - [x] Added for this feature/bug - [x] All builds are passing ## What are the relevant issue numbers? Related to #23352 See merge request !7292
| * | Refactored Sidekiq Throttler and updated documentationsidekiq-job-throttlingPatricio Cano2016-11-111-6/+8
| | |
| * | Refactored initializer code to its own class and added testsPatricio Cano2016-11-101-0/+21
| | |
| * | Allow the Sidekiq queues to throttle and the factor by which to throttle ↵Patricio Cano2016-11-101-0/+4
| | | | | | | | | | | | them to be configurable
| * | Allow certain Sidekiq jobs to be throttledPatricio Cano2016-11-101-0/+1
| |/
* | Merge branch 'adam-fix-collapsed-diff-symlink-file-conversion' into 'master' Sean McGivern2016-11-112-2/+2
|\ \ | |/ |/| | | | | | | | | | | Fix the collapsed diff when converting a symlink to a regular file #21610 !6828 See merge request !6953
| * Fix expanding a collapsed diff when converting a symlink to a regular fileadam-fix-collapsed-diff-symlink-file-conversionAdam Niedzielski2016-11-102-2/+2
| | | | | | | | | | In this case comparing old_path and new_path is not enough because there are two entires that match.
* | Improve EeCompatCheck, cache EE repo and keep artifacts for the ↵23945-improve-ee_compat_check-task-part-3Rémy Coutable2016-11-101-71/+81
|/ | | | | | ee_compat_check task Signed-off-by: Rémy Coutable <remy@rymai.me>
* Merge branch 'ldap_check_bind' into 'master' Sean McGivern2016-11-091-4/+4
|\ | | | | | | | | | | | | Improve ldap:check errors Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/21621. See merge request !6601
| * Introduce better credential and error checking to `rake gitlab:ldap:check`Drew Blessing2016-11-081-4/+4
| | | | | | | | | | | | | | It was previously possible for invalid credential errors to go unnoticed in this task. Users would believe everything was configured correctly and then sign in would fail with 'invalid credentials'. This adds a specific bind check, plus catches errors connecting to the server. Also, specs :)
* | Merge branch '23403-fix-events-for-private-project-features' into 'security'Robert Speicher2016-11-091-25/+49
| | | | | | | | | | | | | | | | | | | | | | | | Respect project visibility settings in the contributions calendar This MR fixes a number of bugs relating to access controls and date selection of events for the contributions calendar Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/23403 See merge request !2019 Signed-off-by: Rémy Coutable <remy@rymai.me>
* | Merge branch 'fix-unathorized-cloning' into 'security'Douwe Maan2016-11-091-31/+60
| | | | | | | | | | | | | | | | | | | | Ensure external users are not able to clone disabled repositories. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/23788 See merge request !2017 Signed-off-by: Rémy Coutable <remy@rymai.me>
* | Merge branch 'faster_project_search' into 'master' Sean McGivern2016-11-081-18/+12
|\ \ | | | | | | | | | | | | Faster search inside Project See merge request !7353
| * | Faster searchfaster_project_searchValery Sizov2016-11-081-18/+12
| | |
* | | Merge branch 'dz-refactor-namespace-regex' into 'master' Sean McGivern2016-11-081-0/+4
|\ \ \ | |/ / |/| | | | | | | | | | | | | | Refactor namespace regex Reuse existing namespace regex constant in routing See merge request !7336
| * | Refactor namespace regexdz-refactor-namespace-regexDmitriy Zaporozhets2016-11-071-0/+4
| | | | | | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* | | Merge branch 'use-separate-token-for-incoming-email' into 'master' Douwe Maan2016-11-083-7/+16
|\ \ \ | |/ / |/| | | | | | | | Use separate email-friendly token for incoming email See merge request !5914
| * | implements reset incoming email token on issues modal and account page,use-separate-token-for-incoming-emailtiagonbotelho2016-11-072-3/+12
| | | | | | | | | | | | reactivates all tests and writes more tests for it
| * | Use separate email-friendly token for incoming email and let incomingDouwe Maan2016-11-071-4/+4
| |/ | | | | | | email token be reset
* | Merge branch 'jacobvosmaer-gitlab/gitlab-ce-git-gc-improvements' into 'master' Douwe Maan2016-11-072-53/+26
|\ \ | |/ |/| | | | | | | | | | | | | Use more than one kind of Git garbage collection Replaces https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6588 by @jacobvosmaer to get the builds to pass :) Closes #22729 See merge request !7321
| * Refine Git garbage collectionJacob Vosmaer2016-11-042-53/+26
| |
* | Cache imported GH labels no matter whatfix/gh-imported-labels-are-not-applied-correctlyAhmad Sherif2016-11-041-6/+3
| |
* | Fix applying GitHub-imported labels when importing job is interruptedAhmad Sherif2016-11-041-0/+10
|/ | | | Closes #24075
* 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 '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>
* Fix project features default valuesFelipe Artur2016-11-011-0/+8
|
* Fix lightweight tags not processed correctly by GitTagPushService22271-drone-tag-pipeline-buildAlejandro Rodríguez2016-10-281-1/+1
| | | | | | | | 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`.
* Merge branch 'adam-fix-labels-find-or-create' into 'master' Douwe Maan2016-10-284-7/+7
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-284-7/+7
| | | | | | | | | | | | 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
| | |
* | | 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
| | |