Hi Steven. 

This seems to be a reasonably often asked for feature (I wasn't able to 
find a ticket though, for multibranch/github multibranch specifically, 
surely there is one?). 

Are you thinking that ideally in your case the branches/PRs would not 
appear at all until the label is applied? Would an alternative that makes 
it show up as not built or similar do? (may be easier to do that...)

On Thursday, March 15, 2018 at 1:50:00 AM UTC+11, Steven F wrote:
>
> Hi,
>
> I'm trying to write a filter for multibranch which accepts PRs with a 
> given github PR label. That part was simple. I also thought I should 
> implement an events subscriber (GHEventsSubscriber) and I'm having trouble 
> figuring out the details of that.
> I've tried basing it on the PullRequestGHEventSubscriber since it will be 
> creating/deleting heads rather than triggering builds but I couldn't figure 
> out how some things were used, specifically the *heads()* method. My 
> class is pretty much a copy paste with the actions changed to 
> labeled/unlabeled. Right now, I'm getting messages like
>
>> [Wed Mar 14 13:37:45 GMT 2018] Received Pull request #9 labeled in 
>>> repository sfoster/branch_filter_test CREATED event from 10.32.8.197 ⇒ 
>>> http://10.32.8.83:8080/jenkins/github-webhook/ with timestamp Wed Mar 
>>> 14 13:37:40 GMT 2018
>>
>> Found match against demo (new branch PR-9)
>>
>> [Wed Mar 14 13:37:47 GMT 2018] Finished processing Pull request #9 
>>> labeled in repository sfoster/branch_filter_test CREATED event from 
>>> 10.32.8.197 ⇒ http://10.32.8.83:8080/jenkins/github-webhook/ with 
>>> timestamp Wed Mar 14 13:37:40 GMT 2018. Matched 1.
>>
>>
>  in jenkins.branch.MultiBranchProject.log, and
>
> [Wed Mar 14 13:37:47 GMT 2018] Pull request #9 labeled in repository 
> sfoster/branch_filter_test CREATED event from 10.32.8.197 ⇒ 
> http://10.32.8.83:8080/jenkins/github-webhook/ with timestamp Wed Mar 14 
> 13:37:40 GMT 2018 processed in 2.3 sec
>>
>>
> in the projects  "repository events" page, but no sign of the new PR in 
> the project.
>
> I guess I'm not even sure how a successful result would play out, does it 
> trigger a repository indexing with the given Event? or do the new heads 
> just appear in the project?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/dd155294-35eb-4733-9ac1-6709a7d58b9e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to