This repository was archived by the owner on Sep 30, 2024. It is now read-only.
[Backport 5.1]: Allow for null revision resolver when using repo embeddings job's empty revision string#54881
Merged
Merged
Conversation
…ty revision string (#54879) This [PR](https://github.com/sourcegraph/sourcegraph/pull/54804) fixed an issue with job scheduling/execution in the backend. The interim fix of this PR relies on allowing for empty string `revision` values written with a repo embedding job when the repo is empty or some other issue occurs when fetching the repo's default branch (e.g. empty repo). Empty revision value causes issues with graphql query repoEmbeddingJobs when [querying for Revision](https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/client/web/src/enterprise/site-admin/cody/backend.ts?L32-35) as our site admin jobs panel does. `Panic occurred: runtime error: slice bounds out of range [:7] with length 0` This PR updates the embedding job resolver to consider empty revision string acceptable and not call constructor for git commit resolver. Also site admin jobs list will now show repo name if repo is non-null and revision is null. <!-- All pull requests REQUIRE a test plan: https://docs.sourcegraph.com/dev/background-information/testing_principles --> sg manual test (cherry picked from commit 1dd6db4)
Contributor
gl-srgr
approved these changes
Jul 12, 2023
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.
This PR fixed
an issue with job scheduling/execution in the backend. The interim fix
of this PR relies on allowing for empty string
revisionvalues writtenwith a repo embedding job when the repo is empty or some other issue
occurs when fetching the repo's default branch (e.g. empty repo).
Empty revision value causes issues with graphql query repoEmbeddingJobs
when querying for
Revision
as our site admin jobs panel does.
Panic occurred: runtime error: slice bounds out of range [:7] with length 0This PR updates the embedding job resolver to consider empty revision
string acceptable and not call constructor for git commit resolver. Also
site admin jobs list will now show repo name if repo is non-null and
revision is null.
Backport of https://github.com/sourcegraph/sourcegraph/pull/54879
Test plan
Tested on
main