summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Enable Style/EmptyLinesAroundClassBody coprubocop/EmptyLinesAroundModuleBodyGabriel Mazetto2016-08-062-2/+0
|
* Enable Style/EmptyLinesAroundModuleBody copGabriel Mazetto2016-08-061-2/+0
|
* Ignore URLs starting with // (!5677)winniehell2016-08-051-1/+2
|
* Merge branch 'master' of https://dev.gitlab.org/gitlab/gitlabhqRémy Coutable2016-08-041-1/+3
|\
| * Merge branch '20527-fork-commits-have-impact-on-original-project' into 'master' Rémy Coutable2016-08-041-1/+3
| |\ | | | | | | | | | | | | | | | | | | Don’t close issues on original project Closes #20527 -> https://gitlab.com/gitlab-org/gitlab-ce/issues/20527 See merge request !1981
| | * Don’t close issues on original project from a forkPaco Guzman2016-08-041-1/+3
| | | | | | | | | | | | Signed-off-by: Paco Guzman <pacoguzmanp@gmail.com>
* | | Merge branch ↵Rémy Coutable2016-08-042-8/+8
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | '20512-fix-rename-add-users-into-project-to-add-users-to-project-and-projects-ids-to-project-ids' into 'master' Fix Rename `add_users_into_project` and `projects_ids` ## What does this MR do? Only modifies the name of a method that leaves more semantic and expressive and the name of the keywords arguments to the rails convention. ## Are there points in the code the reviewer needs to double check? Only if it has been changed at every point that is calling this method and that passing arguments. ## Why was this MR needed? To make the code more expressive. ## What are the relevant issue numbers? Closes #20512. - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - Tests - [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 !5659
| * | Fix Rename `add_users_into_project` and `projects_ids`Herminio Torres2016-08-042-8/+8
| | | | | | | | | | | | | | | | | | We never add things `into` projects, we just add them `to` projects. So how about we rename this to `add_users_to_project`. Rename `projects_ids` to `project_ids` by following the convention of rails.
* | | Merge branch 'fix/ha-mode-import-issue' into 'master' Rémy Coutable2016-08-041-0/+4
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix Import/Export not working in HA mode Use a shared path instead of `Tempfile` default `/tmp` so the import file is accessible by any GitLab instance. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/20506 - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - Tests - [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 !5618
| * | using shared path for project import uploads and refactored gitlab remove ↵James Lopez2016-08-041-0/+4
| | | | | | | | | | | | export worker
* | | Merge branch 'syntax-highlight-filter-performance' into 'master' Rémy Coutable2016-08-041-8/+18
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Improve performance of SyntaxHighlightFilter ## What does this MR do? This MR improves the performance of `Banzai::Filter::SyntaxHighlightFilter`. See e9bacc6575d0002c6cab620075dea3dc7f93f100 for more information. ## Are there points in the code the reviewer needs to double check? Styling mostly. ## Why was this MR needed? Syntax highlighting is rather slow. ## What are the relevant issue numbers? #18592 ## Does this MR meet the acceptance criteria? - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - [x] ~~[Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)~~ - [x] ~~API support added~~ - Tests - [x] ~~Added for this feature/bug~~ - [ ] All builds are passing - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [ ] 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 !5643
| * | | Improve performance of SyntaxHighlightFiltersyntax-highlight-filter-performanceYorick Peterse2016-08-031-8/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By using Rouge::Lexer.find instead of find_fancy() and memoizing the HTML formatter we can speed up the highlighting process by between 1.7 and 1.8 times (at least when measured using synthetic benchmarks). To measure this I used the following benchmark: require 'benchmark/ips' input = '' Dir['./app/controllers/**/*.rb'].each do |controller| input << <<-EOF <pre><code class="ruby">#{File.read(controller).strip}</code></pre> EOF end document = Nokogiri::HTML.fragment(input) filter = Banzai::Filter::SyntaxHighlightFilter.new(document) puts "Input size: #{(input.bytesize.to_f / 1024).round(2)} KB" Benchmark.ips do |bench| bench.report 'call' do filter.call end end This benchmark produces 250 KB of input. Before these changes the timing output would be as follows: Calculating ------------------------------------- call 1.000 i/100ms ------------------------------------------------- call 22.439 (±35.7%) i/s - 93.000 After these changes the output instead is as follows: Calculating ------------------------------------- call 1.000 i/100ms ------------------------------------------------- call 41.283 (±38.8%) i/s - 148.000 Note that due to the fairly high standard deviation and this being a synthetic benchmark it's entirely possible the real-world improvements are smaller.
* | | | Merge branch 'fix/import-error' into 'master' Rémy Coutable2016-08-041-1/+1
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix Import/Export error checking versions Fixes small bug preventing the correct error message about Import/Export version being displayed. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/20536 - [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 !5638
| * | | | Fix Import/Export error checking versionsfix/import-errorJames Lopez2016-08-031-1/+1
| |/ / /
* | | | Merge branch 'autolink-filter-text-parse' into 'master' Rémy Coutable2016-08-041-6/+9
|\ \ \ \ | |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Improve AutolinkFilter#text_parse performance ## What does this MR do? This MR improves the performance of `AutolinkFilter#text_parse` by using XPath queries for filtering out most text nodes. ## Are there points in the code the reviewer needs to double check? Mostly the styling of things. ## Why was this MR needed? Parsing text nodes is slow, mostly because most of this happens in Ruby. ## What are the relevant issue numbers? https://gitlab.com/gitlab-org/gitlab-ce/issues/18593 ## Does this MR meet the acceptance criteria? - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - [x] ~~[Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)~~ - [x] ~~API support added~~ - Tests - [x] ~~Added for this feature/bug~~ - [ ] 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 !5629
| * | | Improve AutolinkFilter#text_parse performanceautolink-filter-text-parseYorick Peterse2016-08-031-6/+9
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By using clever XPath queries we can quite significantly improve the performance of this method. The actual improvement depends a bit on the amount of links used but in my tests the new implementation is usually around 8 times faster than the old one. This was measured using the following benchmark: require 'benchmark/ips' text = '<p>' + Note.select("string_agg(note, '') AS note").limit(50).take[:note] + '</p>' document = Nokogiri::HTML.fragment(text) filter = Banzai::Filter::AutolinkFilter.new(document, autolink: true) puts "Input size: #{(text.bytesize.to_f / 1024 / 1024).round(2)} MB" filter.rinku_parse Benchmark.ips(time: 15) do |bench| bench.report 'text_parse' do filter.text_parse end bench.report 'text_parse_fast' do filter.text_parse_fast end bench.compare! end Here the "text_parse_fast" method is the new implementation and "text_parse" the old one. The input size was around 180 MB. Running this benchmark outputs the following: Input size: 181.16 MB Calculating ------------------------------------- text_parse 1.000 i/100ms text_parse_fast 9.000 i/100ms ------------------------------------------------- text_parse 13.021 (±15.4%) i/s - 188.000 text_parse_fast 112.741 (± 3.5%) i/s - 1.692k Comparison: text_parse_fast: 112.7 i/s text_parse: 13.0 i/s - 8.66x slower Again the production timings may (and most likely will) vary depending on the input being processed.
* | | Merge branch 'update-gitlab-shell-in-tests' into 'master' Robert Speicher2016-08-031-2/+8
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Update the gitlab-shell version in the tmp/tests directory to the right version Previously the gitlab-shell version would never be updated if the directory existed via the `gitlab:shell:install` Rake task. This could lead to incompatibility issues or random errors. See merge request !5646
| * | | Update the gitlab-shell version in the tmp/tests directory to the right versionupdate-gitlab-shell-in-testsStan Hu2016-08-031-2/+8
| |/ / | | | | | | | | | | | | | | | Previously the gitlab-shell version would never be updated if the directory existed via the `gitlab:shell:install` Rake task. This could lead to incompatibility issues or random errors.
* | | Make Compare#diffs diff_options a regular argumentDouwe Maan2016-08-031-1/+1
| | |
* | | switch from diff_file_collection to diffs20034-safe-diffsPaco Guzman2016-08-038-44/+24
| | | | | | | | | | | | So we have raw_diffs too
* | | Introduce Compare model in the codebase.Paco Guzman2016-08-035-17/+19
| | | | | | | | | This object will manage Gitlab::Git::Compare instances
* | | Move to Gitlab::Diff::FileCollectionPaco Guzman2016-08-037-5/+162
| | | | | | | | | Instead calling diff_collection.count use diff_collection.size which is cache on the diff_collection
* | | Cache highlighted diff lines for merge requestsPaco Guzman2016-08-034-5/+23
|/ / | | | | | | Introducing the concept of SafeDiffs which relates diffs with UI highlighting.
* | Merge branch 'fix-downtime-check-compare-with-branch' into 'master' Yorick Peterse2016-08-021-20/+6
|\ \ | | | | | | | | | | | | Always compare with FETCH_HEAD in downtime_check See merge request !5619
| * | Always compare with FETCH_HEAD in downtime_checkYorick Peterse2016-08-021-20/+6
| |/ | | | | | | | | This ensures this CI step works properly even when doing a shallow clone.
* | fix TODO comment [ci skip]James Lopez2016-08-021-1/+1
|/
* Add support for relative links starting with ./ or / to RelativeLinkFilter ↵winniehell2016-08-021-0/+3
| | | | (!5586)
* Catch what warden might throw when profiling requests to re-throw itfix/request-profiler-error-when-unauthenticatedAhmad Sherif2016-08-011-2/+8
| | | | Closes #20488
* Merge branch 'fix/request-profiler-middleware-error-on-reload' into 'master' Douwe Maan2016-08-011-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix RequestProfiler::Middleware error when code is reloaded in development ## What does this MR do? It explicitly requires `Gitlab::RequestProfiler::Middleware` before inserting it in the stack instead of autoloading it. ## Are there points in the code the reviewer needs to double check? N/A ## Why was this MR needed? It fixes #20452 ## What are the relevant issue numbers? #20452 ## Screenshots (if relevant) N/A ## 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~~ - [ ] ~~Added for this feature/bug~~ - [ ] ~~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 !5593
| * Fix RequestProfiler::Middleware error when code is reloaded in developmentfix/request-profiler-middleware-error-on-reloadAhmad Sherif2016-08-011-0/+1
| | | | | | | | Closes #20452
* | Merge branch 'fix/use-fewer-queries-for-ci-charts' into 'master' Douwe Maan2016-08-011-26/+70
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use fewer queries for CI charts ## What does this MR do? It reduces number of queries sent for aggregating counts for CI graphs. ## Are there points in the code the reviewer needs to double check? N/A ## Why was this MR needed? For this project (gitlab-ce), loading `/graphs/master/ci` is so slow it times out eventually. I did a quick benchmarking on production and found that it can take 72.5 seconds to only load the controller action variables (there are queries done from the view, didn't look into those). This MR reduces the time to about 2.5 seconds. Extra improvement could be done by introducing an index on `gl_project_id` and `created_at` for `ci_builds` table, but I can't confirm that right now. ## What are the relevant issue numbers? #20262 ## Screenshots (if relevant) N/A ## 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~~ - ~~[ ] 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 !5502
| * | Use fewer queries for CI chartsfix/use-fewer-queries-for-ci-chartsAhmad Sherif2016-07-271-26/+70
| | |
* | | Merge branch 'fix/importing-io-timing-issue' into 'master' Rémy Coutable2016-08-011-1/+17
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix timing problems running imports on production Fixes https://gitlab.com/gitlab-com/infrastructure/issues/151 I've found out that in staging, the imported file is not copied fully by the time sidekiq runs the job, this should hopefully fix it. (Tested against staging). See merge request !5523
| * | | refactored wait_for_archived_file methodfix/importing-io-timing-issueJames Lopez2016-08-011-6/+4
| | | |
| * | | fix return value and specJames Lopez2016-08-011-1/+1
| | | |
| * | | squashed - fix timing issues in prod importing projectsJames Lopez2016-08-011-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | added changelog fix specs refactored code based on feedback fix rubocop warning
* | | | Merge branch '20473-rails-queue-duration' into 'master' Yorick Peterse2016-08-011-2/+1
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | Gitlab::Metrics.current_transaction needs to be public for RailsQueueDuration See merge request !5592
| * | | | Gitlab::Metrics.current_transaction needs to be public for RailsQueueDurationPaco Guzman2016-08-011-2/+1
| | |_|/ | |/| |
* | | | Trim extra displayed carriage returns in diffs and files with CRLFsStan Hu2016-08-011-1/+1
|/ / / | | | | | | | | | Closes #20440
* | | Merge branch 'fix/labels-milestones-import' into 'master' Rémy Coutable2016-08-016-93/+173
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix Importing labels and milestones associations - Import/Export Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/19510 and https://gitlab.com/gitlab-org/gitlab-ce/issues/19447 - [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 !5426
| * | | squashed - fixed label and milestone association problems, updated specs and ↵fix/labels-milestones-importJames Lopez2016-08-016-93/+173
| |/ / | | | | | | | | | refactored reader class a bit
* | | Merge branch 'zj-env-external-url' into 'master' Rémy Coutable2016-08-013-0/+92
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add an URL field to Enviroments ## What does this MR do? Adds a field to the `enviroments` table to expose later in other features. Now I see the task list below, I noticed I forgot some minor things, but Ill adress those after the first review. ## Are there points in the code the reviewer needs to double check? The field is a string on the database, thus limited to 255 chars, which seems more than enough. ## What are the relevant issue numbers? Closes #19527 ## Screenshots (if relevant) ![Screen_Shot_2016-07-25_at_15.22.16](/uploads/5c3f39466f8e2114195270006aed20c0/Screen_Shot_2016-07-25_at_15.22.16.png)![Screen_Shot_2016-07-25_at_15.22.53](/uploads/408cf86610137dd4a861d15dcd677a2c/Screen_Shot_2016-07-25_at_15.22.53.png)![Screen_Shot_2016-07-25_at_15.23.10](/uploads/927c506931f4e0338cdbbc58678bd308/Screen_Shot_2016-07-25_at_15.23.10.png) ## Does this MR meet the acceptance criteria? - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - [x] 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] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) See merge request !5469
| * | Minor fixes in the Env API endpointszj-env-external-urlZ.J. van de Weg2016-08-011-1/+5
| | |
| * | Use Grape DSL for environment endpointsZ.J. van de Weg2016-07-292-48/+47
| | | | | | | | | | | | Also a couple of minor edits for this branch are included
| * | Incorporate feedbackZ.J. van de Weg2016-07-291-4/+1
| | |
| * | Add API support for environmentsZ.J. van de Weg2016-07-293-0/+92
| | |
* | | Merge branch 'fix/import-project-hooks' into 'master' Douwe Maan2016-07-292-1/+19
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fix repo hooks missing on import Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/19556 Repo hooks are missing from imported projects - [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 !5549
| * | | fix repo hooks missing on importfix/import-project-hooksJames Lopez2016-07-282-1/+19
| | | | | | | | | | | | | | | | fix spec and added changelog
* | | | Merge branch 'ability-batch-issue-checking' into 'master' Robert Speicher2016-07-291-3/+4
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Optimize checking if a user can read multiple issues ## What does this MR do? This optimizes various parts of the code so it can more efficiently check if a user can read a list of issues. ## Are there points in the code the reviewer needs to double check? Yes, in particular `Ability.issues_readable_by_user` should be checked to make sure it correctly allows/restricts access to issues. ## Why was this MR needed? Currently the general approach to checking if one can read an issue is to iterate over the issues to check and call `can?(user, :read_issue, issue)` for every issue. This is not efficient as the same work has to be done for every issue. ## What are the relevant issue numbers? * #15607 * #17463 See merge request !5370
| * | | | Method for returning issues readable by a userability-batch-issue-checkingYorick Peterse2016-07-291-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The method Ability.issues_readable_by_user takes a list of users and an optional user and returns an Array of issues readable by said user. This method in turn is used by Banzai::ReferenceParser::IssueParser#nodes_visible_to_user so this method no longer needs to get all the available abilities just to check if a user has the "read_issue" ability. To test this I benchmarked an issue with 222 comments on my development environment. Using these changes the time spent in nodes_visible_to_user was reduced from around 120 ms to around 40 ms.