Githawk: Team review requests appear as “Unknown”

Created on 24 Oct 2018  Â·  8Comments  Â·  Source: GitHawkApp/GitHawk

Example: desktop/desktop#5899

On GitHub, it reads “shiftkey requested engineering”


Bug Report Dump (Auto-generated)

Version 1.23.0 (1540303812)
Device: iPhone 8 (iOS 12.0.1)
TestFlight: true

🐛 bug 🐞 github bug

All 8 comments

Can you post the json for that issue?

In events:

{
  "id": 1921400281,
  "node_id": "MDIwOlJldmlld1JlcXVlc3RlZEV2ZW50MTkyMTQwMDI4MQ==",
  "url": "https://api.github.com/repos/desktop/desktop/issues/events/1921400281",
  "actor": {
    "login": "shiftkey",
    "id": 359239,
    "node_id": "MDQ6VXNlcjM1OTIzOQ==",
    "avatar_url": "https://avatars2.githubusercontent.com/u/359239?v=4",
    "gravatar_id": "",
    "url": "https://api.github.com/users/shiftkey",
    "html_url": "https://github.com/shiftkey",
    "followers_url": "https://api.github.com/users/shiftkey/followers",
    "following_url": "https://api.github.com/users/shiftkey/following{/other_user}",
    "gists_url": "https://api.github.com/users/shiftkey/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/shiftkey/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/shiftkey/subscriptions",
    "organizations_url": "https://api.github.com/users/shiftkey/orgs",
    "repos_url": "https://api.github.com/users/shiftkey/repos",
    "events_url": "https://api.github.com/users/shiftkey/events{/privacy}",
    "received_events_url": "https://api.github.com/users/shiftkey/received_events",
    "type": "User",
    "site_admin": true
  },
  "event": "review_requested",
  "commit_id": null,
  "commit_url": null,
  "created_at": "2018-10-23T18:44:41Z",
  "review_requester": {
    "login": "shiftkey",
    "id": 359239,
    "node_id": "MDQ6VXNlcjM1OTIzOQ==",
    "avatar_url": "https://avatars2.githubusercontent.com/u/359239?v=4",
    "gravatar_id": "",
    "url": "https://api.github.com/users/shiftkey",
    "html_url": "https://github.com/shiftkey",
    "followers_url": "https://api.github.com/users/shiftkey/followers",
    "following_url": "https://api.github.com/users/shiftkey/following{/other_user}",
    "gists_url": "https://api.github.com/users/shiftkey/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/shiftkey/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/shiftkey/subscriptions",
    "organizations_url": "https://api.github.com/users/shiftkey/orgs",
    "repos_url": "https://api.github.com/users/shiftkey/repos",
    "events_url": "https://api.github.com/users/shiftkey/events{/privacy}",
    "received_events_url": "https://api.github.com/users/shiftkey/received_events",
    "type": "User",
    "site_admin": true
  },
  "requested_team": {
    "name": "engineering",
    "id": 2765383,
    "node_id": "MDQ6VGVhbTI3NjUzODM=",
    "slug": "engineering",
    "description": "Implementing Desktop's features, reviewing PRs, and all other development tasks",
    "privacy": "closed",
    "url": "https://api.github.com/teams/2765383",
    "members_url": "https://api.github.com/teams/2765383/members{/member}",
    "repositories_url": "https://api.github.com/teams/2765383/repos",
    "permission": "pull"
  }
}

In the PR:

{
  "requested_teams": [
    {
      "name": "comrades",
      "id": 2418644,
      "node_id": "MDQ6VGVhbTI0MTg2NDQ=",
      "slug": "comrades",
      "description": "Community members with a track record of activity in the Desktop project",
      "privacy": "closed",
      "url": "https://api.github.com/teams/2418644",
      "members_url": "https://api.github.com/teams/2418644/members{/member}",
      "repositories_url": "https://api.github.com/teams/2418644/repos",
      "permission": "pull"
    }
  ]
}

(Sorry for the bad formatting; on mobile)

The timeline event is coming back as null for the GraphQL API.

Request:

query IssueOrPullRequest($owner: String!, $repo: String!, $number: Int!, $page_size: Int!, $before: String) {
  repository(owner: $owner, name: $repo) {
    issueOrPullRequest(number: $number) {
      ... on PullRequest {
        timeline(last: $page_size, before: $before) {
          nodes {
            __typename
            ... on ReviewRequestedEvent {
              createdAt
              actor {
                login
              }
              requestedReviewer {
                __typename
                ... on Actor {
                  login
                }
                ... on Team {
                  name
                }
              }
            }
          }
        }
        number
        title
        merged
      }
    }
  }
}

Params:

{"owner": "desktop","repo": "desktop","number": 5899, "page_size": 20}

Response:

{
  "data": {
    "repository": {
      "issueOrPullRequest": {
        "timeline": {
          "nodes": [
            {
              "__typename": "Commit"
            },
            {
              "__typename": "LabeledEvent"
            },
            {
              "__typename": "LabeledEvent"
            },
            {
              "__typename": "CrossReferencedEvent"
            },
            {
              "__typename": "CrossReferencedEvent"
            },
            {
              "__typename": "IssueComment"
            },
            {
              "__typename": "Commit"
            },
            {
              "__typename": "PullRequestReview"
            },
            {
              "__typename": "ReviewRequestedEvent",
              "createdAt": "2018-10-23T14:07:38Z",
              "actor": {
                "login": "shiftkey"
              },
              "requestedReviewer": null
            },
            {
              "__typename": "PullRequestReview"
            },
            {
              "__typename": "PullRequestReview"
            },
            {
              "__typename": "AssignedEvent"
            },
            {
              "__typename": "MilestonedEvent"
            },
            {
              "__typename": "CrossReferencedEvent"
            },
            {
              "__typename": "LabeledEvent"
            },
            {
              "__typename": "UnlabeledEvent"
            },
            {
              "__typename": "UnlabeledEvent"
            },
            {
              "__typename": "ReferencedEvent"
            },
            {
              "__typename": "MergedEvent"
            },
            {
              "__typename": "HeadRefDeletedEvent"
            }
          ]
        },
        "number": 5899,
        "title": "refreshed screenshots and instructions for timeline doc",
        "merged": true
      }
    }
  }
}

Note the: "requestedReviewer": null

I wonder if the team is only visible to team members.
I’m getting this:

{
  "data": {
    "repository": {
      "issueOrPullRequest": {
        "timeline": {
          "nodes": [
            // ...
            {
              "__typename": "ReviewRequestedEvent",
              "createdAt": "2018-10-23T14:07:38Z",
              "actor": {
                "login": "shiftkey"
              },
              "requestedReviewer": {
                "__typename": "Team",
                "name": "engineering"
              }
            }
            // ...
          ]
        },
        "number": 5899,
        "title": "refreshed screenshots and instructions for timeline doc",
        "merged": true
      }
    }
  }
}

What do you get for this query?

{
  node(id: "MDIwOlJldmlld1JlcXVlc3RlZEV2ZW50MTkyMDYwMjcwNw") {
    ... on ReviewRequestedEvent {
      requestedReviewer {
        __typename
        ... on Team {
          id
          privacy
          name
        }
      }
    }
  }
  team: node(id: "MDQ6VGVhbTI3NjUzODM=") {
    ... on Team {
      id
      privacy
      name
    }
  }
}

@j-f1

{
  "data": {
    "node": {
      "requestedReviewer": null
    },
    "team": null
  },
  "errors": [
    {
      "message": "Could not resolve to a node with the global id of 'MDQ6VGVhbTI3NjUzODM='.",
      "type": "NOT_FOUND",
      "path": [
        "team"
      ],
      "locations": [
        {
          "line": 14,
          "column": 3
        }
      ]
    }
  ]
}

That’s unfortunate @rnystrom. I guess you have to be an org member to see the teams. Perhaps it’s an API bug and you should be able to request the team name and logo at least?

I bet it is. Will file.

Sent with GitHawk

Did you get the chance to file this one @rnystrom?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Iron-Ham picture Iron-Ham  Â·  3Comments

rnystrom picture rnystrom  Â·  3Comments

jessesquires picture jessesquires  Â·  3Comments

viktorgardart picture viktorgardart  Â·  3Comments

rnystrom picture rnystrom  Â·  3Comments