summaryrefslogtreecommitdiff
path: root/lib/banzai/reference_parser/issue_parser.rb
Commit message (Collapse)AuthorAgeFilesLines
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2023-05-091-7/+13
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2023-03-311-0/+1
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2023-03-071-0/+1
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2023-02-221-10/+13
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2021-05-261-8/+1
|
* Enable more frozen string in lib/**/*.rbgfyoung2018-10-061-0/+2
| | | | | | | | | | | | | Enables frozen for the following: * lib/*.rb * lib/banzai/**/*.rb * lib/bitbucket/**/*.rb * lib/constraints/**/*.rb * lib/container_registry/**/*.rb * lib/declarative_policy/**/*.rb Partially addresses #47424.
* Eager load project routes for issue referencesYorick Peterse2018-05-281-1/+2
| | | | | This reduces the number of queries necessary when displaying the activity page of a group.
* Support Markdown rendering using multiple projectsrendering-markdown-multiple-projectsYorick Peterse2018-04-111-9/+30
| | | | | | | | | | | | | | | | | | | This refactors the Markdown pipeline so it supports the rendering of multiple documents that may belong to different projects. An example of where this happens is when displaying the event feed of a group. In this case we retrieve events for all projects in the group. Previously we would group events per project and render these chunks separately, but this would result in many SQL queries being executed. By extending the Markdown pipeline to support this out of the box we can drastically reduce the number of SQL queries. To achieve this we introduce a new object to the pipeline: Banzai::RenderContext. This object simply wraps two other objects: an optional Project instance, and an optional User instance. On its own this wouldn't be very helpful, but a RenderContext can also be used to associate HTML documents with specific Project instances. This work is done in Banzai::ObjectRenderer and allows us to reuse as many queries (and results) as possible.
* Port `read_cross_project` ability from EEBob Van Landuyt2018-02-221-3/+22
|
* Refactor banzai to support referencing from group contextce-backport-3615Jarka Kadlecova2017-12-061-9/+3
|
* Eliminate N+1 queries referencing issuessh-project-feature-eager-loadStan Hu2017-09-181-1/+2
| | | | | | | | To load issue 1, we see that in #38033 that about 835 ms of the SQL queries were due to loading ProjectFeature. We should be able to cut this down by eagerly loading this information. Closes #38033
* Improve support for external issue referencesadam-external-issue-references-spikeAdam Niedzielski2017-06-301-3/+0
|
* Enable Style/DotPosition Rubocop :cop:Grzegorz Bizon2017-06-211-2/+2
|
* Backport of multiple_assignees_feature [ci skip]Valery Sizov2017-05-041-1/+1
|
* Add indication for closed or merged issuables in GFMadam-finish-5993-closed-issuableAdam Buckland2017-04-071-8/+2
| | | | | | | | | | | | | | | Example: for issues that are closed, the links will now show '[closed]' following the issue number. This is done as post-process after the markdown has been loaded from the cache as the status of the issue may change between the cache being populated and the content being displayed. In order to avoid N+1 queries problem when rendering notes ObjectRenderer populates the cache of referenced issuables for all notes at once, before the post processing phase. As a part of this change, the Banzai BaseParser#grouped_objects_for_nodes method has been refactored to return a Hash utilising the node itself as the key, since this was a common pattern of usage for this method.
* 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.
* Eager load project relations in IssueParserYorick Peterse2016-06-151-1/+15
| | | | | | | | | | | | | By eager loading these associations we can greatly cut down the number of SQL queries executed when processing documents with lots of references, especially in cases where there are references belonging to the same project. Since these associations are so specific to the reference parsing process and the permissions checking process that follows it I opted to include them directly in IssueParser instead of using something like a scope. Once we have a need for it we can move this code to a scope or method.
* Split Markdown rendering & reference gatheringYorick Peterse2016-05-261-0/+40
This splits the Markdown rendering and reference extraction phases into two distinct code bases. The reference extraction phase no longer relies on the html-pipeline Gem (and any related code) and allows for extracting of references from multiple HTML nodes in a single pass. This means that if you want to extract user references from 200 comments you no longer need to run 200 times N number of queries, instead only a handful of queries may be needed.