summaryrefslogtreecommitdiff
path: root/spec/services
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch '23589-open-issue-for-mr' into 'master' Sean McGivern2016-12-064-0/+253
|\ | | | | | | | | Create an issue for all unresolved discussions in an MR See merge request !7180
| * Feature: delegate all open discussions to IssueBob Van Landuyt2016-12-054-0/+253
| | | | | | | | | | | | | | | | | | | | | | | | | | When a merge request can only be merged when all discussions are resolved. This feature allows to easily delegate those discussions to a new issue, while marking them as resolved in the merge request. The user is presented with a new issue, prepared with mentions of all unresolved discussions, including the first unresolved note of the discussion, time and link to the note. When the issue is created, the discussions in the merge request will get a system note directing the user to the newly created issue.
* | Merge branch 'glm-shorthand-reference' into 'master' Sean McGivern2016-12-062-3/+3
|\ \ | |/ |/| | | | | | | | | GLM shorthand reference for projects from the same namespace Closes #21679 See merge request !7255
| * Add shorthand support to gitlab markdown referencesOswaldo Ferreira2016-12-022-3/+3
| |
* | Merge branch 'refactor-create-service-spec' into 'master' Dmitriy Zaporozhets2016-12-051-106/+106
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor create service spec ## What does this MR do? Use let instead instance variables to cache create user operation. Union some example into one. ## Are there points in the code the reviewer needs to double check? ## Why was this MR needed? Time before: 1 minute 11.81 seconds Time after: 52.47 seconds - [x] [Changelog entry](https://docs.gitlab.com/ce/development/changelog.html) added - n/a [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - n/a API support added - Tests - n/a Added for this feature/bug - [x] 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? See merge request !7609
| * | Refactor create service specSemyon Pupkov2016-11-221-106/+106
| | | | | | | | | | | | | | | before: 1 minute 11.81 seconds after: 52.47 seconds
* | | Merge branch 'fix/rename-mwbs-to-merge-when-pipeline-succeeds' into 'master' Kamil Trzciński2016-12-052-8/+14
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename MWBS service to Merge When Pipeline Succeeds ## What does this MR do? This MR renames Merge When Build Succeeds feature to Merge When Pipeline Succeeds, because we recently changed the behavior, see https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6675. ## 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] All builds are passing ## What are the relevant issue numbers? Closes #23354 See merge request !7135
| * | Merge branch 'master' into fix/rename-mwbs-to-merge-when-pipeline-succeedsGrzegorz Bizon2016-11-306-82/+104
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (110 commits) Rewrite an HTTP link to use HTTPS Edit /spec/features/profiles/preferences_spec.rb to match changes in 084d90ac Add blue back to sub nav active Remove JSX/React eslint plugins. Fix a transient spec failure Adds hoverstates for collapsed Issue/Merge Request sidebar Moved groups above projects Add StackProf to the Gemfile, along with a utility to get a profile for a spec Update Sidekiq-cron to fix compatibility issues with Sidekiq 4.2.1 Add a CHANGELOG entry Alert user when logged in user email is not the same as the invitation Expose timestamp in build entity used by serializer Rename `MergeRequest#pipeline` to `head_pipeline` Remove unnecessary database indexes CE-specific changes gitlab-org/gitlab-ee#1137 Fixing typo & Clarifying Key name fix started_at check fix blob controller spec failure - updated not to use file-path- fix blob controller spec failure Merge branch 'jej-use-issuable-finder-instead-of-access-check' into 'security' ... Conflicts: app/controllers/projects/merge_requests_controller.rb lib/api/merge_requests.rb spec/requests/api/merge_requests_spec.rb
| * \ \ Merge branch 'master' into fix/rename-mwbs-to-merge-when-pipeline-succeedsGrzegorz Bizon2016-11-2514-185/+311
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (312 commits) Fix bad selection on dropdown menu for tags filter Fixed issue boards scrolling with a lot of lists & issues You can only assign default_branch when editing a project ... Don't convert data which already is the target type Stop supporting Google and Azure as backup strategies renames some of the specs and adds changelog entry Fixed dragging issue moving wrong issue after multiple drags of issue Fixed issue boards issue sorting when dragging issue into list Rephrase some system notes to be compatible with new system note style Add missing JIRA file that redirects to the new location Fix documentation to create the `pg_trm` extension before creating the DB Document that we always use `do...end` for `before` in RSpec Backport Note#commands_changes from EE Log mv_namespace parameters Add default_branch attr to Project API payload in docs. Fix title case to sentence case properly escape username validation error message flash Remove header ids from University docs Add missing documentation. Added test that checks the correct select box is there for the LFS ... ... Conflicts: app/services/system_note_service.rb spec/features/merge_requests/merge_when_pipeline_succeeds_spec.rb spec/services/merge_requests/merge_when_pipeline_succeeds_service_spec.rb spec/services/system_note_service_spec.rb
| * | | | Rename MWPS in system notes and related testsGrzegorz Bizon2016-11-212-4/+4
| | | | |
| * | | | Rename MWBS service to Merge When Pipeline SucceedsGrzegorz Bizon2016-11-211-4/+10
| | | | |
* | | | | Merge branch 'process-commit-worker-improvements' into 'master' Douwe Maan2016-12-021-3/+3
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pass commit data to ProcessCommitWorker This changes `ProcessCommitWorker` so that it takes a Hash containing commit data instead of a commit SHA. This means the worker doesn't have to access Git just to process a commit message (and other data it may use). This in turn should solve the problem of ending up with 15 000-something jobs in the `process_commit` queue that take forever to process. See merge request !7744
| * | | | | Pass commit data to ProcessCommitWorkerprocess-commit-worker-improvementsYorick Peterse2016-12-011-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By passing commit data to this worker we remove the need for querying the Git repository for every job. This in turn reduces the time spent processing each job. The migration included migrates jobs from the old format to the new format. For this to work properly it requires downtime as otherwise workers may start producing errors until they're using a newer version of the worker code.
* | | | | | Merge branch 'fix-optimistic-locking-for-destroy' into 'master' Stan Hu2016-12-011-7/+23
|\ \ \ \ \ \ | |/ / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make deleting with optimistic locking respect NULL Make deleting with optimistic locking respect NULL For now deleting with optimistic locking is broken when lock_version is still NULL, because Rails would try to delete with `lock_version = 0` while in the database the column is still `NULL`. The monkey patches would force Rails just pass whatever in the column, and stop Rails from casting `NULL` into `0` when the value is read from database. Closes #24766 See merge request !7867
| * | | | | Make deleting with optimistic locking respect NULLLin Jen-Shin2016-12-011-7/+23
| | |_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For now deleting with optimistic locking is broken when lock_version is still NULL, because Rails would try to delete with `lock_version = 0` while in the database the column is still `NULL`. The monkey patches would force Rails just pass whatever in the column, and stop Rails from casting `NULL` into `0` when the value is read from database. Closes #24766
* | | | | Merge branch 'rs-include-emailhelpers' into 'master' Rémy Coutable2016-12-013-0/+6
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Only include EmailHelpers in mailer specs and specs using them See merge request !7836
| * | | | | Only include EmailHelpers in mailer specs and specs using themrs-include-emailhelpersRobert Speicher2016-12-013-0/+6
| |/ / / /
* | | | | Refactor JiraService by moving code out of JiraService#execute methodclean-up-jira-serviceAdam Niedzielski2016-12-011-1/+1
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The implicit interface of project services states that the "execute" method is meant to be called when project hooks are executed. Currently JiraService does not support any project events even though JiraService#supported_events says that "commit" and "merge_request" are supported. They are only used to render correct options in JIRA configuration screen, but they are not supported. Because of that, this commit makes "execute" method a no-op.
* | | | Merge branch 'fix/create-pipeline-with-builds-in-transaction' into 'master' Kamil Trzciński2016-11-301-72/+65
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Create pipeline along with builds in the transation ## What does this MR do? This MR makes it possible to create pipeline along with all associated builds in the transaction, to avoid having empty pipelines when asynchronous job gets terminated. This will simplify implementation of `PipelineUnlockWorker` in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6988 and improve reliability of the CI as a whole. ## What are the relevant issue numbers? Related to #24361 See merge request !7742
| * | | | Extend pipelines factory with transient config attributefix/create-pipeline-with-builds-in-transactionGrzegorz Bizon2016-11-271-1/+1
| | | | |
| * | | | Restore method that ensures builds being createdGrzegorz Bizon2016-11-251-21/+26
| | | | |
| * | | | Remove remaining calls to CI yaml in pipeline specsGrzegorz Bizon2016-11-251-5/+0
| | | | |
| * | | | Move helpers to the end of process pipeline specsGrzegorz Bizon2016-11-251-29/+29
| | | | |
| * | | | Update pipeline processing specs for creating buildsGrzegorz Bizon2016-11-251-35/+28
| | | | |
* | | | | Rename `MergeRequest#pipeline` to `head_pipeline`fix/rename-merge-request-head-pipelineGrzegorz Bizon2016-11-292-9/+25
| | | | |
* | | | | Merge branch 'jej-use-issuable-finder-instead-of-access-check' into 'security' Douwe Maan2016-11-281-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace issue access checks with use of IssuableFinder Split from !2024 to partially solve https://gitlab.com/gitlab-org/gitlab-ce/issues/23867 ## Which fixes are in this MR? :warning: - Potentially untested :bomb: - No test coverage :traffic_light: - Test coverage of some sort exists (a test failed when error raised) :vertical_traffic_light: - Test coverage of return value (a test failed when nil used) :white_check_mark: - Permissions check tested ### Issue lookup with access check Using `visible_to_user` likely makes these security issues too. See [Code smells](#code-smells). - [x] :vertical_traffic_light: app/finders/notes_finder.rb:15 [`visible_to_user`] - [x] :traffic_light: app/views/layouts/nav/_project.html.haml:73 [`visible_to_user`] [`.count`] - [x] :white_check_mark: app/services/merge_requests/build_service.rb:84 [`issue.try(:confidential?)`] - [x] :white_check_mark: lib/api/issues.rb:112 [`visible_to_user`] - CHANGELOG: Prevented API returning issues set to 'Only team members' to everyone - [x] :white_check_mark: lib/api/helpers.rb:126 [`can?(current_user, :read_issue, issue)`] Maybe here too? - [x] :white_check_mark: lib/gitlab/search_results.rb:53 [`visible_to_user`] ### Previous discussions - [ ] https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/2024/diffs#b2ff264eddf9819d7693c14ae213d941494fe2b3_128_126 - [ ] https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/2024/diffs#7b6375270d22f880bdcb085e47b519b426a5c6c7_87_87 See merge request !2031
* | | | | Merge branch 'zj-fix-label-creation-non-members' into 'security'Douwe Maan2016-11-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix label creation non members Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/23416 See merge request !2006
* | | | | Merge branch 'timeout-merge-request-for-binary-file' into 'master' Yorick Peterse2016-11-251-0/+1
|\ \ \ \ \ | |_|_|/ / |/| | | | | | | | | | | | | | Fix: Timeout creating and viewing merge request for binary file See merge request !7713
| * | | | Fix: Timeout creating and viewing merge request for binary filetimeout-merge-request-for-binary-fileValery Sizov2016-11-251-0/+1
| |/ / /
* | | | Rephrase some system notes to be compatible with new system note stylerephrase-system-notesDouwe Maan2016-11-2410-67/+109
|/ / /
* | | Merge branch 'rs-project-team-helpers' into 'master' Sean McGivern2016-11-221-30/+30
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | Add shortcuts for adding users to a project team with a specific role Closes #20944 See merge request !7565
| * | Add shortcuts for adding users to a project team with a specific rolers-project-team-helpersRobert Speicher2016-11-181-30/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This also updates _some_ specs to use these new methods, just to serve as an example for others going forward, but by no means is this exhaustive. Original implementations at !5992 and !6012. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/20944
* | | Merge branch 'hide-empty-merge-request-diffs' into 'master' Sean McGivern2016-11-211-10/+0
|\ \ \ | | | | | | | | | | | | | | | | Fix errors happening when source branch of merge request is removed and then restored See merge request !7568
| * | | Revert "Do not create a MergeRequestDiff record when source branch is deleted"Adam Niedzielski2016-11-211-10/+0
| | | | | | | | | | | | | | | | This reverts commit f913170e2f76ef44800f0272cb7fb40b9d6709ee.
* | | | Merge branch 'smarter-cache-invalidation' into 'master' Sean McGivern2016-11-212-56/+56
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Smarter cache invalidation Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/23550 See merge request !7360
| * | | | Refactor cache refreshing/expiringYorick Peterse2016-11-212-56/+56
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This refactors repository caching so it's possible to selectively refresh certain caches, instead of just expiring and refreshing everything. To allow this the various methods that were cached (e.g. "tag_count" and "readme") use a similar pattern that makes expiring and refreshing their data much easier. In this new setup caches are refreshed as follows: 1. After a commit (but before running ProjectCacheWorker) we expire some basic caches such as the commit count and repository size. 2. ProjectCacheWorker will recalculate the commit count, repository size, then refresh a specific set of caches based on the list of files changed in a push payload. This requires a bunch of changes to the various methods that may be cached. For one, data should not be cached if a branch used or the entire repository does not exist. To prevent all these methods from handling this manually this is taken care of in Repository#cache_method_output. Some methods still manually check for the existence of a repository but this result is also cached. With selective flushing implemented ProjectCacheWorker no longer uses an exclusive lease for all of its work. Instead this worker only uses a lease to limit the number of times the repository size is updated as this is a fairly expensive operation.
* | | | Merge branch 'issue_24303' into 'master' Sean McGivern2016-11-211-17/+48
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow JIRA references for project snippets closes #24303 See merge request !7541
| * | | | Allow JIRA references for project snippetsissue_24303Felipe Artur2016-11-211-17/+48
| |/ / /
* | | | Merge branch 'fix/do-not-add-todo-when-build-allowed-to-fail' into 'master' 24710-external-statuses-pipelineKamil Trzciński2016-11-211-5/+28
|\ \ \ \ | |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not create TODO when build is allowed to fail ## What does this MR do? Do not create a TODO when build that failed is allowed to fail. ## Does this MR meet the acceptance criteria? - [x] [Changelog entry](https://docs.gitlab.com/ce/development/changelog.html) 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 - [ ] All builds are passing ## What are the relevant issue numbers? Closes #22280 See merge request !7618
| * | | Do not create TODO when build is allowed to failGrzegorz Bizon2016-11-211-5/+28
| | |/ | |/|
* | | Merge branch 'issue_5541' into 'master' Sean McGivern2016-11-212-2/+42
|\ \ \ | |/ / |/| | | | | | | | | | | | | | Allow to block JIRA events for commits and merge requests implements #5541 See merge request !7469
| * | Allow enabling and disabling commit and MR events for JIRAissue_5541Felipe Artur2016-11-182-2/+42
| | |
* | | Merge branch 'feature/precalculate-authorized-projects' into 'master' Douwe Maan2016-11-181-0/+3
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Precalculate authorized projects in database ## What does this MR do? It caches user's authorized projects in database instead of using multiple unions, which should simplify and speed-up things since this operation (getting authorized projects) is used a lot. ## Are there points in the code the reviewer needs to double check? Did we miss a scenario where we need to refresh the list of projects? ## 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)~~ - [ ] ~~API support added~~ - Tests - [x] Added for this feature/bug - [x] 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? #23150 See merge request !6839
| * | | Precalculate user's authorized projects in databaseAhmad Sherif2016-11-181-0/+3
| | | | | | | | | | | | | | | | Closes #23150
* | | | Merge branch 'zj-slash-commands-mattermost' into 'master' Kamil Trzciński2016-11-181-1/+1
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Slash command for mattermost Closes #22540 ## Does this MR meet the acceptance criteria? - [x] [Changelog entry](https://docs.gitlab.com/ce/development/changelog.html) added - [ ] [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 - [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) See merge request !7438
| * | | | More coverage on service levelZ.J. van de Weg2016-11-181-1/+1
| | |_|/ | |/| |
* | | | Merge branch 'fix-tests-for-different-host' into 'master' Rémy Coutable2016-11-182-4/+4
|\ \ \ \ | |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use `Gitlab.config.gitlab.host` over `'localhost'` Use `Gitlab.config.gitlab.host` over `'localhost'` This would fix long standing failures running tests on my development machine, which set `Gitlab.config.gitlab.host` to another host because it's not my local computer. Now I finally cannot withstand it and decided to fix them once and for all. See merge request !7562
| * | | Use `Gitlab.config.gitlab.host` over `'localhost'`fix-tests-for-different-hostLin Jen-Shin2016-11-182-4/+4
| |/ / | | | | | | | | | | | | | | | | | | | | | This would fix long standing failures running tests on my development machine, which set `Gitlab.config.gitlab.host` to another host because it's not my local computer. Now I finally cannot withstand it and decided to fix them once and for all.
* | | Merge branch 'issue_13232' into 'master' Sean McGivern2016-11-183-4/+57
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add JIRA remotelinks and prevent duplicated closing messages implements #13232 closes #20479 See merge request !7413
| * | | Add JIRA remotelinks and prevent duplicated closing messagesFelipe Artur2016-11-183-4/+57
| | | |