Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Conversation

@camdencheek
Copy link
Member

@camdencheek camdencheek commented Jul 12, 2023

This PR 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

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.

Backport of https://github.com/sourcegraph/sourcegraph/pull/54879

Test plan

Tested on main

…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)
@cla-bot cla-bot bot added the cla-signed label Jul 12, 2023
@camdencheek camdencheek changed the base branch from main to 5.1 July 12, 2023 19:37
@camdencheek camdencheek marked this pull request as ready for review July 12, 2023 19:37
@camdencheek camdencheek requested a review from gl-srgr July 12, 2023 19:37
@sourcegraph-bot
Copy link
Contributor

📖 Storybook live preview

@camdencheek camdencheek enabled auto-merge (squash) July 12, 2023 19:47
@camdencheek camdencheek disabled auto-merge July 12, 2023 19:47
@camdencheek camdencheek enabled auto-merge (squash) July 12, 2023 19:47
@camdencheek camdencheek merged commit 98ba21d into 5.1 Jul 12, 2023
@camdencheek camdencheek deleted the cc/backport-54879-to-5.1 branch July 12, 2023 19:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants