This repository was archived by the owner on Sep 30, 2024. It is now read-only.
fix(code hosts): Use more deterministic API endpoints for GitHub code host connections#63445
Merged
pjlast merged 6 commits intoJul 2, 2024
Conversation
…ast/src-423-the-github-public-repositoryquery-option-needs-to-be
eseliger
approved these changes
Jul 1, 2024
eseliger
left a comment
Member
There was a problem hiding this comment.
GitHub can't render the diffs for the recordings, I trust that the changes there make sense
| defer cancel() | ||
|
|
||
| go func() { | ||
| s.listPublicArchivedRepos(archivedReposCtx, archivedReposChan) |
Member
There was a problem hiding this comment.
I believe this function should be unused now and can be removed
Comment on lines
+753
to
+754
| // The ListPublicRepositories endpoint returns incomplete information, | ||
| // so we make additional calls to get the full information of each repo. |
Member
There was a problem hiding this comment.
I wish the method above would make that clearer by returning a separate type that doesn't have the fields we use - that way it would be impossible to forget to do this extra step anywhere.
but this isn't blocking.
Comment on lines
+177
to
+178
| if countArchived != 2 { | ||
| t.Errorf("unexpected archived repo count, wanted: 2, but got: %d", countArchived) |
Contributor
Author
There was a problem hiding this comment.
Our ghe.sgdev.org instance changed since the previous recording
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.
Sourcegraph currently uses this GitHub API endpoint to fetch public repositories on an instance. However, this endpoint is a lot more limited than the rest of the repository API endpoints. For example, it doesn't return the archive status of a repo, its visibility, or any tags the repo might have.
The aim of this PR is to make additional GraphQL API requests to fetch additional information for the repositories we fetch via this endpoint.
Other approaches we have tried is to use the Search API to fetch public repositories, but pagination on the search API proves to be unreliable.
Additionally, this PR also changes the
"internal"repositoryQuery to use a more reliable API instead of the search APITest plan
Updated recorded tests
Changelog
"internal"repositoryQuery for GitHub code host connections now use a more deterministic API that's less susceptible to missing repositories"public"repositoryQuery for GitHub code host connections now make additional requests to fetch missing repository details, like topics. This fixes an issue where repos added by the"public"repositoryQuery would have missing repo details