Filtering forks by affiliation doesn't work

community-help

#1

If I understand the docs, this query should show me any forks of the FeathersJS repository of which I’m a contributor (if I’m the authenticated user):

query Forks {
  repository(owner:"feathersjs",name:"feathers") {
    forks(first:10,affiliations:[COLLABORATOR]) {
      nodes {
        nameWithOwner
      }
    }
  }
}

Similar with OWNER etc. Instead it shows me a list of ALL forks of the repository. This isn’t right, is it? I’ve tried both with an application-generated OAuth token and a GitHub-generated OAuth token. Identical results.

The curl -v logs are below. You can see it’s showing a list of ALL of the forks, and not just ones I’m a collaborator on. Similar results when I use OWNER. For what it’s worth, I do have a fork of this repository, so at least OWNER should come up with (exactly) one, and I would expect COLLABORATORS to be zero (or one?) fork(s).

* STATE: INIT => CONNECT handle 0x600057450; line 1397 (connection #-5000)
* Added connection 0. The cache now contains 1 members
*   Trying 192.30.253.117...
* TCP_NODELAY set
* STATE: CONNECT => WAITCONNECT handle 0x600057450; line 1450 (connection #0)
* Connected to api.github.com (192.30.253.117) port 443 (#0)
* STATE: WAITCONNECT => SENDPROTOCONNECT handle 0x600057450; line 1557 (connection #0)
* Marked for [keep alive]: HTTP default
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
*   CAfile: /usr/ssl/certs/ca-bundle.crt
  CApath: none
* TLSv1.2 (OUT), TLS header, Certificate Status (22):
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* STATE: SENDPROTOCONNECT => PROTOCONNECT handle 0x600057450; line 1571 (connection #0)
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* ALPN, server accepted to use http/1.1
* Server certificate:
*  subject: C=US; ST=California; L=San Francisco; O=GitHub, Inc.; CN=*.github.com
*  start date: Jan 18 00:00:00 2017 GMT
*  expire date: Apr 17 12:00:00 2020 GMT
*  subjectAltName: host "api.github.com" matched cert's "*.github.com"
*  issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=DigiCert SHA2 High Assurance Server CA
*  SSL certificate verify ok.
* STATE: PROTOCONNECT => DO handle 0x600057450; line 1592 (connection #0)
> POST /graphql HTTP/1.1
> Host: api.github.com
> User-Agent: curl/7.50.3
> Accept: */*
> Authorization: token **********efbad51f6
> Content-Length: 153
> Content-Type: application/x-www-form-urlencoded
>
* upload completely sent off: 153 out of 153 bytes
* STATE: DO => DO_DONE handle 0x600057450; line 1654 (connection #0)
* STATE: DO_DONE => WAITPERFORM handle 0x600057450; line 1781 (connection #0)
* STATE: WAITPERFORM => PERFORM handle 0x600057450; line 1791 (connection #0)
* HTTP 1.1 or later with persistent connection, pipelining supported
< HTTP/1.1 200 OK
* Server GitHub.com is not blacklisted
< Server: GitHub.com
< Date: Tue, 01 May 2018 16:40:52 GMT
< Content-Type: application/json; charset=utf-8
< Content-Length: 444
< Status: 200 OK
< X-RateLimit-Limit: 5000
< X-RateLimit-Remaining: 4983
< X-RateLimit-Reset: 1525194281
< Cache-Control: no-cache
< X-OAuth-Scopes: repo
< X-Accepted-OAuth-Scopes: repo
< X-GitHub-Media-Type: github.v4; format=json
< Access-Control-Expose-Headers: ETag, Link, Retry-After, 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: *
< Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
< X-Frame-Options: deny
< X-Content-Type-Options: nosniff
< X-XSS-Protection: 1; mode=block
< Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin
< Content-Security-Policy: default-src 'none'
< X-Runtime-rack: 0.086772
< X-GitHub-Request-Id: F93C:450E:2D9F0CF:69F0942:5AE89894
<
{"data":{"repository":{"forks":{"nodes":[{"nameWithOwner":"nvdnkpr/feathers"},{"nameWithOwner":"justgeek/feathers"},{"nameWithOwner":"dileephell/feathers"},{"nameWithOwner":"twistedogic/feathers"},{"nameWithOwner":"Jalalhejazi/feathers"},{"nameWithOwner":"sharmapradeep/feathers"},{"nameWithOwner":"vvelar/feathers"},{"nameWithOwner":"yoanvillanueva/feathers"},{"nameWithOwner":"mixxmac/feathers"},{"nameWithOwner":"tung-nguyen/feathers"}]}}}}
* STATE: PERFORM => DONE handle 0x600057450; line 1955 (connection #0)
* multi_done
* Curl_http_done: called premature == 0
* Connection #0 to host api.github.com left intact

#2

Hi @TimMensch

Thanks for reporting this. I’ve opened an internal issue, we’ll dig into this as soon as we can. We’ll let you know when we have more information!