Skip to content

Include number of files in snippet lists

Based on #213641 (closed) and #215008 (comment 327367990), we might want the number of files stored in the repository in order to show them to the user.

Each snippet has a matching SnippetStatistics object. This object includes some information about the repository, like the number of commits, size, and file count.

We could get the file_count from SnippetStatistics and show it in the snippet list.

We should tweak the query in the controller in order to "join" the SnippetStatistics and avoid N+1.

Proposal

image

  • Add file count and file icon svg in right area
  • On hover, tooltip displays {file count} files

Availability and Testing

Please run package-and-qa to ensure existing tests still pass. Test coverage to be expanded to include file count as part of gitlab-org/quality/testcases#1707 (closed) (DRI: @a_mcdonald)

This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.

Edited by 🤖 GitLab Bot 🤖