Auto label PR's based on content#34
Conversation
…nto javiereguiluz-fix_27 * 'fix_27' of https://github.com/javiereguiluz/carsonbot: Fixed tests They are "labels", not "tags" Improved the way we extract labels from PR titles Autolabel new Pull Requests
* master: Replacing a bunch of tests that I didn't realize weren't being run!
| public function onPullRequest(GitHubEvent $event) | ||
| { | ||
| $data = $event->getData(); | ||
| if ('opened' !== $action = $data['action']) { |
There was a problem hiding this comment.
Why not allow edited as suggested by @webmozart?
There was a problem hiding this comment.
It's just a matter of adding it later - it could be really easy, i actually didn't check :)
|
Great work! I was doing the same :) That was fast! |
| } | ||
|
|
||
| // the PR body usually indicates if this is a Bug, Feature, BC Break or Deprecation | ||
| if (preg_match('/\|\s*Bug fix\?\s*\|\s*yes\s*/', $prBody, $matches)) { |
There was a problem hiding this comment.
let's use /.../i to allow "Yes" as well
|
@weaverryan thanks for finishing this and adding proper tests. I agree with the minor comments made by @wouterj, so this looks ready to me 👍 Regarding your question: "do we want this functionality?" Today we have this functionality enabled in the repo ... but it's made by hand instead by this bot. I think it's useful because Symfony's backlog is huge and these labels allow us to quickly filter by topic (bug/feature/deprecation) and by component. |
|
This is now active on the core repository! So, let's see how Carson performs :) |
| if (preg_match_all('/\[(?P<labels>.+)\]/U', $prTitle, $matches)) { | ||
| // creates a key=>val array, but the key is lowercased | ||
| $validLabels = array_combine( | ||
| array_map(function($s) { |
There was a problem hiding this comment.
This can be simplified to array_map('strtolower', $this->getValidLabels()), no?
Hi guys!
This finishes #29, after a few of us made big changes to the repository.
The functionality is best seen by looking at the
AutLabelPRFromContentSubscriberTest.This will only be used on
symfony/symfony, not the docs.I'm pretty confident this is solid. We just need approval that we for sure want this functionality :).
Ping @javiereguiluz