summaryrefslogtreecommitdiff
path: root/app/finders
Commit message (Collapse)AuthorAgeFilesLines
* Improve readability and add specs for label filteringsh-fix-labels-move-issueStan Hu2016-10-241-8/+5
|
* Improve label filtering implementationStan Hu2016-10-241-10/+4
|
* Allow the use of params[:name] when filtering labelsStan Hu2016-10-241-3/+10
|
* Fix bug where labels would be assigned to issues that were movedStan Hu2016-10-241-0/+4
| | | | | | | | | | If you attempt to move an issue from one project to another and leave labels blank, LabelsFinder would assign all labels in the new project to that issue. The issue is that :title is passed along to the Finder, but since it appears empty no filtering is done. As a result, all labels in the group are returned. This fix handles that case. Closes #23668
* Remove order by label type on LabelsFinderDouglas Barbosa Alexandre2016-10-191-1/+1
|
* Add support to group labels to SlashCommands::InterpretServiceDouglas Barbosa Alexandre2016-10-191-1/+1
|
* Reuse LabelsFinder on Banzai::Filter::LabelReferenceFilterDouglas Barbosa Alexandre2016-10-191-4/+14
|
* Return only labels that user have access on IssuableFinder#labelsDouglas Barbosa Alexandre2016-10-192-10/+7
|
* Remove unnecessary `title.present?` on LabelsFinderDouglas Barbosa Alexandre2016-10-191-1/+1
|
* Reuse LabelsFinder on Banzai::Filter::LabelReferenceFilterDouglas Barbosa Alexandre2016-10-192-8/+35
|
* Add ProjectLabel modelDouglas Barbosa Alexandre2016-10-191-1/+2
|
* Makes the query to retrieve group labels more simplerDouglas Barbosa Alexandre2016-10-191-1/+1
|
* List only labels that belongs to the group on the group issues pageDouglas Barbosa Alexandre2016-10-191-9/+10
|
* LabelsFinder inherits from UnionFinderDouglas Barbosa Alexandre2016-10-191-9/+4
|
* Allow users to apply group labels on Issues/MRsDouglas Barbosa Alexandre2016-10-191-1/+3
|
* Add LabelsFinderDouglas Barbosa Alexandre2016-10-191-0/+58
|
* Precalculate trending projectsprecalculate-trending-projectsYorick Peterse2016-10-101-16/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | This commit introduces a Sidekiq worker that precalculates the list of trending projects on a daily basis. The resulting set is stored in a database table that is then queried by Project.trending. This setup means that Unicorn workers no longer _may_ have to calculate the list of trending projects. Furthermore it supports filtering without any complex caching mechanisms. The data in the "trending_projects" table is inserted in the same order as the project ranking. This means that getting the projects in the correct order is simply a matter of: SELECT projects.* FROM projects INNER JOIN trending_projects ON trending_projects.project_id = projects.id ORDER BY trending_projects.id ASC; Such a query will only take a few milliseconds at most (as measured on GitLab.com), opposed to a few seconds for the query used for calculating the project ranks. The migration in this commit does not require downtime and takes care of populating an initial list of trending projects.
* Refactor TrendingProjectsFinder to support cachingYorick Peterse2016-10-051-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | == Public Projects This finder class now _only_ returns public projects. Previously this finder would also return private and internal projects. Including these projects makes caching data much harder and less efficient. Meanwhile including this data isn't very useful as very few users would be interested in seeing projects they have access to as trending. That is, the feature is more useful when you want to see what _other_ popular projects there are. == Caching The data returned by TrendingProjectsFinder is now cached for a day based on the number of months the data should be restricted to. The cache is not flushed explicitly, instead it's rebuilt whenever it expires. == Timings To measure the impact I changed the finder code to use the last 24 months instead of the last month. I then executed and measured 10 requests to the explore page. On the current "master" branch (commit 88fa5916ffa0aea491cd339272ed7437c3f52dc7) this would take an average of 2.43 seconds. Using the changes of this commit this was reduced to around 1.7 seconds. Fixes gitlab-org/gitlab-ce#22164
* Take filters in account in issuable countersRémy Coutable2016-09-301-10/+5
| | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* Use Ability.allowed? instead of current_user.can? in AccessRequestsFinderrc-new-access-requests-finderRémy Coutable2016-09-281-1/+1
| | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* Improve the logic in AccessRequestsFinder#execute & #execute!Rémy Coutable2016-09-281-11/+9
| | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* New AccessRequestsFinderRémy Coutable2016-09-281-0/+29
| | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* fix issues mr counterbarthc2016-09-203-1/+22
|
* Use PipelinesFinder in Pipelines APIZ.J. van de Weg2016-09-071-14/+18
|
* Merge branch 'refactor/add-policies' into 'master' Robert Speicher2016-08-312-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor ability.rb into Policies ## What does this MR do? Factors out `ability.rb` into a new abstraction - the "policy" (stored in `app/policies`). A policy is a class named `#{class_name}Policy` (looked up automatically as needed) that implements `rules` as follows: ``` ruby class ThingPolicy < BasePolicy def rules @user # this is a user to determine abilities for, optionally nil in the anonymous case @subject # this is the subject of the ability, guaranteed to be an instance of `Thing` can! :some_ability # grant the :some_ability permission cannot! :some_ability # ensure that :some_ability is not allowed. this overrides any `can!` that is called before or after delegate! @subject.other_thing # merge the abilities (can!) and prohibitions (cannot!) from `@subject.other_thing` can? :some_ability # test whether, so far, :some_ability is allowed end def anonymous_rules # optional. if not implemented `rules` is called where `@user` is nil. otherwise this method is called when `@user` is nil. end end ``` See merge request !5796
| * remove Ability.abilitieshttp://jneen.net/2016-08-302-2/+2
| |
* | add specs for tags findertag-name-filtertiagonbotelho2016-08-311-0/+29
|/
* Merge branch 'issue_18135' into 'master' Douwe Maan2016-08-191-1/+5
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Todos sorting dropdown Implements #18135 ![todos_sorting](/uploads/bff76827c421628134dfb8b864e47c74/todos_sorting.png) - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - Tests - [x] Added for this feature/bug - [x] All builds are passing - [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 you do - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) See merge request !5691
| * Todos sorting dropdownissue_18135Felipe Artur2016-08-191-1/+5
| |
* | Merge branch '17932-move-to-project-dropdown' into 'master' Jacob Schatz2016-08-191-0/+6
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move to project dropdown with infinite scroll for better performance ## What does this MR do? On the Move dropdown on the edit issue page we introduced infinite scrolling to just return a limited number of projects, 50 items. So if the user can move the issue to 50 or more items when scroll down on the list a new set of projects will be requested to the server. ## Are there points in the code the reviewer needs to double check? ## Why was this MR needed? See #17932 ## What are the relevant issue numbers? Closes #17932 ## Screenshots (if relevant) ## 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 [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] 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) See merge request !5686
| * | Move to project dropdown with infinite scroll for better performance17932-move-to-project-dropdownPaco Guzman2016-08-181-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use just SQL to check is a user can admin_issue on a project Using offset pagination instead pages to avoid a count query Tradeoff - we duplicate how we check admin_issue in a SQL relation in the Ability class
* | | Merge branch '4273-slash-commands' into 'master'Robert Speicher2016-08-181-1/+1
|\ \ \ | |/ / |/| | | | | | | | | | | Support slash commands in issues / MR description & comments See merge request !5021
| * | Merge branch 'master' into 4273-slash-commandsDouwe Maan2016-08-162-12/+11
| |\ \ | | |/ | | | | | | | | | # Conflicts: # app/services/issues/create_service.rb
| * | Support slash commands in noteable description and notesRémy Coutable2016-08-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some important things to note: - commands are removed from noteable.description / note.note - commands are translated to params so that they are treated as normal params in noteable Creation services - the logic is not in the models but in the Creation services, which is the right place for advanced logic that has nothing to do with what models should be responsible of! - UI/JS needs to be updated to handle notes which consist of commands only - the `/merge` command is not handled yet Other improvements: - Don't process commands in commit notes and display a flash is note is only commands - Add autocomplete for slash commands - Add description and params to slash command DSL methods - Ensure replying by email with a commands-only note works - Use :subscription_event instead of calling noteable.subscribe - Support :todo_event in IssuableBaseService Signed-off-by: Rémy Coutable <remy@rymai.me>
* | | Move to project dropdown with infinite scroll for better performance17932-move-to-project-dropdown-improvePaco Guzman2016-08-171-0/+14
| |/ |/| | | | | | | | | | | | | Use just SQL to check is a user can admin_issue on a project Tradeoff - we duplicate how we check admin_issue in a SQL relation in the Ability class
* | Pass project IDs relation to ProjectsFinder instead of using a blockAhmad Sherif2016-08-152-5/+3
| |
* | Speed up todos queries by limiting the projects set we join withAhmad Sherif2016-08-152-11/+12
|/ | | | Closes #20828
* State specific default sort order for issuableszs2016-08-011-1/+1
| | | | | | | | | | | | | | | Provide more sensible default sort order for issues and merge requests based on the following table: | type | state | default sort order | |----------------|--------|--------------------| | issues | open | last created | | issues | closed | last updated | | issues | all | last created | | merge requests | open | last created | | merge requests | merged | last updated | | merge requests | closed | last updated | | merge requests | all | last created |
* implements the basic filter functionalitytiagonbotelho2016-07-191-0/+31
|
* Merge branch 'approval-required-todo' into 'master' Robert Speicher2016-07-121-1/+1
|\ | | | | | | | | | | | | Add approval required todos Ports the 'approval required' todo type from EE - https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/547 See merge request !5217
| * Add approval required todosapproval-required-todoSean McGivern2016-07-121-1/+1
| |
* | Cache todos pending/done dashboard query countsPaco Guzman2016-07-121-1/+1
|/
* Expose target, filter by state as stringRobert Schilling2016-07-011-0/+21
|
* PipelinesFinder use git cached data19318-pipelines-find-git-callsPaco Guzman2016-06-291-2/+2
|
* Ensure Todos counters doesn't count Todos for projects pending deleteDouglas Barbosa Alexandre2016-06-171-1/+1
|
* Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ceDmitriy Zaporozhets2016-06-151-1/+1
|\
| * Merge branch 'manual-todos-issuable-sidebar' into 'master' Stan Hu2016-06-141-1/+1
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Manually create todo for issuable ## What does this MR do? Adds a button to the sidebar in issues & merge requests to allow users to manually create a todo item themselves. ## What are the relevant issue numbers? Closes #15045 ## Screenshots (if relevant) ![Screen_Shot_2016-06-07_at_09.52.14](/uploads/00af70244c0589d19f241c3e85f3d63d/Screen_Shot_2016-06-07_at_09.52.14.png) ![Screen_Shot_2016-06-07_at_09.52.06](/uploads/e232b02208613a4a50cff4d1e6f119ff/Screen_Shot_2016-06-07_at_09.52.06.png) ![Screen_Shot_2016-06-07_at_09.51.14](/uploads/f1d36435d49ab882538ae2252bec8086/Screen_Shot_2016-06-07_at_09.51.14.png) See merge request !4502
| | * Manually create todo for issuablePhil Hughes2016-06-141-1/+1
| | | | | | | | | | | | | | | | | | Added a button into the sidebar for issues & merge requests to allow users to manually create todo items Closes #15045
* | | Fix notes on confidential issues through JSON to users without accessDouglas Barbosa Alexandre2016-06-141-1/+1
|/ /
* | Project members with guest role can't access confidential issuesDouglas Barbosa Alexandre2016-06-131-1/+1
|/