ghprb icon indicating copy to clipboard operation
ghprb copied to clipboard

Add option to not send the "hello!" message to non-whitelisted pull request submissions

Open directhex opened this issue 10 years ago • 13 comments

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

directhex avatar Jun 01 '15 10:06 directhex

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.

DavidTanner avatar Jun 03 '15 20:06 DavidTanner

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

directhex avatar Jun 04 '15 16:06 directhex

Check out how comments are handled now. https://github.com/jenkinsci/ghprb-plugin/pull/89 I admit, this task will take some work.

DavidTanner avatar Jun 04 '15 16:06 DavidTanner

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?

directhex avatar Jul 10 '15 08:07 directhex

Actually just save your global config with an empty request for retest phrase, then no comment will be made.

DavidTanner avatar Jul 10 '15 12:07 DavidTanner

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.

directhex avatar Jul 13 '15 11:07 directhex

I will see if i can get something out today.

DavidTanner avatar Jul 13 '15 12:07 DavidTanner

(I haven't done the extension-based commenting yet, I just wanted to rebase against current master)

directhex avatar Aug 25 '15 09:08 directhex

Can one of the admins verify this patch?

pankajgrovertt avatar Feb 23 '16 09:02 pankajgrovertt

Can one of the admins verify this patch?

ghost-api avatar Aug 30 '16 08:08 ghost-api

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

directhex avatar Aug 30 '16 14:08 directhex

Can one of the admins verify this patch?

alexkomis avatar Jan 27 '17 12:01 alexkomis

Can one of the admins verify this patch?

meruvasivakumari avatar Jan 29 '17 05:01 meruvasivakumari