Skip to content

Fix error message for edit code stats page

Warren Gifford requested to merge code-insights/edit-error-message-fix into main

Created by: vovakulikov

Closes https://github.com/sourcegraph/sourcegraph/issues/21214

This PR fixes the error message for the code stats edit page for the case when we couldn't find insight with ID in edit page route param.

image

A bit context

For the code stats edit page we have an error message for case when we couldn't find insight for editing in user or org settings. Now you can see this error permanently for old code stats (Language usage) because this insight has the old version of the settings API

Old code stats API

 "codeStatsInsights.query": "repo:^github\\.com/sourcegraph/sourcegraph$",
 "codeStatsInsights.otherThreshold": 0.01,

New code stats API

"codeStatsInsights.insight.metabaseSearchVisibilityTest": {
  "title": "Metabase search visibility test",
  "repository": "github.com/metabase/metabase",
  "otherThreshold": 0.03
}

In theory, we can support the old version of insights to parse codeStatsInsights.query field and extract the repository URL for the new repository setting in the new API. But that was cut off for the sake of hitting 3.28 release goals. For me it seems we can sacrifice support for such cases as we are still in the experiment but if our customers tell us this is the important thing for them let's fix it even if it's something old and experimental.

Merge request reports

Loading