Possible bug: refs of Repository returns null


#1

Consider the following query:

{
  pyenv: repository(owner: "yyuu", name: "pyenv") {
    tags: refs(refPrefix: "refs/tags/", last: 1) {
      edges {
        cursor
        node {
          name
        }
      }
    }
  }
}

Response:

{
  "data": {
    "pyenv": null
  }
}

when the repository at question certainly has tags. Note that I’ve been using tags of Respository with this exact repository (as part of a larger query, including the same thing for multiple repositories) for a month now, and it only started returning null about half an hour ago, so the problem could be transient.

Nevertheless, I compared this to all the other repos I’m monitoring that isn’t showing this problem, and noticed something interesting. Using the REST API, I actually got a 301 redirect:

$ curl -D- 'https://api.github.com/repos/yyuu/pyenv/git/refs/tags?access_token=xxxxxxx'
HTTP/1.1 301 Moved Permanently
Server: GitHub.com
Date: Mon, 06 Mar 2017 02:55:16 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 221
Connection: close
Status: 301 Moved Permanently
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4991
X-RateLimit-Reset: 1488770400
X-OAuth-Scopes: 
X-Accepted-OAuth-Scopes: admin:repo_hook, delete_repo, read:repo_hook, repo, repo:status, repo_deployment, write:repo_hook
Location: https://api.github.com/repositories/5625464/git/refs/tags?access_token=xxxxxxx
X-GitHub-Media-Type: github.v3; format=json
Access-Control-Expose-Headers: ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval
Access-Control-Allow-Origin: *
Content-Security-Policy: default-src 'none'
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
X-Content-Type-Options: nosniff
X-Frame-Options: deny
X-XSS-Protection: 1; mode=block
Vary: Accept-Encoding
X-Served-By: 8dd185e423974a7e13abbbe6e060031e
X-GitHub-Request-Id: FEDA:32C0:199C2F7:208BC26:58BCCF94

{"message":"Moved Permanently","url":"https://api.github.com/repositories/5625464/git/refs/tags?access_token=xxxxxxx","documentation_url":"https://developer.github.com/v3/#http-redirects"}

(the redirected URL works as expected) while other repos just give me 200.

So, I’m just guessing, maybe you’re calling into the REST API internally, and didn’t handle redirects? Anyway, I’m happy to provide any additional info.


Why documentation_url points to v3 instead of v4?