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

x/build/maintner: store Github pull request data #21086

Open
kevinburke opened this issue Jul 19, 2017 · 6 comments

Comments

@kevinburke
Copy link
Contributor

commented Jul 19, 2017

If we want this to be a tool for wider use (and I think it would be good to do that), we need to store Github pull request data for projects.

Furthermore, we currently get Git commits from Gerrit CL's, we'll need to allow people to specify Github as their primary Git upstream and fetch commits from Github instead of Gerrit, and also to read some of the metadata from Github's API that we currently parse out of the Git commits in Gerrit.

@gopherbot gopherbot added this to the Unreleased milestone Jul 19, 2017

@gopherbot gopherbot added the Builders label Jul 19, 2017

@andybons

This comment has been minimized.

Copy link
Member

commented Jan 2, 2018

We need the following in the maintner model for #18517 to avoid API calls to GitHub:

@andybons andybons self-assigned this Feb 20, 2018

@dmitshur

This comment has been minimized.

Copy link
Member

commented Apr 10, 2018

If I'm not mistaken, this is done by now. PRs are returned as part of GitHubRepo.ForeachIssue calls and can be identified by the GitHubIssue.PullRequest field being true (see CL 69590).

Is there anything left to do in this issue?

@andybons

This comment has been minimized.

Copy link
Member

commented Apr 10, 2018

There is some data we need in order to avoid calls to the GitHub API in GerritBot.

Number of commits, base ref, HEAD sha, etc.

https://github.com/golang/build/blob/master/cmd/gerritbot/gerritbot.go#L575

It also doesn't support PR comments.

@dmitshur

This comment has been minimized.

Copy link
Member

commented Apr 10, 2018

Thanks for the update.

It also doesn't support PR comments.

To clarify, I think you mean PR reviews and PR review comments. Normal PR comments are already supported; they're identical to issue comments in nature.

@andybons

This comment has been minimized.

Copy link
Member

commented Apr 10, 2018

Correct.

@gopherbot

This comment has been minimized.

Copy link

commented Oct 26, 2018

Change https://golang.org/cl/144699 mentions this issue: maintner: extend GitHubIssue to track Code Review Events

gopherbot pushed a commit to golang/build that referenced this issue Dec 6, 2018
maintner: extend GitHubIssue to track Code Review Events
Previously, maintner would track only the Events
on an Issue/PullRequest, which missed out on the
discussions and approvals that the review
process generates.

This adds a new struct GitHubReviewEvent to represent
the results from the GitHub "pulls/reviews" API. This
struct follows the same pattern as the GitHubIssueEvent
struct.

To accomplish this, a new call has been added to the
sync() function: syncReviews, which follows the
pattern established with syncEvents().

Finally, this adds an additonal method: ForeachReview which
iterates over the GitHubReviewEvents in
the given GitHubIssue serially and in
chronological order.

GitHub API Reference: https://developer.github.com/v3/pulls/reviews/

Updates golang/go#21086

Change-Id: I4f59e154a4e4a8a4b8f2676dea932cf44354c288
Reviewed-on: https://go-review.googlesource.com/c/144699
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.