summaryrefslogtreecommitdiff
path: root/app/services
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'sh-fix-issue-53153' into 'master'Sean McGivern2018-10-301-1/+6
|\ | | | | | | | | | | | | Fix extra merge request versions created from forked merge requests Closes #53153 See merge request gitlab-org/gitlab-ce!22611
| * Fix extra merge request versions created from forked merge requestssh-fix-issue-53153Stan Hu2018-10-291-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a forked merge request was created with the same branch name as the target name, MergeRequests::RefreshService would always create a new diff even though nothing had changed. For example, on GitLab.com: 1. There were a number of merge requests in the gitlab-ce and www-gitlab-com projects that had old merge requests from the community. 2. These merge requests originated from forked projects and used the source branch master. 3. When someone pushed to master in the main repository, MergeRequests::RefreshService would see that master matched the merge requests in question and generated a new diff. 4. This led to an explosion of merge request diffs and slowed down the "Changes" tab considerably. This change alters MergeRequests::RefreshService so that it will only refresh the diff if the merge request's source project and branch match. Otherwise, the refresh will only happen if a pushed commit contains a commit relevant to the existing merge request. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/53153
* | Merge branch 'blackst0ne-update-push-new-merge-request-url' into 'master'Douwe Maan2018-10-291-2/+2
|\ \ | |/ |/| | | | | | | | | Make new merge request URL more friendly when pushing code Closes #53012 See merge request gitlab-org/gitlab-ce!22526
| * Make new merge request URL more friendly when pushing codeblackst0ne2018-10-231-2/+2
| |
* | Merge branch 'rails5-deprecated-uniq' into 'master'Robert Speicher2018-10-292-3/+3
|\ \ | | | | | | | | | | | | Replace deprecated uniq on a Relation with distinct See merge request gitlab-org/gitlab-ce!22625
| * | Replace deprecated uniq on a Relation with distinctJasper Maes2018-10-262-3/+3
| | |
* | | Merge branch 'extract-ee-specific-lines-for-issues-and-mr-controllers' into ↵Nick Thomas2018-10-291-0/+5
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | 'master' Extract ee specific lines for issues and mr controllers See merge request gitlab-org/gitlab-ce!22569
| * | | Extract EE-specific lines from MRs controllerextract-ee-specific-lines-for-issues-and-mr-controllersSean McGivern2018-10-261-0/+5
| | |/ | |/| | | | | | | | | | Move access checks to their own method so they can be overridden, and port an EE-only method to exist in CE too, with an EE-specific override.
* | | Associate clusters model to groups34758-create-group-clustersThong Kuah2018-10-291-2/+2
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Even though we currently only should have one group for a cluster, we allow the flexibility to associate to other groups in the future. This also matches the runner <=> groups association. - Adds Cluster#first_group, aliased to Cluster#group. For the conceivable future, a cluster will have at most one group. - Prevent mixing of group and project clusters. If project type clusters, it should only have projects assigned. Similarly with groups. - Default cluster_type to :project_type. As it's very small table we can set default and null: false in one release.
* | Automatically navigate to last board visitedBrett Walker2018-10-262-0/+34
| |
* | Preload user status for label eventsBob Van Landuyt2018-10-251-1/+1
| | | | | | | | | | This makes sure the user_status for the user of a label event is preloaded. Otherwise it would not be rendered in the fake system note.
* | Store version within SUPPORTED_API_GROUPS hashrefactor_gitlab_kube_clientThong Kuah2018-10-231-2/+1
| | | | | | | | | | | | This removes the ability to pass in a different version. We can instead create a new entry in the SUPPORTED_API_GROUPS hash for a different version if need be.
* | Update all usages of KubeClientThong Kuah2018-10-231-4/+2
|/ | | | | Find and replace everywhere we pass in `api_groups` to KubeClient, as no longer needed
* Merge branch 'refactor-project-rename-repo' into 'master'Robert Speicher2018-10-222-1/+136
|\ | | | | | | | | Move Project#rename_repo to a service class See merge request gitlab-org/gitlab-ce!22419
| * Move Project#rename_repo to a service classrefactor-project-rename-repoYorick Peterse2018-10-222-1/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This moves the logic of Project#rename_repo and all methods _only_ used by this method into a new service class: Projects::AfterRenameService. By moving this code into a separate service class we can more easily refactor it, and we also get rid of some RuboCop "disable" statements automatically. During the refactoring of this code, I removed most of the explicit logging using Gitlab::AppLogger. The data that was logged would not be useful when debugging renaming issues, as it does not add any value on top of data provided by users. I also removed a variety of comments that either mentioned something the code does in literal form, or contained various grammatical errors. Instead we now resort to more clearly named methods, removing the need for code comments. This method was chosen based on analysis in https://gitlab.com/gitlab-org/release/framework/issues/28. In this issue we determined this method has seen a total of 293 lines being changed in it. We also noticed that RuboCop determined the ABC size (https://www.softwarerenovation.com/ABCMetric.pdf) was too great.
* | Resolve "/assign me quick action doesn't work if there is extra white space"Cindy Pallares 🦉2018-10-191-1/+1
| |
* | Merge branch 'ccr/43034_issues_controller_100_queries' into 'master'Douglas Barbosa Alexandre2018-10-191-1/+1
|\ \ | | | | | | | | | | | | | | | | | | Add preload for routes and namespaces for issues controller. Closes #43034 See merge request gitlab-org/gitlab-ce!21651
| * | Add preload in issues controllerChantal Rollison2018-10-181-1/+1
| | |
* | | Merge branch 'bvl-remove-forked-project-link' into 'master'Sean McGivern2018-10-195-67/+41
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Remove ForkedProjectLink model Closes #38883 See merge request gitlab-org/gitlab-ce!22226
| * | | Remove the `ForkedProjectLink` modelBob Van Landuyt2018-10-195-67/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This removes the `ForkedProjectLink` model that has been replaced by the `ForkNetworkMember` and `ForkNetwork` combination. All existing relations have been adjusted to use these new models. The `forked_project_link` table has been dropped. The "Forks" count on the admin dashboard has been updated to count all `ForkNetworkMember` rows and deduct the number of `ForkNetwork` rows. This is because now the "root-project" of a fork network also has a `ForkNetworkMember` row. This count could become inaccurate when the root of a fork network is deleted.
* | | | Catch `RedirectionTooDeep` Exception in webhooksHeinrich Lee Yu2018-10-191-1/+1
| | | |
* | | | Add support for JSON logging for audit eventsStan Hu2018-10-181-4/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will add audit_json.log that writes one line per audit event. For example: { "severity":"INFO", "time":"2018-10-17T17:38:22.523Z", "author_id":3, "entity_id":2, "entity_type":"Project", "change":"visibility", "from":"Private", "to":"Public", "author_name":"John Doe4", "target_id":2, "target_type":"Project", "target_details":"namespace2/project2" }
* | | | Merge branch '52855-use-monotonic-time-in-webhooks' into 'master'Stan Hu2018-10-181-3/+3
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use monotonic time in computing web hook execution time Closes #52855 See merge request gitlab-org/gitlab-ce!22448
| * | | | Use monotonic time in computing web hook execution timeHeinrich Lee Yu2018-10-181-3/+3
| | |_|/ | |/| |
* | | | Fix Groups::UpdateService#execute not returning correct error codeStan Hu2018-10-181-2/+4
|/ / / | | | | | | | | | | | | This was causing problems in EE, where audit events were being generated even if the project failed to save.
* | | Merge branch 'ce-7015-epic-states-notes' into 'master'Kamil Trzciński2018-10-161-1/+1
|\ \ \ | |_|/ |/| | | | | | | | Make source param optional according to EE change See merge request gitlab-org/gitlab-ce!22283
| * | Make source param optional according to EE changeJarka Košanová2018-10-111-1/+1
| |/
* | Merge branch '34758-refactor-cluster-services' into 'master'Dmitriy Zaporozhets2018-10-152-19/+23
|\ \ | | | | | | | | | | | | Refactor Cluster services to enable groups or projects See merge request gitlab-org/gitlab-ce!22181
| * | Pass in project as kwarg for CreateServiceThong Kuah2018-10-152-19/+23
| |/ | | | | | | | | | | | | | | | | This enables us to have other options in the future such as passing in `group:`. Also, remove project arg from UpdateService, as un-used. This will help group cluster controller to re-use this services.
* | Remove un-used inheritance from serviceThong Kuah2018-10-152-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | Remove the inheritance from ::BaseService which is causing us to inherit the initializer that has project as the first arg, as we will not have access to project with forthcoming group clusters. Also call install service from create service - 1 less thing to re-use Extract TestRequest code into a spec helper. Given that we need different behaviour for Rails 5.0 (and again in Rails 5.1!), it's handy to have that branching behaviour in one place
* | Move non-controller code into dedicated serviceThong Kuah2018-10-152-0/+67
|/ | | | | | | | | | This should help with code re-use when we create applications for group level cluster next. Change `find_or_initialize_by` to explicitly find or build the right association based on the application name. The benefit here is that we use the associations on @cluster rather than querying from the other side of the association.
* Clean up ActiveRecord code in TodoServiceYorick Peterse2018-10-081-19/+7
| | | | | | | | | | | | | | | | | | | | | | This refactors the TodoService class according to our code reuse guidelines. The resulting code is a wee bit more verbose, but it allows us to decouple the column names from the input, resulting in fewer changes being necessary when we change the schema. One particular noteworthy line in TodoService is the following: todos_ids = todos.update_state(state) Technically this is a violation of the guidelines, because `update_state` is a class method, which services are not supposed to use (safe for a few allowed ones). I decided to keep this, since there is no alternative. `update_state` doesn't produce a relation so it doesn't belong in a Finder, and we can't move it to another Service either. As such I opted to just use the method directly. Cases like this may happen more frequently, at which point we should update our documentation with some sort of recommendation. For now, I want to refrain from doing so until we have a few more examples.
* Merge branch 'backport-ce-to-ee-merge' into 'master'Stan Hu2018-10-061-5/+6
|\ | | | | | | | | Backport of CE upstream - 2018-10-05 12:21 UTC See merge request gitlab-org/gitlab-ce!22154
| * Fix CE to EE merge (backport)Kamil Trzciński2018-10-051-5/+6
| |
* | Merge branch 'issue_43097' into 'master'Sean McGivern2018-10-051-0/+26
|\ \ | | | | | | | | | | | | | | | | | | Move related branches to service Closes #43097 See merge request gitlab-org/gitlab-ce!22094
| * | Move issue related_branches to serviceFelipe Artur2018-10-041-0/+26
| | | | | | | | | | | | | | | Moves the related_branches method from Issue model to RelatedBranchesService
* | | Merge branch 'master-ce' into scheduled-manual-jobsShinya Maeda2018-10-055-41/+46
|\ \ \ | | |/ | |/|
| * | Make GitLab pages support access controlTuomo Ala-Vannesluoma2018-10-052-3/+15
| | |
| * | Merge branch 'feature/gb/pipeline-only-except-with-modified-paths' into 'master'Kamil Trzciński2018-10-052-38/+27
| |\ \ | | | | | | | | | | | | | | | | Pipeline only/except for modified paths See merge request gitlab-org/gitlab-ce!21981
| | * \ Merge branch 'master' into 'feature/gb/pipeline-only-except-with-modified-paths'feature/gb/pipeline-only-except-with-modified-pathsKamil Trzciński2018-10-045-39/+29
| | |\ \ | | | | | | | | | | | | | | | # Conflicts: # app/models/ci/pipeline.rb
| | * | | Extract git push from merge request refresh serviceGrzegorz Bizon2018-09-281-35/+24
| | | | |
| | * | | Add a class that represents a git push operationGrzegorz Bizon2018-09-281-3/+3
| | | | |
| * | | | Resolve "Drop down filter for project snippets"Fabian Schneider2018-10-051-0/+4
| | |/ / | |/| |
* | | | Merge branch 'master-ce' into scheduled-manual-jobsShinya Maeda2018-10-052-30/+18
|\ \ \ \ | |/ / /
| * | | Merge branch 'ce-7723-epic-commands-autocomplete' into 'master'Rémy Coutable2018-10-041-6/+13
| |\ \ \ | | | | | | | | | | | | | | | | | | | | Port: Add checks to InterpretService conditions See merge request gitlab-org/gitlab-ce!22047
| | * | | Add checks to InterpretService conditionsce-7723-epic-commands-autocompleteJarka Košanová2018-10-031-6/+13
| | |/ /
| * | | Create labels_as_hash_ concern, modify params for methodccr/48930_extract_logic_to_concernChantal Rollison2018-10-031-24/+5
| | |/ | |/|
* | | enqueue in process_build_serviceShinya Maeda2018-10-021-1/+5
| | |
* | | Fix spec failureShinya Maeda2018-10-021-1/+1
| | |
* | | Fix coding style offenceShinya Maeda2018-10-021-0/+1
| | |