This repository was archived by the owner on Sep 30, 2024. It is now read-only.
chore(search): update search API call sites to set the version explicitly#63782
Merged
stefanhengl merged 2 commits intoJul 12, 2024
Merged
Conversation
stefanhengl
commented
Jul 11, 2024
| SavedSearchResult, | ||
| } from '../graphql-operations' | ||
|
|
||
| export function fetchReposByQuery(query: string): Observable<{ name: string; url: string }[]> { |
stefanhengl
commented
Jul 11, 2024
| expect(receivedQuery).toEqual('r:golang/oauth2 test f:travis') | ||
| expect(receivedOptions).toEqual({ | ||
| version: 'V3', | ||
| version: LATEST_VERSION, |
Member
Author
There was a problem hiding this comment.
This is consistent with the rest of the web client code.
Contributor
There was a problem hiding this comment.
Could you explain the reasoning for using LATEST_VERSION for web client code, while explicitly pinning to V3 elsewhere? Would it be simpler/ more consistent to use one or the other everywhere?
Contributor
There was a problem hiding this comment.
Answering my own question: this constant is only available in the web client :)
stefanhengl
commented
Jul 11, 2024
| const countGoImportersGraphQLQuery = ` | ||
| query CountGoImporters($query: String!) { | ||
| search(query: $query) { results { matchCount } } | ||
| query CountGoImporters($query: String!, $version: SearchVersion!) { |
Member
Author
There was a problem hiding this comment.
This supports a rather obscure feature for .com I didn't know about. See here.
jtibshirani
approved these changes
Jul 11, 2024
jtibshirani
left a comment
Contributor
There was a problem hiding this comment.
This looks good to me. The test coverage at this layer is definitely light, but the change feels low risk.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I went through all call sites of the 3 search APIs (Stream API, GQL API, SearchClient (internal)) and made sure that the query syntax version is set to "V3".
Why?
Without this change, a new default search syntax version might have caused a change in behavior for some of the call sites.
Test plan
I tested manually