summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/search_results_spec.rb
Commit message (Collapse)AuthorAgeFilesLines
* Add latest changes from gitlab-org/gitlab@13-9-stable-eev13.9.0-rc42GitLab Bot2021-02-181-10/+17
|
* Add latest changes from gitlab-org/gitlab@13-8-stable-eev13.8.0-rc42Robert Speicher2021-01-201-10/+29
|
* Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc42GitLab Bot2020-10-211-8/+50
|
* Add latest changes from gitlab-org/gitlab@13-4-stable-eeGitLab Bot2020-09-191-19/+35
|
* Add latest changes from gitlab-org/gitlab@13-2-stable-eeGitLab Bot2020-07-201-1/+1
|
* Add latest changes from gitlab-org/gitlab@13-0-stable-eeGitLab Bot2020-05-201-1/+9
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2019-10-011-2/+2
|
* Lower searches count limitFrancisco Javier López2019-09-091-8/+9
| | | | | Lowering the limit when performing search from 1001 to 101. This will allow us to speed this process.
* Add frozen_string_literal to lib part 2Thong Kuah2019-08-231-0/+2
| | | | | Using the sed script from https://gitlab.com/gitlab-org/gitlab-ce/issues/59758
* Load search result counts asynchronouslyMarkus Koller2019-08-121-0/+37
| | | | | | Querying all counts for the different search results in the same request led to timeouts, so we now only calculate the count for the *current* search results, and request the others in separate asynchronous calls.
* Resolve: Milestones leaked via search APIFelipe Artur2019-05-201-0/+24
| | | | | Fix milestone titles being leaked using search API when users cannot read milestones
* Autocorrect with RSpec/ExampleWording copThong Kuah2019-04-051-2/+2
| | | | | | | - rewords examples starting with 'should' - rewords examples starting with 'it' Note: I had to manually fixup "onlies" to "only"
* check ability for user search resultsAlexis Reigel2019-03-141-0/+8
|
* move ability check from service class to viewAlexis Reigel2019-03-141-4/+0
|
* add users search results to global searchAlexis Reigel2019-03-141-0/+12
|
* Use limited count queries also for scoped searchesJan Provaznik2018-03-051-30/+6
|
* Support search in APIJarka Kadlecová2018-02-061-1/+5
|
* Use limit for search count queriessearch-100Jan Provaznik2018-01-231-0/+58
| | | | | | | | | | | | | | | | | | | | | | Search query is especially slow if a user searches a generic string which matches many records, in such case search can take tens of seconds or time out. To speed up the search query, we search only for first 1000 records, if there is >1000 matching records we just display "1000+" instead of precise total count supposing that with such amount the exact count is not so important for the user. Because for issues even limited search was not fast enough, 2-phase approach is used for issues: first we use simpler/faster query to get all public issues, if this exceeds the limit, we just return the limit. If the amount of matching results is lower than limit, we re-run more complex search query (which includes also confidential issues). Re-running the complex query should be fast enough in such case because the amount of matching issues is lower than limit. Because exact total_count is now limited, this patch also switches to to "prev/next" pagination. Related #40540
* Merge branch 'jprovazn-search-issues' into 'master'Sean McGivern2018-01-031-7/+28
|\ | | | | | | | | Skip projects filter on issues search See merge request gitlab-org/gitlab-ce!16117
| * Skip projects filter on issues searchjprovazn-search-issuesJan Provaznik2018-01-021-7/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When searching for issues, an additional subquery is added which filters only issues in a project. If global context is used (no project is specified) this query filters all projects user has access to. In that case we can skip this filter because filtering only projects user has access to is added anyway. The filter is used only if a custom project context is specified Related to #40540
* | Replace '.team << [user, role]' with 'add_role(user)' in specs36782-replace-team-user-role-with-add_role-user-in-specsblackst0ne2017-12-221-5/+5
|/
* Skip projects filter on merge requests searchjprovazn-searchJan Provaznik2017-12-211-0/+11
| | | | | | | | | | | | | | | When searching for merge requests, an additional subquery is added which by default filters only merge requests which belong to source or target project user has permission for. This filter is not needed because more restrictive filter which checks if user has permission for target project is used in the query. So unless a custom projects filter is used by user, it's possible to skip the default projects filter and speed up the final query. Related to #40540
* Add a project forks spec helperBob Van Landuyt2017-10-071-1/+3
| | | | | The helper creates a fork of a project with all provided attributes, but skipping the creation of the repository on disk.
* Change all `:empty_project` to `:project`rs-empty_project-defaultRobert Speicher2017-08-021-7/+7
|
* Backport of multiple_assignees_feature [ci skip]Valery Sizov2017-05-041-2/+2
|
* Use `:empty_project` where possible throughout spec/librs-empty_project-libRobert Speicher2017-01-251-1/+1
|
* Merge branch 'jej-23867-use-mr-finder-instead-of-access-check' into 'security'Douwe Maan2016-12-081-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace MR access checks with use of MergeRequestsFinder Split from !2024 to partially solve https://gitlab.com/gitlab-org/gitlab-ce/issues/23867 :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 - [x] :bomb: app/finders/notes_finder.rb:17 - [x] :warning: app/views/layouts/nav/_project.html.haml:80 [`.count`] - [x] :bomb: app/controllers/concerns/creates_commit.rb:84 - [x] :traffic_light: app/controllers/projects/commits_controller.rb:24 - [x] :traffic_light: app/controllers/projects/compare_controller.rb:56 - [x] :vertical_traffic_light: app/controllers/projects/discussions_controller.rb:29 - [x] :white_check_mark: app/controllers/projects/todos_controller.rb:27 - [x] :vertical_traffic_light: app/models/commit.rb:268 - [x] :white_check_mark: lib/gitlab/search_results.rb:71 - [x] https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/2024/diffs#d1c10892daedb4d4dd3d4b12b6d071091eea83df_267_266 Memoize ` merged_merge_request(current_user)` - [x] https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/2024/diffs#d1c10892daedb4d4dd3d4b12b6d071091eea83df_248_247 Expected side effect for `merged_merge_request!`, consider `skip_authorization: true`. - [x] https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/2024/diffs#d1c10892daedb4d4dd3d4b12b6d071091eea83df_269_269 Scary use of unchecked `merged_merge_request?` See merge request !2033
* Merge branch 'jej-use-issuable-finder-instead-of-access-check' into 'security' Douwe Maan2016-11-281-19/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Clean up search result classesclean_up_search_classesValery Sizov2016-09-061-18/+0
|
* adds second batch of tests changed to active tenseactive-tense-test-coveragetiagonbotelho2016-08-091-6/+6
|
* Project members with guest role can't access confidential issuesDouglas Barbosa Alexandre2016-06-131-0/+16
|
* Restrict access to confidential issues on search resultsDouglas Barbosa Alexandre2016-03-171-1/+90
|
* Refactor Gitlab::SearchResultsYorick Peterse2016-03-111-0/+55
Instead of plucking IDs this class now uses ActiveRecord::Relation objects. Plucking IDs is problematic as searching for projects can lead to a huge amount of IDs being loaded into memory only to be used as an argument for another query (instead of just using a sub-query).