Filters candidate matches against syntactic SCIP documents#63268
Conversation
c29d4cc to
1ec73fd
Compare
be81f9b to
428b19c
Compare
varungandhi-src
left a comment
There was a problem hiding this comment.
Some initial comments.
There was a problem hiding this comment.
- Let's create a dedicated type for holding both results. That way the value can be passed around, and the relationship between the values is clear when the return value is passed around ("these symbols were obtained in this uploadID").
- nit: Go convention would be to use "ID", not "Id"
There was a problem hiding this comment.
I don't agree with 1.
Once we also allow getting the symbol from the request arg rather than by reading a range in a syntactic index, we'll be getting an "unrelated" uploadId instead.
The uploadId is then also used to look up a bunch of other documents that have nothing to do with the symbols.
There was a problem hiding this comment.
- I know the logging code internally does some de-duplication, but I think since this loop (over
stream.Results) is all in one function, it would be better to record these errors separately and emit a single log message after the loop is complete. E.g. you can collect the files seen multiple times in acollections.Set. - I think all of these should be
Warn, and notError. Is the code behaving in an unexpected way? Yes. Can we continue operating without worrying about some functionality not working properly? I'd say so, we can skip over these unexpected outputs.
There was a problem hiding this comment.
Honestly at that point I'd rather just drop these asserts. I don't want to clutter our logic here with checking invariants in the search client/service. Sounds good?
There was a problem hiding this comment.
We have tests for enry's code so that if something changes there in a way that would break us, we get to know sooner rather than later. I see these warnings in the same vein, especially since these are not documented post-conditions of the functions that we're calling.
There was a problem hiding this comment.
Wrt https://github.com/sourcegraph/sourcegraph/pull/63268/commits/5ccd3a1deb97c949859896098cf2b6b5b2106014, I would prefer that we catch bugs sooner rather than later, so weakly against removing those checks, but leaving the final decision up to you.
There was a problem hiding this comment.
8638879 looking good? I just assumed .String() on a set does something reasonable
varungandhi-src
left a comment
There was a problem hiding this comment.
Approving to unblock; feel free to merge as I don't have major outstanding concerns.
This makes the query match what the frontend does for search-based navigation today
Also emits a warning rather than an error to report failed decoding of ranges
d2c61ec to
793c24b
Compare
Fixes https://linear.app/sourcegraph/issue/GRAPH-667/wrap-up-usage-results-in-graphql-resolvers This allows us to actually return syntactic usages from the occurrences API. It does not implement pagination yet, but I think _that_ PR will be nicer to review after this one landed. Requires #63268 ## Test plan Running queries against the site-admin api console
Closes https://linear.app/sourcegraph/issue/GRAPH-657/fetch-and-filter-scip-documents-based-on-candidate-files
Test plan
Currently only testable via the site-admin API console