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

Handle base branch changes #12

Merged
merged 2 commits into from
Jan 17, 2019
Merged

Handle base branch changes #12

merged 2 commits into from
Jan 17, 2019

Conversation

pietroalbini
Copy link
Member

The current homu codebase doesn't listen for base branch changes, so if a PR is created targeting master and then switched to target beta (like rust-lang/rust#57670), the PR is going to be merged on master.

This PR makes three changes to homu:

  • Add a check before starting a test to make sure the base branch is the same recorded by homu
  • Listen for base branch changes and update the homu state
  • Unapprove the PR if it was previously approved, and stop testing it if it's already testing. This prevent malicious actors from making a PR targeting beta and then switching it to target stable after the reviewer approved it.

I also added a few lines to update PR title and body when it changes, since I was changing this part of the code anyway.

r? @alexcrichton or @kennytm
cc @Manishearth @jdm, you probably want to cherry-pick this on servo's homu

@alexcrichton alexcrichton merged commit 1f47436 into master Jan 17, 2019
@alexcrichton alexcrichton deleted the double-check-branch branch January 17, 2019 16:00
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.

3 participants