Add option to not send the "hello!" message to non-whitelisted pull request submissions
This is helpful where you have multiple Jenkins jobs, all looking at the same repository - rather than spamming the user with multiple "Hello!" messages, you can pick one job to spam the user loudly, whilst letting all your other jobs silently obey the build/whitelist/etc comments
So I am working on moving as many things out of the main config/global files as possible. If you can pull this out into an extension, then I will review. Otherwise when I get to the whitelist I will add it. I hope that makes sense.
Can you give me an example of what this kind of extension looks like? I'm not entirely confident with Jenkins internals yet, so a pointer would help
Check out how comments are handled now. https://github.com/jenkinsci/ghprb-plugin/pull/89 I admit, this task will take some work.
I finally have some time to look back into this.
To confirm, currently the addComment use which this patch alters is not extension-based at all (and has no extension points), so the prerequisite is to make the existing comment code in GhprbPullRequest.java extension-based, then I can actually modify it?
Actually just save your global config with an empty request for retest phrase, then no comment will be made.
That's not really very useful, since you can't set the request for retest phrase on a per-job basis. Setting it to blank mutes every PR builder on a given Jenkins instance. The point is to be able to mute specific jobs, e.g. if you have 4 different jobs all pointing to the same repo.
I will see if i can get something out today.
(I haven't done the extension-based commenting yet, I just wanted to rebase against current master)
Can one of the admins verify this patch?
Can one of the admins verify this patch?
OK, so I'm looking at rewriting this using the extension system which sorta grew into existence while I was slacking off.
As I understand it, there's a system in place to allow control over comments as sent, as used here: https://github.com/janinko/ghprb/blob/master/src/main/java/org/jenkinsci/plugins/ghprb/GhprbRepository.java#L205-L225
However, that mechanism is not used (just a basic pr.comment()) a few lines later, in the method which sends those pre-build comments: https://github.com/janinko/ghprb/blob/master/src/main/java/org/jenkinsci/plugins/ghprb/GhprbRepository.java#L236-L255
Hence right now, adding an extension to package org.jenkinsci.plugins.ghprb.extensions.comments which returns empty strings for postBuildComment() isn't enough to achieve the desired goal until addComment() is fixed to actually use postBuildComment() from extensions
Can one of the admins verify this patch?
Can one of the admins verify this patch?