Skip to content

Instantly share code, notes, and snippets.

@Joelkw
Last active July 26, 2022 22:25
Show Gist options
  • Save Joelkw/84094124155f3e7050c1628c5d24bbe3 to your computer and use it in GitHub Desktop.
Save Joelkw/84094124155f3e7050c1628c5d24bbe3 to your computer and use it in GitHub Desktop.
Code_insights_experimental_mapping_type.md

Code Insights Experimental Mapping Type - 3.42 and up

This is an EXPERIMENTAL prototype. Unlike the rest of the code insights product, we make no guarantees that the data returned is fully accurate (in many case, it will be, but we haven't exhaustively tested it). There are also many UX dead-ends, bumps, and error states not perfectly handled yet.

image

This prototype is the first portion of the work in sourcegraph/sourcegraph#33632 .

This insights type helps answer questions like:

  • What repositories change the most for any specific search target (heatmap-like questions)? What changes the most/least?
  • Who resuses code / writes code that matches a search target?
  • [Soon] What is the current breakdown of capture-group patterns (like versions) in my repos or files?
  • What is the current status of a migration, broken down by repository?*

*This works for any individual series insight. Adding two series per insight should (and will) create a "grouped bar" chart, but that hasn't been implemented yet so right now it'll just sum them in the same bar.

Enable the experimental prototype

You must be on Sourcegraph 3.42 or later to use this prototype. Navigate to your user settings in your avatar dropdown menu and put this "codeInsightsCompute": true flag in your experimental features, like:

  "experimentalFeatures": {
    ...,
    "codeInsightsCompute": true,
  },

Use the experimental prototype

Navigate to /insights/create and select the group results type.

Quick tips the UI may not fully communicate yet

  • You can only use author/date mappings for type:diff or type:commit searches
  • You cannot use path mappings for type:diff or type:commit searches
  • You can sort by date in correct date order on the filter panel after you save and create the insight, when you view it on a dashboard
  • You can't click into any of the data yet
  • You can't set the colors yet (need to be per-series)
  • You can only run this over explicit repo list
  • You can't add multiple series in any meaningful way (it'll sum the values of both series rather than use a grouped bar chart)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment