Skip to content
GitLab
Next
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    Projects Groups Topics Snippets
  • Register
  • Sign in
  • GitLab FOSS GitLab FOSS
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 22
    • Issues 22
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.orgGitLab.org
  • GitLab FOSSGitLab FOSS
  • Merge requests
  • !4828

Support for rendering/redacting multiple documents

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Yorick Peterse requested to merge refactor-rendering-redacting into master Jun 21, 2016
  • Overview 23
  • Commits 1
  • Pipelines 0
  • Changes 14

What does this MR do?

This MR does two things:

  1. Separate redacting HTML documents from the htm-pipeline Gem and support redacting multiple documents at once
  2. Add code that supports rendering and redacting multiple Markdown documents

See commit d7dc68ef878d2ad032efa92e25a8fa77250f9099 for more information.

Are there points in the code the reviewer needs to double check?

Yes. The way notes are currently gathered in the controllers is something I'm not very fond of.

Why was this MR needed?

Most of this is explained in d7dc68ef878d2ad032efa92e25a8fa77250f9099 but in short:

  • Redacting happened per document, leading to lots of queries being executed for every comment.
  • On GitLab.com between 1 and ~2.5 seconds is spent in redacting documents per request to Projects::IssuesController#show
  • Redacting multiple documents at once greatly reduces the number of SQL queries executed.

What are the relevant issue numbers?

#18581 (closed)

Screenshots (if relevant)

Before/after of the method timings:

redact_timings

Here the green bars are the timings for the RedactorFilter#call method, the orange-ish timings are for Banzai::Redactor#redact.

SQL query count impact:

redact_query_timings

Here the big drop just before 12:30 is when I switched to the branch of this MR, the number of queries dropped from around 4000 to around 2600.

Does this MR meet the acceptance criteria?

  • CHANGELOG entry added
  • Documentation created/updated
  • API support added
  • Tests
    • Added for this feature/bug
    • All builds are passing
  • Conform by the style guides
  • Branch has no merge conflicts with master (if you do - rebase it please)
  • Squashed related commits together
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: refactor-rendering-redacting