Skip to content

Conversation

@phil-r
Copy link
Member

@phil-r phil-r commented May 30, 2017

How it works:

  1. Before polling all issues the status of the master is checked
  2. If and only if it's passing CI(Travis) for each open PR its build status will be checked.
  3. From PR object (example for this PR) sha of the head commit is taken and it's status (example for this PR) is checked.
  4. If and only if it's failing PR is marked with ci failed label and skipped.
  5. ???
  6. PROFIT!

TODO:

  • It doesn't block PRs if status is not added for some reason
  • Add new label ci failed for build with failing CI
  • Check current master status - if it fails - do nothing
  • Close PRs that can't pass CI for a long time if master is okay (as we do with PRs with conflicts)
  • Fix and update tests
  • Test on my fork

@andrewda
Copy link
Member

I don't think we should close PR's that don't pass CI – or if we do make a very large timeout. Take this example: if the base master branch is failing for whatever reason, a PR to fix the CI would be required to be merged before other PR's would start passing again (because we don't want to encourage people to fix CI issues in unrelated PR's).

@PlasmaPower
Copy link
Contributor

@andrewda I'd hope that this would prevent Travis from breaking on master, but you're right that it could still happen.

@andrewda
Copy link
Member

andrewda commented May 31, 2017

@PlasmaPower My main worry was that if something like fd6ce27 or 39b7867 were to happen, where a hotfix is pushed without going through a PR.

@PlasmaPower
Copy link
Contributor

Oh yeah, good point.

@mdcfe
Copy link
Contributor

mdcfe commented May 31, 2017

In my opinion, if master is failing, we shouldn't force PRs to pass Travis, but if it is stable, we should add a timeout period to the end.

Edit: if this changes, I'll upvote.

@phil-r
Copy link
Member Author

phil-r commented May 31, 2017

Nice ideas guys! I've updated TODO

@mdcfe
Copy link
Contributor

mdcfe commented May 31, 2017

Looks good now! 👍

@PlasmaPower
Copy link
Contributor

Ironic, this breaks Travis.

Copy link
Contributor

@PlasmaPower PlasmaPower left a comment

Choose a reason for hiding this comment

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

I still don't see where it checks if master is failing.

continue

# check if this PR successfully passed travis-ci
build_passed = has_build_passed(api, pr["statuses_url"])
Copy link
Contributor

Choose a reason for hiding this comment

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

You need to pass in the SHA here.

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah, didn't have time to finish, will try to do it this evening.

@PlasmaPower
Copy link
Contributor

Oh, sorry, I didn't see that this was WIP.

@phil-r phil-r force-pushed the travis-pr-check branch from e4eda03 to 48cd86a Compare June 1, 2017 01:30
@phil-r
Copy link
Member Author

phil-r commented Jun 1, 2017

@PlasmaPower feel free to review, it's basically finished, but I can't test as I have issues running docker after all updates.
Also I have no idea how I will resolve conflicts with #420 xD

return api("PUT", path, json=data)


def close_stale_pr(api, urn, pr, delta, reason):
Copy link
Contributor

@PlasmaPower PlasmaPower Jun 1, 2017

Choose a reason for hiding this comment

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

Maybe a better name like handle_broken_pr? This implies the PR is stale and the function will close it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks @PlasmaPower ! I've struggle so much with naming of this function ^_^

@PlasmaPower
Copy link
Contributor

PlasmaPower commented Jun 1, 2017

I checked, and Travis is run for new commits on master: https://github.com/chaosbot/Chaos/commits/master

Edit: also is run for squash commits

I'm assuming you checked that this method of getting the status works?

@phil-r phil-r force-pushed the travis-pr-check branch from 48cd86a to e9ee63f Compare June 1, 2017 19:36
phil-r added 3 commits June 1, 2017 23:28
It doesn't block PRs if status is not added for some reason
It doesn't block them if master is also failing
@phil-r phil-r force-pushed the travis-pr-check branch from 5925086 to 49d954d Compare June 1, 2017 21:59
@phil-r
Copy link
Member Author

phil-r commented Jun 1, 2017

@PlasmaPower please review ;)

@phil-r phil-r changed the title [WIP] Bring back mandatory travis-ci check Bring back mandatory travis-ci check Jun 1, 2017
@phil-r phil-r closed this Jun 1, 2017
@phil-r
Copy link
Member Author

phil-r commented Jun 1, 2017

🤦‍♂️ I've accidentally closed it

@phil-r phil-r reopened this Jun 1, 2017
@chaosbot chaosbot merged commit 6c56cc4 into Chaosthebot:master Jun 2, 2017
@chaosbot
Copy link
Collaborator

chaosbot commented Jun 2, 2017

🙆‍♀️ PR passed with a vote of 20 for and 0 against, a weighted total of 19.5 and a threshold of 6.5, and a current meritocracy review.

See merge-commit 6c56cc4 for more details.

@phil-r phil-r deleted the travis-pr-check branch June 2, 2017 07:24
@while-loop
Copy link
Contributor

looks nice =D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants