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

Conversation

@emidoots
Copy link
Member

Today, series_id will need to be some unique identifier of the actual series definition in the user/org/global settings, e.g. there are two unique series here:

"insights": [
    {
      "title": "fmt usage",
      "description": "fmt.Errorf/fmt.Printf usage",
      "series": [
        {
          "label": "fmt.Errorf",
          "search": "errorf",
        },
        {
          "label": "printf",
          "search": "fmt.Printf",
        }
      ]
    }
  ]

The plan was to have series_id effectively be a hash of the source of settings (user ID / org ID / global) + the actual info associated with the insight series. However, an int32 is likely not sufficient for this due to collisions. I considered using crc64 with an int64 data type, but there is still some uncomfortable room for collisions there and text is cheap - so let's just store text for now and use a sha256 hash to err on the side of caution.

@emidoots emidoots added team/internal-contributor code-insights Issues related to the Code Insights product labels Feb 12, 2021
@emidoots emidoots added this to the 3.25 milestone Feb 12, 2021
@emidoots emidoots requested a review from efritz February 12, 2021 20:27
@sourcegraph-bot
Copy link
Contributor

sourcegraph-bot commented Feb 12, 2021

Notifying subscribers in CODENOTIFY files for diff 31b2bb0...ade410d.

Notify File(s)
@felixfbecker enterprise/internal/insights/store/store_test.go

@emidoots emidoots changed the title insights: change series_id to bigint insights: change series_id to string (hash) Feb 12, 2021
@emidoots emidoots mentioned this pull request Feb 12, 2021
27 tasks
Signed-off-by: Stephen Gutekanst <stephen@sourcegraph.com>
@emidoots emidoots force-pushed the sg/insights-series-id branch from 1d0064f to efee7d4 Compare February 12, 2021 22:25
@emidoots emidoots changed the title insights: change series_id to string (hash) insights: change series_id to string (hash); add index Feb 12, 2021
Stephen Gutekanst added 2 commits February 12, 2021 15:36
Signed-off-by: Stephen Gutekanst <stephen@sourcegraph.com>
Signed-off-by: Stephen Gutekanst <stephen@sourcegraph.com>
@emidoots emidoots enabled auto-merge (squash) February 12, 2021 22:46
@emidoots emidoots merged commit 90bd488 into main Feb 12, 2021
@emidoots emidoots deleted the sg/insights-series-id branch February 12, 2021 22:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

code-insights Issues related to the Code Insights product

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants