Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switch to using github api v4 #9

Closed
jmcampanini opened this issue Oct 12, 2018 · 1 comment · Fixed by #37
Closed

switch to using github api v4 #9

jmcampanini opened this issue Oct 12, 2018 · 1 comment · Fixed by #37

Comments

@jmcampanini
Copy link
Member

we should look into switching to using the graphql version of the API for GHE. this would give us pushed timestamps, making invalidate_on_push a lot simpler.

a sample query for this would look like:

{
  repository(owner: "gradle", name: "gradle") {
    pullRequest(number: 5813) {
      comments(first: 100) {
        pageInfo {
          endCursor
          hasNextPage
        }
        nodes {
          body
          createdAt
        }
      }
      reviews(first: 100) {
        nodes {
          createdAt
          author {
            login
          }
          state
        }
      }
      commits(first: 100) {
        nodes {
          commit {
            pushedDate
            author {
              user {
                login
              }
            }
            committer {
              user {
                login
              }
            }
          }
        }
      }
    }
  }
}

As a note, we still need to use the v3 API for changed files, since these are not exposed via GraphQL at this time.

@bluekeyes
Copy link
Member

Instead of paging the three elements individually, #37 converts the Timeline API calls to use GraphQL. I suppose we could also go back to the pre-invalidate_on_push implementation, where each method on pull.Context made it's own API call. But given that all evaluations need all three of these lists, getting everything from the timeline is convenient (even if it includes events we ignore).

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 a pull request may close this issue.

2 participants