summaryrefslogtreecommitdiff
path: root/spec/services
Commit message (Collapse)AuthorAgeFilesLines
* Properly abort a merge when merge conflicts occurreject-merge-conflictsStan Hu2016-07-291-0/+11
| | | | | | | | | | | If somehow a user attempted to accept a merge request that had conflicts (e.g. the "Accept Merge Request" button or the MR itself was not updated), `MergeService` did not properly detect that a conflict occurred. It would assume that the MR went through without any issues and close the MR as though everything was fine. This could cause data loss if the source branch were removed. Closes #20425
* Use `Gitlab::Access` to protected branch access levels.Timothy Andrew2016-07-291-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | 1. It makes sense to reuse these constants since we had them duplicated in the previous enum implementation. This also simplifies our `check_access` implementation, because we can use `project.team.max_member_access` directly. 2. Use `accepts_nested_attributes_for` to create push/merge access levels. This was a bit fiddly to set up, but this simplifies our code by quite a large amount. We can even get rid of `ProtectedBranches::BaseService`. 3. Move API handling back into the API (previously in `ProtectedBranches::BaseService#translate_api_params`. 4. The protected branch services now return a `ProtectedBranch` rather than `true/false`. 5. Run `load_protected_branches` on-demand in the `create` action, to prevent it being called unneccessarily. 6. "Masters" is pre-selected as the default option for "Allowed to Push" and "Allowed to Merge". 7. These changes were based on a review from @rymai in !5081.
* Fix `git_push_service_spec`Timothy Andrew2016-07-291-1/+2
| | | | | | | | | 1. Caused by incorrect test setup. The user wasn't added to the project, so protected branch creation failed authorization. 2. Change setup for a different test (`Event.last` to `Event.find_by_action`) because our `project.team << ...` addition was causing a conflict.
* Fix default branch protection.Timothy Andrew2016-07-291-5/+12
| | | | 1. So it works with the new data model for protected branch access levels.
* Merge branch 'fix-data-integrity-issue-with-repository-downloads-path' into ↵Douwe Maan2016-07-211-0/+81
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'master' Avoid data-integrity issue when cleaning up repository archive cache ## What does this MR do? Sets the default value for `repository_downloads_path` if someone has it configured incorrectly, and it points to the path where repositories are stored. It's also replace invocation of `find` with Ruby code that matches old cached files in a better, and safe way to avoid data-integrity issues. ## Why was this MR needed? The `repository_downloads_path` is used by the `RepositoryArchiveCacheWorker` to remove outdated repository archives, if it points to the wrong directory can cause some data-integrity issue. ## What are the relevant issue numbers? Closes #14222 See merge request !5285
| * Extract helper methods to clean up RepositoryArchiveCleanUpService specDouglas Barbosa Alexandre2016-07-211-66/+37
| |
| * Use Dir.mktmpdir instead of FileUtils.mkdir_p in the specDouglas Barbosa Alexandre2016-07-211-48/+56
| |
| * Use find instead Ruby to remove files due to performance reasonsDouglas Barbosa Alexandre2016-07-211-19/+8
| |
| * Cover the behavior RepositoryArchiveCleanUpService with testsDouglas Barbosa Alexandre2016-07-211-7/+89
| |
| * Add service to clean up repository archive cacheDouglas Barbosa Alexandre2016-07-211-0/+31
| | | | | | | | | | Replace invocation of `find` with Ruby code that matches old cached files in a better, and safe way to avoid data-integrity issues.
* | Merge branch 'rs-bulk-issues-update-spec' into 'master' Robert Speicher2016-07-211-76/+55
|\ \ | |/ |/| | | | | | | | | | | | | | | | | Refactor Issues::BulkUpdateService spec - Create fewer Issue objects; 2 is as good as 5 for these cases. This gives us a nice little speed improvement. - Don't `describe` Symbols. - Simplify object creation. - Lessen "mystery guest" antipattern See merge request !5380
| * Refactor Issues::BulkUpdateService specrs-bulk-issues-update-specRobert Speicher2016-07-201-76/+55
| | | | | | | | | | | | | | | | - Create fewer Issue objects; 2 is as good as 5 for these cases. This gives us a nice little speed improvement. - Don't `describe` Symbols. - Simplify object creation. - Lessen "mystery guest" antipattern
* | Get rid of `is_image` in FileUploaderRémy Coutable2016-07-192-12/+0
|/ | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* Merge branch 'caironoleto/gitlab-ce-cn-issue-19747'Douwe Maan2016-07-181-0/+38
|\
| * Allow bulk (un)subscription from issues in issue indexCairo Noleto2016-07-141-0/+38
| | | | | | | | fixies #19747
* | Merge branch 'undo-revert-of-4892' into 'master' 19396-api-allow-admin-owner-to-set-timestamp-when-changing-issue-stateRémy Coutable2016-07-182-4/+13
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revert "Revert "Merge branch '18193-developers-can-merge' into 'master'"" ## What does this MR do? Reverts the revert of !4892 which lacked an EE MR at the time. This has been done in gitlab-org/gitlab-ee!564. ## What are the relevant issue numbers? Closes #19872. See merge request !5310
| * | Revert "Revert "Merge branch '18193-developers-can-merge' into 'master' ""Rémy Coutable2016-07-182-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 530f5158e297f3cde27f3566cfe13bad74ba3b50. See !4892. Signed-off-by: Rémy Coutable <remy@rymai.me>
* | | Merge branch 'track-pipeline-user' into 'master' Rémy Coutable2016-07-181-1/+2
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Track a user who creates a Pipeline ## What does this MR do? This adds additional column to pipelines to track user who is creating pipelines. ## Why was this MR needed? This is to make it possible to show all pipelines created by specific user and to later solve: https://gitlab.com/gitlab-org/gitlab-ce/issues/18054 ## What are the relevant issue numbers? Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/18992 - [ ] [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) See merge request !5272
| * | | Make rubocop happytrack-pipeline-userKamil Trzcinski2016-07-151-1/+1
| | | |
| * | | Track a user who created a pipelineKamil Trzcinski2016-07-151-1/+2
| | |/ | |/|
* | | Merge branch 'fix-deployment-creation-on-build-retry' into 'master' Rémy Coutable2016-07-181-0/+16
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix creation of deployment on build that is retried, redeployed or rollback ## What does this MR do? Add missing `environment` to be copied when retrying a build. ## Why was this MR needed? The retried builds did not create a deployments. ## What are the relevant issue numbers? Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/19521 - [ ] [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) See merge request !5275
| * | | Fix creation of deployment on build that is retried, redeployed or rollbackfix-deployment-creation-on-build-retryKamil Trzcinski2016-07-161-0/+16
| | |/ | |/|
* | | Merge branch 'allow-to-pull-public-images' into 'master' Rémy Coutable2016-07-181-25/+79
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow to access Container Registry for Public and Internal projects ## What does this MR do? Adds missing ability `read_container_image` for `public scope` which affects users accessing public and internal projects. ## Why was this MR needed? Previously, we allowed to use container registry for anonymous users, but did not allow to do the same for logged in. This MR makes it possible. ## What are the relevant issue numbers? Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/18176 https://gitlab.com/gitlab-org/gitlab-ce/issues/19668 https://gitlab.com/gitlab-org/gitlab-ce/issues/19117 ## 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) See merge request !5279
| * | Allow to access Container Registry for Public and Internal projectsallow-to-pull-public-imagesKamil Trzcinski2016-07-151-25/+79
| |/
* | Merge branch ↵Douwe Maan2016-07-151-15/+20
|\ \ | | | | | | | | | 'kradydal/gitlab-ce-create-todos-when-issue-author-assigne-or-mention-himself'
| * | When Issue author assign or mention himself Todos are createdKatarzyna Kobierska2016-07-141-15/+20
| |/
* | Fix mentioned users list on diff notesDouglas Barbosa Alexandre2016-07-151-0/+18
|/
* Revert "Merge branch '18193-developers-can-merge' into 'master' "Robert Speicher2016-07-132-13/+4
| | | | | This reverts commit 9ca633eb4c62231e4ddff5466c723cf8e2bdb25d, reversing changes made to fb229bbf7970ba908962b837b270adf56f14098f.
* Implement last round of review comments from !4892.18193-developers-can-mergeTimothy Andrew2016-07-131-1/+2
| | | | | | | | 1. Fix typos, minor styling errors. 2. Use single quotes rather than double quotes in `user_access_spec`. 3. Test formatting.
* Enforce "developers can merge" during `pre-receive`.Timothy Andrew2016-07-131-2/+1
| | | | | | | | | | | | | | 1. When a merge request is being merged, save the merge commit SHA in the `in_progress_merge_commit_sha` database column. 2. The `pre-receive` hook looks for any locked (in progress) merge request with `in_progress_merge_commit_sha` matching the `newrev` it is passed. 3. If it finds a matching MR, the merge is legitimate. 4. Update `git_access_spec` to test the behaviour we added here. Also refactored this spec a bit to make it easier to add more contexts / conditions.
* Added "developers can merge" setting to protected branchesMathias Vestergaard2016-07-131-2/+11
| | | | | - Cherry-picked from `mvestergaard:branch-protection-dev-merge` - https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/4220
* Avoid `describe`-ing symbols in specsrs-describe-symbolsRobert Speicher2016-07-1217-27/+27
|
* Reset project pushes_since_gc when we enqueue the git gc callPaco Guzman2016-07-121-9/+33
|
* Expire the branch cache after `git gc` runsStan Hu2016-07-121-2/+2
| | | | | | | Due to a stale NFS cache, it's possible that a branch lookup fails while `git gc` is running and causes missing branches in merge requests. Possible workaround for #15392
* Allow SentNotification#position to be set as string or hashDouwe Maan2016-07-111-0/+24
|
* Add comment with diff to DiffPositionUpdateService specnew-diff-notesDouwe Maan2016-07-071-0/+104
|
* Add tests for DiffPositionUpdateServiceDouwe Maan2016-07-061-0/+71
|
* Rename MergeRequest methods that return commits or shas to be more clear and ↵Douwe Maan2016-07-061-1/+1
| | | | consistent
* Handle custom Git hook result in GitLab UIValery Sizov2016-07-041-0/+10
|
* Better message for git hooks and file locksValery Sizov2016-07-042-7/+7
|
* Enable Style/EmptyLines cop, remove redundant onesrubocop/enable-cops-for-empty-linesGrzegorz Bizon2016-07-015-15/+0
|
* Merge branch 'fix-external-issue-rendering' into 'master' Robert Speicher2016-06-301-0/+2
|\ | | | | | | | | | | | | | | | | Handle external issues in IssueReferenceFilter Rendering issue references such as `#1` was broken for projects using an external issues tracker. See gitlab-org/gitlab-ce#19036 See merge request !4988
| * Fix broken spec in git_push_service_spec by stubbing an external issue trackerfix-external-issue-renderingStan Hu2016-06-301-0/+2
| |
* | Expire branch/tag git data when needed.18709-branch-tag-collection-cachingPaco Guzman2016-06-302-0/+61
| | | | | | | | | | | | | | | | | | | | When pushing commits to existing branches we don’t need to flush branch git data (branch names / counts) When flushes the cache when pushing commits skip to flush branch and tag git data (names / counts) because those operations are managed explicitly in each case Repopulated expired cache as soon as possible
* | Refactor repository paths handling to allow multiple git mount pointsAlejandro Rodríguez2016-06-293-11/+11
|/
* Merge branch 'fix-18997' into 'master' Robert Speicher2016-06-271-0/+59
|\ | | | | | | | | | | | | Fix visibility of snippets when searching Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/18997 See merge request !1972
| * Fix visibility of private project snippets for members when searchingDouglas Barbosa Alexandre2016-06-221-8/+30
| |
| * Fix internal snippets can be searched by anyoneDouglas Barbosa Alexandre2016-06-221-0/+37
| |
* | Add support for "skip ci" tooSimon Welsh2016-06-251-1/+32
| |
* | Allow "ci skip" to be in any caseSimon Welsh2016-06-251-0/+15
|/