summaryrefslogtreecommitdiff
path: root/spec/lib
Commit message (Collapse)AuthorAgeFilesLines
* Refactored Sidekiq Throttler and updated documentationsidekiq-job-throttlingPatricio Cano2016-11-111-6/+0
|
* Refactored initializer code to its own class and added testsPatricio Cano2016-11-101-0/+34
|
* Merge branch 'ldap_check_bind' into 'master' Sean McGivern2016-11-091-4/+35
|\ | | | | | | | | | | | | 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/+35
| | | | | | | | | | | | | | 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-0/+104
| | | | | | | | | | | | | | | | | | | | | | | | 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-092-1/+26
| | | | | | | | | | | | | | | | | | | | 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 'markdown-xss-fix-option-2.1' into 'security'Douwe Maan2016-11-091-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | Fix for HackerOne XSS vulnerability in markdown This is an updated blacklist patch to fix https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/2007. No text is removed. Dangerous schemes/protocols and invalid URIs are left intact but not linked. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/23153 See merge request !2015 Signed-off-by: Rémy Coutable <remy@rymai.me>
* | Merge branch 'issue_23548_dev' into 'master'Douwe Maan2016-11-0914-56/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | disable markdown in comments when referencing disabled features fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/23548 This MR prevents the following references when tool is disabled: - issues - snippets - commits - when repo is disabled - commit range - when repo is disabled - milestones This MR does not prevent references to repository files, since they are just markdown links and don't leak information. See merge request !2011 Signed-off-by: Rémy Coutable <remy@rymai.me>
* | Merge branch 'dz-refactor-contraints' into 'master' Dmitriy Zaporozhets2016-11-084-42/+42
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor routing constraints ## What does this MR do? Refactors routing constraints ## Why was this MR needed? This refactoring make it possible to introduce nesting namespaces and project constrainer in future. ## What are the relevant issue numbers? Extracted from https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7121/ See merge request !7327
| * | Add small improvements to constrainers and specsDmitriy Zaporozhets2016-11-082-2/+2
| | | | | | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
| * | Refactor routing constraintsDmitriy Zaporozhets2016-11-074-42/+42
| | | | | | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* | | Merge branch 'use-separate-token-for-incoming-email' into 'master' Douwe Maan2016-11-081-4/+4
|\ \ \ | |/ / |/| | | | | | | | 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-071-1/+1
| | | | | | | | | | | | reactivates all tests and writes more tests for it
| * | Use separate email-friendly token for incoming email and let incomingDouwe Maan2016-11-071-3/+3
| |/ | | | | | | email token be reset
* | Refine Git garbage collectionJacob Vosmaer2016-11-042-7/+21
|/
* Merge branch 'fix/import-export-symlink-vulnerability' into 'security'Douwe Maan2016-11-033-1/+71
| | | | | | | | | | | | 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-031-2/+5
| | | | | | | | | | | | 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 'allow-owner-to-run-ci-builds' into 'master' Rémy Coutable2016-11-021-0/+8
|\ | | | | | | | | | | | | | | | | | | | | Allow owners to fetch source code in CI builds Due to different way of handling owners of a project, they were not allowed to fetch CI sources for project. This adds a separate code path for handling owners, that are not admins. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/23437 See merge request !6943
| * Allow owners to fetch source code in CI buildsallow-owner-to-run-ci-buildsKamil Trzcinski2016-11-011-0/+8
| | | | | | | | Due to different way of handling owners of a project, they were not allowed to fetch CI sources for project.
* | Fix project features default valuesFelipe Artur2016-11-011-0/+35
| |
* | Fix Markdown styling inside reference linkspanjan2016-11-015-33/+116
|/ | | | Fixes: https://gitlab.com/gitlab-org/gitlab-ce/issues/18096
* Merge branch 'use-optimistic-locking' into 'master' Stan Hu2016-10-282-0/+41
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0/+11
| |
| * Fix optimistic lockingKamil Trzcinski2016-10-261-0/+2
| |
| * Add tests for optimistic lockingKamil Trzcinski2016-10-261-0/+28
| |
* | Modify GitHub importer to be retryableAhmad Sherif2016-10-281-2/+5
| |
* | Merge branch 'fix/gh-import-bugs' into 'master' Sean McGivern2016-10-281-0/+1
|\ \ | | | | | | | | | | | | | | | | | | Fix couple of GitHub importing bugs Fix a bug in GH comment importing and label applying for imported MRs. See merge request !7139
| * | Fix applying labels for GitHub-imported MRsAhmad Sherif2016-10-271-0/+1
| |/
* | Merge branch '21645-mail_room_sentinel'Douwe Maan2016-10-271-0/+49
|\ \ | |/ |/|
| * Updated mail_room and added sentinel support to Reply by Email21645-mail_room_sentinelGabriel Mazetto2016-10-261-0/+49
| |
* | Don't schedule ProjectCacheWorker unless neededproject-cache-worker-schedulingYorick Peterse2016-10-251-14/+29
|/ | | | | | This changes ProjectCacheWorker.perform_async so it only schedules a job when no lease for the given project is present. This ensures we don't end up scheduling hundreds of jobs when they won't be executed anyway.
* Add failing test for #21420winniehell2016-10-241-11/+29
|
* Add relative url support to routing contrainersDmitriy Zaporozhets2016-10-241-0/+10
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Preserve note_type and position for notes from emailsLin Jen-Shin2016-10-201-11/+13
| | | | Closes #23208
* Merge branch 'feature/group-level-labels' into 'master' Douwe Maan2016-10-199-17/+226
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add group level labels ## What does this MR do? Add group level labels. ## Are there points in the code the reviewer needs to double check? * `LabelsFinder` * `Gitlab::Gfm::ReferenceRewriter` * `Banzai::Filter::LabelReferenceFilter` ## Why was this MR needed? We'll be adding more feature that allow you to do cross-project management of issues. ## Screenshots (if relevant) * Group Labels ![Group Labels](/uploads/2244c06ad68eae4fb246fb4c81bf8060/2.png) * Project Labels ![Project Labels](/uploads/c5839516d2282b51f7418d9dadbeceb4/1.png) * Expanded references for group labels when moving issue to another project ![Expanded references for group labels when moving issue to another project](/uploads/0c9ab248a8420d4978d59349ae3d42e5/3.png) ## Does this MR meet the acceptance criteria? - [x] [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) - [x] API support added - 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) - [ ] 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) ## What are the relevant issue numbers? #19997 See merge request !6425
| * Update specs to cope with new label types and prioritiesJames Lopez2016-10-195-9/+51
| | | | | | | | | | | | Fixed all related specs and also changed the logic to handle edge cases. This includes exporting and exporting of group labels, which will get associated with the new group (if any) or they will become normal project labels otherwise. Found other issues to do with not being able to import all labels at once in the beginning of the JSON - code was much simpler when we import all labels and milestones associated to a project first, then the associations will find the already created labels instead of creating them from the associations themselves.
| * Fix GitHub importer specDouglas Barbosa Alexandre2016-10-191-1/+1
| |
| * Reuse LabelsFinder on Issueable#add_labels_by_namesDouglas Barbosa Alexandre2016-10-191-3/+4
| |
| * fix rubocop warningJames Lopez2016-10-191-2/+4
| |
| * Fix import/export labels to cope with project and group labels. Added ↵James Lopez2016-10-193-6/+66
| | | | | | | | relevant specs.
| * Unfold references for group labels when moving issue to another projectDouglas Barbosa Alexandre2016-10-192-3/+105
| |
| * Add Label attributes: type, and group_id to safe model attributesDouglas Barbosa Alexandre2016-10-191-0/+2
| |
* | Merge branch 'issue_828' into 'master' Douwe Maan2016-10-192-26/+63
|\ \ | |/ |/| | | | | | | | | Prevent wrong markdown on issue ids when project has Jira service activated fixes gitlab-org/gitlab-ee#828 See merge request !6728
| * Prevent wrong markdown on issue ids when project has Jira service activatedissue_828Felipe Artur2016-10-192-26/+63
| |
* | Merge branch 'fix-escaping' into 'master' Sean McGivern2016-10-191-0/+5
|\ \ | |/ |/| | | | | fix: commit messages being double-escaped in activities tab See merge request !6937
| * fix: commit messages being double-escaped in activies tabamaia2016-10-181-0/+5
| |
* | Merge branch 'backport-git-access-spec-changes' into 'master' Douwe Maan2016-10-191-6/+6
|\ \ | | | | | | | | | | | | | | | | | | Backport git access spec changes from EE https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/645#note_16391185 See merge request !6961
| * | Backport git access spec changes from EEbackport-git-access-spec-changesSean McGivern2016-10-181-6/+6
| |/ | | | | | | | | These were introduced in: <https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/645>
* | Merge branch '22191-delete-dynamic-envs-mr' into 'master' Rémy Coutable2016-10-192-2/+110
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Delete dynamic environments - Adds "close environment" action to a merge request - Adds tabs to environments list - Adds close button to each environment row in environments list - Replaces Destroy button with Close button inside an environment - Adds close button to builds list inside an environment #### Configuration In order to enable stopping environments a valid `.gitlab-ci.yml` syntax has to be used: ``` review: environment: name: review/$app on_stop: stop_review stop_review: script: echo Delete My App when: manual environment: name: review/$app action: stop ``` This MR requires that `stop_review` has to have: `when`, `environment:name` and `environment:action` defined. The next MR after this one will verify that and enforce that these settings are configured. It will also implicitly configure these settings, making it possible to define it like this: ``` review: environment: name: review/$app on_stop: stop_review stop_review: script: echo Delete My App ``` Closes #22191 See merge request !6669
| * \ Merge remote-tracking branch 'origin/master' into 22191-delete-dynamic-envs-mr22191-delete-dynamic-envs-mrKamil Trzcinski2016-10-181-0/+1
| |\ \