Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Codeinsights: selecting datapoints inconsistent #56557

@DaedalusG

Description

@DaedalusG
  • Sourcegraph version: v5.1.x
  • Platform information:

Selecting a plot point on a codeinsight opens a new tab with with a type:diff query whose syntax is sometimes unresolvable and often times out:

For instance the following chart:
Screenshot 2023-09-12 at 3 12 57 PM

This chart generates the following diff search when a plot point is selected:

repo:^(github\.com/sourcegraph/sourcegraph|github\.com/sourcegraph/deploy-sourcegraph-managed|github\.com/sourcegraph/infrastructure|github\.com/sourcegraph/deploy-sourcegraph-cloud|github\.com/sourcegraph/controller)$ after:2023-05-02T01:07:01Z before:2023-05-16T01:10:45Z type:diff lang:go (content:"github.com/sourcegraph/run" AND (run.Cmd OR run.Bash))

Even on a powerful Sourcegraph instance this times out --
Screenshot 2023-09-12 at 3 16 17 PM

Further some regex queries will be incorrectly constructed:

For instance selecting a data point on a series defined by the following query

(.+)\sv(?:[^\s]+)(?: // indirect)? file:go\.mod patterntype:regexp count:all

Will return -

repo:^(github\.com/sourcegraph/sourcegraph)$ after:2022-09-27T00:00:00Z before:2022-11-27T23:09:48Z type:diff file:go\.mod count:99999999 /(?:	github\.com/kr/pretty)\sv(?:[^\s]+)(?: // indirect)?/

In order to view real results the query must be modified to:

repo:^(github\.com/sourcegraph/sourcegraph)$ file:go\.mod count:99999999 (?:	github\.com/kr/pretty)\sv(?:[^\s]+)(?: // indirect)?

Note this blends a bug report and feature request, type:diff searches are expected back from the selection of a datapoint, however the misconstructed regex query is not.

Expected behavior:

Selecting a data point on a codeinsight should return the results that trigger the datapoint to be marked

Actual behavior:

This regularly times out, and some regexp expressions may be misconstructed.

In order to improve the general state of this feature we likely need to improve the state of type:diff searches.

If you would like immediate help on this, please email support@sourcegraph.com (you can still create the issue, but there are no SLAs on issues like there are for support requests).

/cc @vovakulikov

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions