Add Starred Snippets

Description

A snippet was recommended to me, however there is no way mark it as "starred" so that I can more easily find it later.

We currently have Starred projects, which makes it easy to star a project you're interested in and be able to find it later.

Screen_Shot_2018-05-09_at_3.46.41_PM

But we don't have a "Starred snippets", just this

Screen_Shot_2018-05-09_at_3.48.13_PM

Proposal

Add a way to "star" a snippet, like we can do for projects, and be able to list them.

Testing Activity

@lulalala:

  • Test starring works for both web and API calls Star creation/deletion

@vij:

  • Snippet visibility level change impacts
  • Test dependency changes (Snippet deletion, Project deletion/snippets disabled/etc)
  • Test Finder with starred snippets / no starred snippets / visibility levels (project scoping)

@a_luna:

  • Starring a snippet creates an association between the snippet and the user
  • Unstarring a snippet deletes the association between the snippet and the user
  • If a snippet is already starred there shouldn’t be any duplicates created

Security Testing

  • Test starred snippet access for other users (@vij)

MR Breakdown

@lulalala:

  • 1 MR (db)
  • 1 MR (controller)
  • 1 MR (API)

@vij:

  • 1 MR for basic starring support (relationships, actions, refactor of starred projects common functionality)
  • 1 MR for starred snippets UI support (finders, counts)
  • 1 MR for API / GraphQL support if required

@a_luna:

  • 1 MR adding the association between starred snippets and user (with a new table)
  • 1 MR adding endpoint to star/unstar snippets
  • 1 MR adding methods to list starred snippets for the user
  • 1 MR with FE changes
  • 1 MR for API changes

Links / references

https://gitlab.com/gitlab-org/gitlab-ce/issues/19336

Edited Apr 13, 2020 by Darva Satcher
Assignee Loading
Time tracking Loading