summaryrefslogtreecommitdiff
path: root/app/finders
Commit message (Collapse)AuthorAgeFilesLines
* ReleasesFinder will always return a relationAlessio Caiazza2018-12-311-4/+2
|
* Add releases APIAlessio Caiazza2018-12-311-0/+16
| | | | | | | | | | | This commit introduces Releases API under /api/v4/projects/:id/releases * We are introducing release policies at project level. * We are deprecating releases changes from tags, both api and web interface. * Tags::CreateService no longer create a release This feature is controlled by :releases_page feature flag
* Rename GroupHierarchy into ObjectHierarchyJarka Košanová2018-12-192-5/+5
| | | | | | - we now use the hierarchy class also for epics - also rename supports_nested_groups? into supports_nested_objects? - move it to a concern
* Hide confidential events in rubyBob Van Landuyt2018-12-172-13/+62
| | | | | | | | | | | | We're filtering the events using `Event#visible_to_user?`. At most we're loading 100 events at once. Pagination is also dealt with in the finder, but the resulting array is wrapped in a `Kaminari.paginate_array` so the API's pagination helpers keep working. We're passing the total count into that paginatable array, which would include confidential events. But we're not disclosing anything.
* Use finder to decide to show note to userThong Kuah2018-12-171-1/+10
| | | | | | | | | | | Given the note is about how to interpret ancestor clusters, use the finder which actually knows if there are any ancestor clusters to find out if the note should be shown, rather than passing the same info via a view to a helper Added note about Kaminari.paginate_array Link to followup issue too
* Check can :read_clusters in finderThong Kuah2018-12-171-3/+9
| | | | | This is in addtion to the can checks we have in the controller, as a finder can be used elsewhere in the future.
* Show clusters of ancestors in cluster list pageThong Kuah2018-12-171-0/+20
| | | | | Show both the cluster(s) of the clusterable, and the cluster(s) of ancestor groups.
* Send a notification email on mirror update errorsAlejandro Rodríguez2018-12-111-0/+15
| | | | | | The email is sent to project maintainers containing the last mirror update error. This will allow maintainers to set alarms and react accordingly.
* Merge branch 'move-group-issues-search-cte-up-the-chain' into 'master'Douwe Maan2018-12-071-9/+33
|\ | | | | | | | | Add a flag to use a subquery for group issues search See merge request gitlab-org/gitlab-ce!23445
| * Remove trailing whitespaceDouwe Maan2018-12-071-1/+1
| |
| * Restructure `foo ? bar : false` as `foo && bar`Douwe Maan2018-12-061-8/+3
| |
| * Add a flag to use a subquery for group issues searchSean McGivern2018-11-301-9/+38
| | | | | | | | | | | | | | | | | | | | We already had a flag to use a CTE, but this broke searching in some cases where we need to sort by a joined table. Disabling the CTE flag makes searches much slower. The new flag, to use a subquery, makes them slightly slower than the CTE, while maintaining correctness. If both it and the CTE flag are enabled, the subquery takes precedence.
* | Introduce Knative Serverless TabDylan Griffith2018-12-061-0/+31
| |
* | Rename project's pipelines relationFrancisco Javier López2018-12-051-1/+1
|/
* Filter by `None`/`Any` for labels in issues/mrs APIJacopo2018-11-231-1/+10
| | | | | | | | | | | | | | By using the parameters `?labels=None|Any` the user can filter issues/mrs from the API that has `none/any` label. Affected endpoints are: - /api/issues - /api/projects/:id/issues - /api/groups/:id/issues - /api/merge_requests - /api/projects/:id/merge_requests - /api/groups/:id/merge_requests
* Merge branch '53290-incorrect-project-list-order-select-default-label' into ↵Grzegorz Bizon2018-11-201-1/+1
|\ | | | | | | | | | | | | | | | | 'master' Resolve "Incorrect project list order select default label" Closes #53290 See merge request gitlab-org/gitlab-ce!23058
| * Fix default sorting for subgroups and projects list53290-incorrect-project-list-order-select-default-labelJacopo2018-11-141-1/+1
| |
* | Merge branch 'rails5-active-record-class-value' into 'master'Stan Hu2018-11-191-1/+1
|\ \ | | | | | | | | | | | | Rails5 deprecation: Passing a class as a value in an Active Record query is deprecated See merge request gitlab-org/gitlab-ce!23164
| * | Rails5: Passing a class as a value in an Active Record query is deprecatedJasper Maes2018-11-171-1/+1
| |/
* | Refactor whitelisting of filter paramsHeinrich Lee Yu2018-11-151-11/+3
|/
* Merge branch 'master' into 'refactor-snippets-finder'refactor-snippets-finderDouwe Maan2018-11-062-5/+5
|\ | | | | | | # Conflicts: # spec/models/project_spec.rb
| * Merge branch 'use_tokenauthenticatable_method_for_token_lookup' into 'master'Sean McGivern2018-11-051-1/+1
| |\ | | | | | | | | | | | | Remove PersonalAccessTokensFinder#find_by method See merge request gitlab-org/gitlab-ce!22617
| | * Remove PersonalAccessTokensFinder#find_by methoduse_tokenauthenticatable_method_for_token_lookupImre Farkas2018-11-051-1/+1
| | | | | | | | | | | | | | | | | | find_by_token is overriden by TokenAuthenticatable which can be easily missed or confused with #find_by(:token) defined by ActiveRecord. First step for safer usage is to remove #find_by.
| * | Merge branch 'top_level_clusters_controller' into 'master'Kamil Trzciński2018-11-021-4/+4
| |\ \ | | | | | | | | | | | | | | | | Top level clusters controller See merge request gitlab-org/gitlab-ce!22438
| | * | Abstract out project out of ClustersControllerThong Kuah2018-11-011-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To the extent possible swap out `project` with `clusterable` - Abstract paths for showing cluster or clusters. This will allow us to swap in alternative paths for group level cluster - Push :project_id and :namespace_id params from the URL to the POST body. - Create a nice helper for to generate links for the destroy action For some reason, spec :project_id and :namespace_id param are not going through `to_param` for a JSON format. Manually call `to_param` to fix specs. - Move :layout to BaseController
* | | | Rewrite SnippetsFinder to improve performanceYorick Peterse2018-11-051-99/+110
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This completely rewrites the SnippetsFinder class from the ground up in order to improve its performance. The old code was beyond salvaging. It was complex, included various Rails 5 workarounds, comments that shouldn't be necessary, and most important of all: it produced a really poorly performing database query. As a result, I opted for rewriting the finder from scratch, instead of trying to patch the existing code. Instead of trying to reuse as many existing methods as possible, I opted for defining new methods specifically meant for the SnippetsFinder. This requires some extra code here and there, but allows us to have much more control over the resulting SQL queries. It is these changes that then allow us to produce a _much_ more efficient query. To illustrate how bad the old query was, we will use my own snippets as an example. Currently I have 52 snippets, most of which are global ones. To retrieve these, you would run the following Ruby code: user = User.find_by(username: 'yorickpeterse') SnippetsFinder.new(user, author: user).execute On GitLab.com the resulting query will take between 10 and 15 seconds to run, producing the query plan found at https://explain.depesz.com/s/Y5IX. Apart from the long execution time, the total number of buffers (the sum of all shared hits) is around 185 GB, though the real number is probably (hopefully) much lower as I doubt simply summing these numbers produces the true total number of buffers used. The new query's plan can be found at https://explain.depesz.com/s/wHdN, and this query takes between 10 and 100-ish milliseconds to run. The total number of buffers used is only about 30 MB. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/52639
* | | Merge branch 'engwan/gitlab-ce-44012-filter-reactions-none-any'Sean McGivern2018-11-011-10/+25
|\ \ \
| * | | Fix testsHeinrich Lee Yu2018-11-011-7/+8
| | | |
| * | | Add None / Any options to reaction filter in issues / MRs APIHeinrich Lee Yu2018-11-011-10/+24
| | | |
* | | | Rearrange code for readabilityHeinrich Lee Yu2018-11-011-16/+18
| | | |
* | | | Update API to accept None and AnyHeinrich Lee Yu2018-11-011-13/+13
|/ / /
* | | Whitelist none method from ActiveRecord::Queryingda-rubocop-whitelist-active-record-noneDouglas Barbosa Alexandre2018-10-3111-26/+0
| |/ |/|
* | Merge remote-tracking branch 'origin/master' into dev-masterDJ Mountney2018-10-292-15/+28
|\ \ | |/
| * Support lowercase none / anyHeinrich Lee Yu2018-10-261-4/+4
| |
| * Apply similar change to MRs APIHeinrich Lee Yu2018-10-261-0/+1
| |
| * Issues API: Add None/Any option to assignee_idHeinrich Lee Yu2018-10-262-16/+28
| |
* | Merge branch 'fix_pat_auth-11-4' into 'security-11-4'Robert Speicher2018-10-291-1/+1
|/ | | | | [11.4] Fix Token lookup for Git over HTTP and registry authentication See merge request gitlab/gitlabhq!2577
* Resolve "Filter discussion (tab) by comments or activity in issues and merge ↵Oswaldo Ferreira2018-10-231-0/+6
| | | | requests"
* Merge branch '52559-applications-api-get-delete' into 'master'Rémy Coutable2018-10-221-0/+22
|\ | | | | | | | | | | | | Add Applications API endpoints for listing and deleting entries. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/52559 See merge request https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/22296
| * Disable offense on the appropriate line only !22296JB Vasseur2018-10-191-6/+2
| |
| * Source cleaning !22296JB Vasseur2018-10-181-1/+1
| |
| * Use application finder for Doorkeeper ApplicationsJB Vasseur2018-10-151-0/+26
| |
* | Make getting a user by the username case insensitiveWilliam George2018-10-183-16/+44
| |
* | Backport CE changes for Ops Dashboard in EEPeter Leitzen2018-10-121-11/+16
| |
* | Feature improved branch filter sortingJason Rutherford2018-10-111-6/+35
|/
* Clean up ActiveRecord code in TodoServiceYorick Peterse2018-10-083-0/+87
| | | | | | | | | | | | | | | | | | | | | | 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.
* Clean up ActiveRecord code in TodosFinderYorick Peterse2018-10-081-53/+33
| | | | | | | | This refactors the TodosFinder finder according to the new code reuse rules, as enforced by the CodeReuse cops. I also changed some of the methods to use regular if statements, instead of assignments and/or early returns. This results in a more natural flow when reading the code, and it makes it harder to accidentally return the wrong result.
* Merge branch 'ce-5987-project-templates-api' into 'master'Robert Speicher2018-10-052-21/+38
|\ | | | | | | | | Add a new project-specific templates API endpoint See merge request gitlab-org/gitlab-ce!22118
| * Backport project template API to CENick Thomas2018-10-052-21/+38
| |
* | Put issues group search CTE behind a (default on) flag50246-can-t-sort-group-issues-by-popularity-when-searchingSean McGivern2018-10-051-0/+1
| | | | | | | | | | | | We don't think this is needed any more - see https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/21521, and https://gitlab.com/gitlab-org/gitlab-ce/issues/52271 for removing the flag.