Skip to content

Reorganise Security Dashboard frontend files

Summary

Originally, there was only the Group Security Dashboard, so the current structure/naming scheme made sense. Now that the Security Dashboard exists for Projects, Pipelines and Instances as well, it doesn't make so much sense.

This issue is about renaming/moving various files to make it less confusing.

Here's a rough outline of suggested changes (incomplete; please update this if you have any ideas)

  • Rename the base Security Dashboard component from app.vue to security_dashboard.vue, and update all imports of it to SecurityDashboard
  • Make the locations of the entry points of the Group, Pipeline, Project and Instance entry points consistent
  • Possibly create group/project/pipeline/instance subdirectories which contain files relevant only to those dashboards.
    • This isn't especially straight-forward, since the store has several parts unique to some dashboards.
    • Perhaps something like ee/app/assets/javascripts/security_dashboard/{common,group,pipeline,project,instance}/{components,store}?
  • Move ee/app/assets/javascripts/vue_shared/security_reports/card_security_reports_app.vue to somewhere appropriate in ee/app/assets/javascripts/security_dashboard

Improvements

  • It'll be easier to find the files relevant to the dashboard feature you're working on.

Risks

  • Moved files aren't quite as easy to get the commit history for.
    • git log's --follow and git diff's -M flags help, but aren't perfect.
  • Merge conflicts if other dashboard work is being done concurrently.

Involved components

Entry points

TODO

Components

TODO

cc @samdbeckham