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

[ADD] task to set ready to merge label #1

Merged
merged 3 commits into from
Nov 16, 2018

Conversation

sbidoul
Copy link
Member

@sbidoul sbidoul commented Sep 22, 2018

Extracted from OCA/maintainer-tools#346

TODO

  • cron to run the task nightly on all repos (or maybe not: we would quickly explode the API rate limit)
  • webhook



APPROVALS_REQUIRED = 2
MIN_PR_AGE = 5 # days
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we could use something like that to avoid counting down on Saturdays and Sundays by default.
https://gist.github.com/JosefJezek/275b2c667698aabd6969

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, that would be a nice improvement. I'll try to make the basic version work first, then we can improve.

Copy link
Member Author

Choose a reason for hiding this comment

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

@damdam-s if you think it's important to not count week-ends in the 5 days, can you open an issue for discussion?

Copy link
Member

Choose a reason for hiding this comment

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

@sbidoul #17 added to discuss

Copy link
Member

@damdam-s damdam-s left a comment

Choose a reason for hiding this comment

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

Nice idea.
Some improvements proposed for more flexibility

_logger = getLogger(__name__)


APPROVALS_REQUIRED = 2
Copy link
Member

Choose a reason for hiding this comment

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

Maybe this value of 2 can be a fallback for a customized value on each repository.
This would allow more flexiblity and this kind" of rule could be managed by the PSC of the repo they are responsible of.

Copy link
Member Author

Choose a reason for hiding this comment

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

The question would be where to configure these parameters per repo. In any case, these label are only advisory.

@sbidoul
Copy link
Member Author

sbidoul commented Nov 5, 2018

I reworked the logic to make a cron unncessary and only react on PR events.

@sbidoul sbidoul force-pushed the ready-to-merge-label branch 2 times, most recently from 806a1ff to 11d018c Compare November 10, 2018 15:56
@sbidoul
Copy link
Member Author

sbidoul commented Nov 12, 2018

@OCA/board this PR is deployed since Saturday.

@sbidoul
Copy link
Member Author

sbidoul commented Nov 16, 2018

This has been running fine for a week, was discussed on the board and approved by @max3903 so merging.

@sbidoul sbidoul merged commit 959b02d into OCA:master Nov 16, 2018
@sbidoul sbidoul deleted the ready-to-merge-label branch November 16, 2018 07:32
@pedrobaeza
Copy link
Member

@sbidoul the only problem I see with this is that when we approve a PR with 2 approvals, but not 5 days, when the 5 days have passed, unless you make an additional comment or any action on the PR, there's no notification of ready to merge.

@sbidoul
Copy link
Member Author

sbidoul commented Nov 16, 2018

@pedrobaeza it is handled correctly: there is a task running hourly to set the ready to merge tag.

So if all conditions are met, the ready to merge tag will appear 5 days after creation of the PR.

@pedrobaeza
Copy link
Member

Ah, great, I thought that you removed all crons and only acts on hooks.

This was referenced Nov 16, 2018
gurneyalex added a commit that referenced this pull request Nov 18, 2018
Improve the KO message on how to proceed for CLA
fkantelberg added a commit to fkantelberg/oca-github-bot that referenced this pull request May 28, 2019
* function to check if a user can git push

* webhook on pull request comments to parse and run /ocabot commands
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.

4 participants