Skip to content

Conversation

@mrnugget
Copy link
Contributor

This is the fix for the issue reported in https://github.com/sourcegraph/customer/issues/537.

The problem:

  1. Sometimes repositories don't have a default branch, because they're being cloned or updated by Sourcegraph. See code here: git.DefaultBranch
  2. We skip the repositories with no repositories, but too late. With the introduction of .batchignore we added additional code that broke that check.

This is the fix for the issue reported in sourcegraph/customer#537.

The problem:

1. Sometimes repositories don't have a default branch, because they're
   being cloned or updated by Sourcegraph. See code here:

   https://sourcegraph.com/github.com/sourcegraph/sourcegraph@1cbb9023b0c77e6fa132298df1b2b5a768288d67/-/blob/internal/vcs/git/default_branch.go?L6
2. We skip the repositories with no repositories, *but too late*. With
   the introduction of `.batchignore` we added additional code that
   broke that check.
@mrnugget mrnugget requested a review from a team October 22, 2021 08:55
Copy link
Member

@eseliger eseliger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might need to backport this to ssbc 🤔
Good find!

@mrnugget
Copy link
Contributor Author

We might need to backport this to ssbc

I checked: no, it's fine. We do the has-branch check at the top of the process: https://github.com/sourcegraph/sourcegraph/blob/1cbb9023b0c77e6fa132298df1b2b5a768288d67/enterprise/internal/batches/service/workspace_resolver.go#L141-L145

@mrnugget mrnugget merged commit d28f527 into main Oct 22, 2021
@mrnugget mrnugget deleted the mrn/fix-repo-without-branch branch October 22, 2021 11:15
scjohns pushed a commit that referenced this pull request Apr 24, 2023
This is the fix for the issue reported in sourcegraph/customer#537.

The problem:

1. Sometimes repositories don't have a default branch, because they're
   being cloned or updated by Sourcegraph. See code here:
         
 https://sourcegraph.com/github.com/sourcegraph/sourcegraph@1cbb9023b0c77e6fa132298df1b2b5a768288d67/-/blob/internal/vcs/git/default_branch.go?L6
2. We skip the repositories with no repositories, *but too late*. With
   the introduction of `.batchignore` we added additional code that
   broke that check.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants