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

Bulldozer 1.0 Github App rewrite #50

Merged
merged 6 commits into from
Oct 25, 2018
Merged

Bulldozer 1.0 Github App rewrite #50

merged 6 commits into from
Oct 25, 2018

Conversation

ajlake
Copy link
Contributor

@ajlake ajlake commented Oct 24, 2018

This change is Reviewable

Copy link
Member

@asvoboda asvoboda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A man has only so many 🌶 s to give

@ajlake ajlake requested a review from bluekeyes October 24, 2018 19:25
Copy link
Member

@bluekeyes bluekeyes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is more of a spot check, since I didn't closely read all of the new code. Of things flagged, I think the commented out code and the policy-bot references are the only things that need to be fixed before merging this, but it would be nice to fix or discuss the other stuff as well.

./godelw docker push --tags=latest,version
./godelw publish bintray \
--url https://api.bintray.com \
--subject palantir --repository releases --product policy-bot \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to fix the policy-bot references in this command (--product and --publish).

README.md Outdated
The `Bulldozer` is a bot that auto-merges PRs when all status checks are green and the PR is reviewed.
It uses [GitHub status checks](https://developer.github.com/v3/repos/statuses/) and [GitHub reviews](https://developer.github.com/v3/pulls/reviews/) to do this.
`bulldozer` is a [GitHub App](https://developer.github.com/apps/) that auto-merges
PRs when all status checks are green and the PR is reviewed
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: final .

README.md Outdated

* The server expects a config file name to be passed-in with the `-c` parameter (see `./bulldozer --help`). This config file should look like this.
- If the file does not exist, `bulldozer` will attempt to read from the configuration_v0_path, which is
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we want to call out the configuration_v0_path, I'd put that in a section on migrating from 0.4.x to 1.x. I think it is confusing for it to appear this early.

README.md Outdated

If the repository has branch protection active and enforces code reviews on PRs Bulldozer will wait until all status checks are green and at least one APPROVED review exists on the PR before merging it
We provide both a Docker container and a binary distribution of the server. A
sample configuration file is provided at `var/conf/bulldozer.yml`. We
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is var/conf/bulldozer.yml still the correct path or did that move somewhere else?

README.md Outdated
details.

### Example Files
Example `bulldozer` files can be found in [`config/examples`](https://github.com/palantir/bulldozer/tree/develop/config/examples)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: .bulldozer.yml files


package handler

/*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be uncommented or should it be deleted instead?

installationID := githubapp.GetInstallationIDFromEvent(&event)
baseRef := event.GetRef()

// todo: fixup PushEventRepository != Repository
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this still need to happen? In what cases will these values not be equal?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

githubapp.PrepareRepoContext only accepts a github.Repository. The github.PushEvent only exposes a PushEventRepository type, which isn't accepted here. Since we only care about name and owner, we can just fake it. But it would probably be better to open a PR against githubapp to allow for a similar PrepareRepoContext that accepts org, repo string


for _, pr := range prs {
pullCtx := pull.NewGithubContext(client, pr, owner, repoName, pr.GetNumber())
logger := logger.With().Int(githubapp.LogKeyPRNum, pr.GetNumber()).Logger()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this use githubapp.PreparePRContext?

server/server.go Outdated
githubapp.WithClientMiddleware(
githubapp.ClientLogging(zerolog.DebugLevel),
githubapp.ClientMetrics(base.Registry()),
))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: put final closing ) on new line

server/server.go Outdated
})
webhookHandler := githubapp.NewDefaultEventDispatcher(c.Github,
&handler.IssueComment{Base: baseHandler},
//&handler.PullRequest{Base: baseHandler},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uncomment or delete this?

@ajlake ajlake merged commit 87ae18e into master Oct 25, 2018
@ajlake ajlake deleted the bulldozer1.0 branch October 25, 2018 22:04
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 this pull request may close these issues.

None yet

3 participants