Global Search should handle files with long lines in code search results without trying to render the whole line

WARNING Some of the links around this issue will cause browsers to crash. I have put these links in code blocks.

Priority: This issue will be resolved with the issue that is similar Search result with long line changes displayed as horizontal scrolling

We should still consider a "trim" for the max char in a single line. 1K max?

Overview

In examples where a file has a very long line, the Global Search results page will occasionally crash.

https://gitlab.com/search?group_id=9970&scope=blobs&search=English.json

It appears that the full file is trying to load since its all on one line. 2022-05-13_15.53.33

I could also see the size of the CPU spiked as this page was trying to load. trying to load the whole file.

Screen_Shot_2022-05-13_at_3.57.35_PM

Possible options for Addressing this

  • If there is a way to specify a character maximum for the API that is returning the raw blob, it would give flexible options for other pages that might have a similar issue in the future.

Even at 4000 characters should result in a much more perfromant page.

Similar occurrence

This also happens on the file page. The file contains 32500 words in one line.

https://gitlab.com/gitlab-org/security-products/dependencies/golang/zxcvbn-go/-/blob/master/data/data/English.json#L1

Click to expand process progress

Next Steps for this issue

Validation track

Build track

  • workflowplanning breakdown - @JohnMcGuire
    • Well-scoped MVC issues
      • Issues are the SSOT for all feature development.
      • Refine issues into something that can be delivered within a single milestone
      • Open follow on issues to track work that is de-prioritized
      • Promote existing issues to Epics and open implementation issues for the upcoming milestone
      • Review feature issues with contributors
      • Consider scheduling a POC or engineering investigation issue
      • Make scope tradeoffs to reach for a right-sized MVC
      • Request an issue review to ensure communication is clear and have proposed the right iteration plan to execute on the solution.
  • Prioritized in Milestone
    • The team should understand what issues should be delivered during the next milestone
  • workflowready for development - @JohnMcGuire
  • typebug typefeature typemaintenance - @JohnMcGuire
  • Deliverable - @changzhengliu and @nickbrandt
  • Add to Planning Issue - @JohnMcGuire
  • Defined Quality Plan -@ebanks
  • workflowrefinement - @changzhengliu
    • as needed, refine the aspects of the original feature
  • workflowin dev - @changzhengliu
    • Applied by the engineer after work (including documentation) has begun on the issue. An MR is typically linked to the issue at this point.
  • workflowin review - Engineering
    • Applied by an engineer indicating that all MRs required to close an issue are in review.
  • workflowblocked - Engineering
    • Applied if at any time during development the issue is blocked. For example: technical issue, open question to PM or PD, cross-group dependency.
  • workflowverification - Engineering
    • After the MRs in the issue have been merged, this label is applied signaling the issue needs to be verified in staging or production.
  • workflowawaiting security release -Engineering
    • Applied by an engineer after the security issue has passed verification, this label signals that it is ready but awaiting the next monthly security release.
  • Close the Issue - Once available in production
  • Feature is available to GitLab.com hosted customers - Developer
  • Feature is available to self-managed customers - Developer
    • Code is included in the self-managed release (depending upon the cut-off).
  • Stakeholders of a feature will know it's available in production - Developer
    • After the feature is deployed to production and any needed verification in production is completed, the development team will close the issue.
    • Prior to the issue being closed, the development team may set the workflow label to workflow::verification or workflow::production for tracking purposes.
    • Product Manager may follow up with individual stakeholders to let them know the feature is available.
  • Customers will be informed about major changes - @JohnMcGuire
Edited by John McGuire