Bug: asking for refs on a PullRequest


#1

I’ve tried this with two organization, and it only fails for mine :worried:.

I think it might be a corrupted repo somewhere (e.g. a force push or something?)

Repro steps

query ($orgName: String!) {
  organization(login: $orgName) {
    repositories(first: 30, isFork: false) {
      edges {
        node {
          pullRequests(last:30) {
            edges {
              node {
                baseRef {
                  target {
                    oid
                  }
                }
                headRef {
                  target {
                    oid
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

Failure case

With these parameters

{
  "orgName": "convoyinc"
}

I get

{
  "data": null,
  "errors": [
    {
      "message": "Something went wrong while executing your query. This is most likely a GitHub bug. Please include \"36F244DB:51B1:5A098FD:58631686\" when reporting this issue."
    }
  ]
}

But it works with e.g. lodash as an orgName.


#2

That’s really strange. :thinking: I can’t reproduce this on any of my accounts.

I wonder if it was a temporary issue. Could you try again?


#3

Yep, just repro’d again (for convoyinc)

{
  "data": null,
  "errors": [
    {
      "message": "Something went wrong while executing your query. This is most likely a GitHub bug. Please include \"36A63F5F:25EDF:265EB56:586BE9D3\" when reporting this issue."
    }
  ]
}

#4

Just did some more narrowing on the problem. It seems like there’s a specific PR that’s triggering this. The only thing I see suspicious about this PR is that one of the commits came from a coworker who had a messed up .gitconfig


#5

Got Vince to update his Github account, but I can still repro this issue.

Now I’m wondering if maybe it’s a different PR than I thought. We have one immediately after that (by PR number) that had a change to the base branch before merging. I’ll try to repro that on a public repo


#6

Nope, wasn’t able to repro on https://github.com/alexturek/gql-bug-repro


#7

I was able to repro by referencing a closed branch whose base branch had been deleted. In the docs it appears that headRef can be null, but baseRef cannot. I’m not sure of a good work around or if this is really the intended behavior but removing baseRef from the query above fixed it for me :thumbsup:


#8

@vincecoppola I’ve changed baseRef to be nullable, so that error should go away. Let me know if it doesn’t.

In addition, there are now fields called headRefName and baseRefName to get the names of the head and base refs as they existed when the PR was created, even if the refs have since been deleted.