Skip to content

Draft: [POC] Spike sharing visualizations

Jiaan Louw requested to merge 455291-spike-sharing-visualizations into master

What does this MR do and why?

Spike sharing visualizations

This is a technical spike and proof of concept for sharing analytics visualizations in and outside of GitLab. It explores two methods to embed visualizations, one as a JS script and another as a iframe.

DO NOT MERGE!!

Screenshot

image

Findings

  • 👍 Embedding a sharing a visualization in GL application is rather easy.
  • 👎 Embedding and sharing outside of the GL application is more difficult due to open CORS question and external load.

Remaining questions

  • CORS when sharing externally (see slack thread)
  • How to render a rails view that only shows the visualization and no other UI elements or unnecessary resources.

Recommendation on next steps

MVC: Sharable visualizations that can be viewed on a page

  1. backend Prerequisite: Create a new public /load API endpoint that takes the visualization slug as argument. Unlike the current /load this wouldn't accept a query input but read it from the config file to prevent tampering and exposing non-public data. This new endpoint should get heavy caching to decrease the load of exposing it to potentially infinite hits (would memoization work?).
  2. backend Prerequisite: Create a DB table for sharing as @rob.hunt suggested here. Using the viz config to control this (eg visibility: 'public') is handy, but it could create issues with sharing configs. 🤔 This also gives us much more power to expand rules in the future.
  3. frontend MVC: Users can share and view a page that displays a single visualization. Filters would be URL based and come from the dashboard it was shared in.

Iteration 2: Embed visualizations on the same GitLab instance.

  1. frontend Iteration 2: Share visualizations in GitLab application. Need to decide on how?

Iteration 3: Externally embeddable visualizations.

  1. frontend Iteration 3: Share visualizations externally.

Follow-ups

  1. frontend Iteration X?: Filtering inside the visualization view?

Actions

Remaining actions:

  • See if we can solve the remaining issues.
  • Based on agreement from the team I'll create a epic for all the issues.

How to set up and validate locally

View [GDK_HOST]/gitlab-org/gitlab-shell/-/analytics/visualizations

Related to #455291 (closed)

Edited by Jiaan Louw

Merge request reports