Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-06-14Don't return nil for missing objects from parser cacheDouwe Maan
2017-06-08Merge branch '25934-project-snippet-vis' into 'security-9-2'DJ Mountney
Fix visibility when referencing snippets See merge request !2101
2017-05-30Fix /unsubscribe slash command creating extra todosSean McGivern
The /unsubscribe slash command means that we check if the current user is subscribed to the issuable without having an explicit subscription. That means that we use the UserParser to find references to them in the notes. The UserParser (and all parsers inheriting from BaseParser) use RequestStore to cache ActiveRecord objects, so that we don't need to load the User object each time, if we're parsing references a bunch of times in the same request. However, it was always returning _all_ of the previously cached items, not just the ones matching the IDs passed. This would mean that we did two runs through with UserParser if you were mentioned in a comment, and then mentioned someone else in your comment while using /unsubscribe: 1. Because /unsubscribe was used, we see if you were mentioned in any comments. 2. Because you mentioned someone, we find them - but we would also get back your user, even if you didn't mention yourself. This would have the effect of creating a mention or directly addressed todo for yourself incorrectly. The fix is simple: only return values from the cache matching the IDs passed.
2017-04-15Fix regression in rendering Markdown references that do not existStan Hu
Closes #30972
2017-04-07Add indication for closed or merged issuables in GFMAdam Buckland
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.
2017-03-17Use Enumerable#index_by where possibleDouwe Maan
2017-03-09use a magic default :global symbol instead of nilhttp://jneen.net/
to make sure we mean the global permissions
2017-02-08Create directly_addressed Todos when mentioned in beginning of a lineErshad Kunnakkadan
2016-11-09Merge branch 'issue_23548_dev' into 'master'Douwe Maan
disable markdown in comments when referencing disabled features fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/23548 This MR prevents the following references when tool is disabled: - issues - snippets - commits - when repo is disabled - commit range - when repo is disabled - milestones This MR does not prevent references to repository files, since they are just markdown links and don't leak information. See merge request !2011 Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-09-28Avoid database queries on Banzai::ReferenceParser::BaseParser for nodes ↵Paco Guzman
without references
2016-08-30remove Ability.abilitieshttp://jneen.net/
2016-07-08Re-use queries in reference parsersYorick Peterse
This caches various queries to ensure that multiple reference extraction runs re-use any objects queried in previous runs.
2016-05-26Split Markdown rendering & reference gatheringYorick Peterse
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.