insights: return repository metadata in ComputeText stream API
Created by: coury-clark
Code Insights requires results to have repository metadata so we can do operations such as sub-repo permissions filtering, repo permissions, and insight filtering. In the GraphQL API the ComputeText offers the repository metadata, but does not return the same in the streaming API.
query Run($query: String!) {
compute(query: $query) {
__typename
... on ComputeMatchContext {
repository {
name
id
}
commit
path
matches {
value
environment {
variable
value
}
range{
start {
line
character
}
end {
line
character
}
}
}
}
... on ComputeText {
value
}
}
}
Streaming response: https://sourcegraph.com/github.com/sourcegraph/sourcegraph@409396a94f38279d147e996cd867e1faef0947c0/-/blob/enterprise/internal/compute/text_result.go?L3-6