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

Conversation

@gl-srgr
Copy link
Contributor

@gl-srgr gl-srgr 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.

Test plan

sg manual test

…tring is empty. site admin jobs display shows basic repo name if repo && !revision
@cla-bot cla-bot bot added the cla-signed label Jul 12, 2023
@gl-srgr gl-srgr requested a review from camdencheek July 12, 2023 18:38
@sourcegraph-bot
Copy link
Contributor

sourcegraph-bot commented Jul 12, 2023

📖 Storybook live preview

@davejrt davejrt merged commit 1dd6db4 into main Jul 12, 2023
@davejrt davejrt deleted the garyl/null_gitcommitresolver_emptyRevEmbeddingJob branch July 12, 2023 19:16
@github-actions
Copy link
Contributor

The backport to 5.1 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-5.1 5.1
# Navigate to the new working tree
cd .worktrees/backport-5.1
# Create a new branch
git switch --create backport-54879-to-5.1
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 1dd6db4e2d507be7a8c41cec3882290100383e0c
# Push it to GitHub
git push --set-upstream origin backport-54879-to-5.1
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-5.1

Then, create a pull request where the base branch is 5.1 and the compare/head branch is backport-54879-to-5.1.

@github-actions github-actions bot added backports failed-backport-to-5.1 release-blocker Prevents us from releasing: https://about.sourcegraph.com/handbook/engineering/releases labels Jul 12, 2023
gl-srgr added a commit that referenced this pull request Jul 12, 2023
…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)
camdencheek pushed a commit that referenced this pull request Jul 12, 2023
…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)
camdencheek referenced this pull request Jul 12, 2023
…ddings job's empty revision string (#54881)

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.

Backport of https://github.com/sourcegraph/sourcegraph/pull/54879
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

backports cla-signed release-blocker Prevents us from releasing: https://about.sourcegraph.com/handbook/engineering/releases

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants