Skip to content

Code insights: Add BE insight creation UI

Administrator requested to merge code-insights/be-insight-creation-ui into main

Created by: vovakulikov

Context

Since this PR we have some new insight type called insight BE (or over all repositories insight). This insight will collect information from all repositories in sg instance. To introduce this new type of insight this PR adds a new form field to the insight creation/edit UI

image

With this turned-on mode, the creation UI creates BE insight. A couple of words about this new BE insights

  • Collect data for insight from all repositories that you have in instance (because of this we disable the repositories field in the form)
  • Work with fixed time step between chart data points (2 weeks). Because of that we disable the time step and set 2 weeks-value programmatically
  • This type of insight lives in a special place in the setting file - insights.allrepos
"insights.allrepos" : { "<insight_id>: { /* insight configuration */}"}

What have been done

  • Add all repos UI (form checkbox)
  • Add all repos logic to other form fields (disable repositories and time step in case if all repos is checked
  • Connect UI to the update logic

How to test

  1. Go to /insights/create/search - the search based insight creation UI page
  2. Try to fill some value as you do usually when you want to create a code insight
  3. Turn on all repos mode (checked the new checkbox from screenshot above)
  4. You must see that repositories and timestep field are disabled
  5. Click create button
  6. Check your settings, you must see insights.allrepos map with your newly created insight's configurations

Merge request reports

Loading