You are viewing a plain text version of this content. The canonical link for it is here.
Posted to builds@apache.org by Jaikiran Pai <ja...@gmail.com> on 2017/09/25 07:02:31 UTC

Jenkins Github PR integration - Support for whitelisting?

Hello Build Team,

I'm one of the committers of the Apache Ant project[1]. We use Jenkins 
hosted by the Infra team at builds.apache.org for automated triggering 
of specific Jenkins jobs for pull requests that are submitted at the 
(read-only) mirrors of the project hosted at github[2]. The Jenkins job 
is a typical job that follows the steps noted in this article[3]. Things 
work fine and here's the Jenkins job we have[4].

However, a couple of things that seem to be missing when compared to the 
"official" Jenkins Github integration plugin[5] are:

     1. Ability to whitelist users who can submit a PR - this helps to 
avoid random users from creating (potentially malicious) PRs which 
trigger a job against Jenkins

     2. Ability to issue a "retest this please" command (by whitelisted 
users) as a comment on the PR to auto-trigger a new job for the PR.

Are these features already available in the one that's hosted at 
builds.apache.org and if so, is there some documentation I can follow? 
If not, is there any workaround for #1 or any plans to support these 
features?


[1] http://ant.apache.org/

[2] https://github.com/apache/ant-ivy

[3] https://blogs.apache.org/infra/entry/github_pull_request_builds_now

[4] https://builds.apache.org/job/Ivy-GithubPR/

[5] https://github.com/jenkinsci/ghprb-plugin/blob/master/README.md

-Jaikiran




Re: Jenkins Github PR integration - Support for whitelisting?

Posted by Patrick Hunt <ph...@cloudera.com>.
We've been using this integration at ZooKeeper quite successfully as well.
Kudos!

I recently setup our job to allow "build with parameters" where the
parameter is the PR number. This is quite useful when the PR tests fail due
to, say, a flakey test and you want to re-run. It was a bit of a bear to
get this running, I looked at some docs I found on the web (the link to the
plugin in the original blog post is no longer valid) but I wasn't sure if
they corresponded to the same version in use on apache Jenkins. Is there
some place at apache where information is being shared?

Regards,

Patrick


On Thu, Sep 28, 2017 at 11:37 PM, Dominik Psenner <dp...@gmail.com>
wrote:

> On 2017-09-27 23:26, Meghna Baijal wrote:
>
>> Thanks Dominik! I looked at Log4net’s Jenkinsfile and it is going to be a
>> good reference for me in the future.
>> I am currently adding some features via the Jenkinsfile script and I am
>> hoping they will work as expected on Apache Jenkins :)
>>
> Thanks for the Kudos. Please note that the pipeline is not finished at all
> and lacks several important stages like publishing the generated site and
> built binaries on release branches and tags. In case you can make this work
> I would like to see how you made that work. Would you please ping here or
> dev@logging.apache.org when you've finished that?
>
> Please note further that we observed some strange things with log4net's
> build job. One is that the job at the end reports "Could not update commit
> status, please check if your scan credentials belong to a member of the
> organization or a collaborator of the repository and repo:status scope is
> selected". I assume that the github plugin would like to save a build
> status on the commit but is unable to do so because of a credential issue.
> I'm sure that I've granted repo:status on the credentials that jenkins uses
> and it is most likely because my github user is part of the apache
> organization but only the apache organization can save such changes. Does
> anyone know whether this is the case or not?
>

Re: Jenkins Github PR integration - Support for whitelisting?

Posted by Dominik Psenner <dp...@gmail.com>.
On 2017-09-27 23:26, Meghna Baijal wrote:
> Thanks Dominik! I looked at Log4net’s Jenkinsfile and it is going to be a good reference for me in the future.
> I am currently adding some features via the Jenkinsfile script and I am hoping they will work as expected on Apache Jenkins :)
Thanks for the Kudos. Please note that the pipeline is not finished at 
all and lacks several important stages like publishing the generated 
site and built binaries on release branches and tags. In case you can 
make this work I would like to see how you made that work. Would you 
please ping here or dev@logging.apache.org when you've finished that?

Please note further that we observed some strange things with log4net's 
build job. One is that the job at the end reports "Could not update 
commit status, please check if your scan credentials belong to a member 
of the organization or a collaborator of the repository and repo:status 
scope is selected". I assume that the github plugin would like to save a 
build status on the commit but is unable to do so because of a 
credential issue. I'm sure that I've granted repo:status on the 
credentials that jenkins uses and it is most likely because my github 
user is part of the apache organization but only the apache organization 
can save such changes. Does anyone know whether this is the case or not?

Re: Jenkins Github PR integration - Support for whitelisting?

Posted by Meghna Baijal <me...@gmail.com>.
Thanks Dominik! I looked at Log4net’s Jenkinsfile and it is going to be a good reference for me in the future.
I am currently adding some features via the Jenkinsfile script and I am hoping they will work as expected on Apache Jenkins :)

Meghna
> On Sep 26, 2017, at 12:32 AM, Dominik Psenner <dp...@gmail.com> wrote:
> 
> Log4net builds with a github multitrigger pipeline. However it doesnt add
> comments or uses user whitelisting. It would be nice if some pull request
> sources could be trusted such that changes to the Jenkinsfile are not
> discarded.
> 
> On 25 Sep 2017 11:32 p.m., "Meghna Baijal" <me...@gmail.com>
> wrote:
> 
> Hi All,
> I am also attempting to add similar functionality to MXNet builds. Is there
> any project using the Jenkins ‘multi branch pipeline’ job with such
> features ? (GitHub comment triggers, whitelisted users etc?). Though I
> currently have a working version, a reference project might give me a
> better idea of the best (& successful) practices !
> 
> Thanks,
> Meghna Baijal
> 
>> On Sep 25, 2017, at 10:58 AM, Jason Kuster <ja...@google.com.INVALID>
> wrote:
>> 
>> Beam is also using the "official" plugin and has found it to be very
> useful
>> (it also allows us to trigger postcommit builds against pull requests if a
>> contributor wants to test something in more depth). All our jobs are
>> defined in the Job DSL in our repository[1].
>> 
>> [1] https://github.com/apache/beam/tree/master/.test-infra/jenkins
>> 
>> On Mon, Sep 25, 2017 at 4:20 AM, Ismael Juma <is...@juma.me.uk> wrote:
>> 
>>> Hi,
>>> 
>>> It is possible to use the plugin you call "official" too. It became
>>> available some time ago and we (Apache Kafka) switched to it once we
> found
>>> out. The easiest way is to look at our config:
>>> 
>>> https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/
>>> 
>>> Ismael
>>> 
>>> On Mon, Sep 25, 2017 at 8:02 AM, Jaikiran Pai <ja...@gmail.com>
>>> wrote:
>>> 
>>>> Hello Build Team,
>>>> 
>>>> I'm one of the committers of the Apache Ant project[1]. We use Jenkins
>>>> hosted by the Infra team at builds.apache.org for automated triggering
>>> of
>>>> specific Jenkins jobs for pull requests that are submitted at the
>>>> (read-only) mirrors of the project hosted at github[2]. The Jenkins job
>>> is
>>>> a typical job that follows the steps noted in this article[3]. Things
>>> work
>>>> fine and here's the Jenkins job we have[4].
>>>> 
>>>> However, a couple of things that seem to be missing when compared to the
>>>> "official" Jenkins Github integration plugin[5] are:
>>>> 
>>>>   1. Ability to whitelist users who can submit a PR - this helps to
>>>> avoid random users from creating (potentially malicious) PRs which
>>> trigger
>>>> a job against Jenkins
>>>> 
>>>>   2. Ability to issue a "retest this please" command (by whitelisted
>>>> users) as a comment on the PR to auto-trigger a new job for the PR.
>>>> 
>>>> Are these features already available in the one that's hosted at
>>>> builds.apache.org and if so, is there some documentation I can follow?
>>> If
>>>> not, is there any workaround for #1 or any plans to support these
>>> features?
>>>> 
>>>> 
>>>> [1] http://ant.apache.org/
>>>> 
>>>> [2] https://github.com/apache/ant-ivy
>>>> 
>>>> [3] https://blogs.apache.org/infra/entry/github_pull_request_builds_now
>>>> 
>>>> [4] https://builds.apache.org/job/Ivy-GithubPR/
>>>> 
>>>> [5] https://github.com/jenkinsci/ghprb-plugin/blob/master/README.md
>>>> 
>>>> -Jaikiran
>>>> 
>>>> 
>>>> 
>>>> 
>>> 
>> 
>> 
>> 
>> --
>> -------
>> Jason Kuster
>> Apache Beam / Google Cloud Dataflow


Re: Jenkins Github PR integration - Support for whitelisting?

Posted by Dominik Psenner <dp...@gmail.com>.
Log4net builds with a github multitrigger pipeline. However it doesnt add
comments or uses user whitelisting. It would be nice if some pull request
sources could be trusted such that changes to the Jenkinsfile are not
discarded.

On 25 Sep 2017 11:32 p.m., "Meghna Baijal" <me...@gmail.com>
wrote:

Hi All,
I am also attempting to add similar functionality to MXNet builds. Is there
any project using the Jenkins ‘multi branch pipeline’ job with such
features ? (GitHub comment triggers, whitelisted users etc?). Though I
currently have a working version, a reference project might give me a
better idea of the best (& successful) practices !

Thanks,
Meghna Baijal

> On Sep 25, 2017, at 10:58 AM, Jason Kuster <ja...@google.com.INVALID>
wrote:
>
> Beam is also using the "official" plugin and has found it to be very
useful
> (it also allows us to trigger postcommit builds against pull requests if a
> contributor wants to test something in more depth). All our jobs are
> defined in the Job DSL in our repository[1].
>
> [1] https://github.com/apache/beam/tree/master/.test-infra/jenkins
>
> On Mon, Sep 25, 2017 at 4:20 AM, Ismael Juma <is...@juma.me.uk> wrote:
>
>> Hi,
>>
>> It is possible to use the plugin you call "official" too. It became
>> available some time ago and we (Apache Kafka) switched to it once we
found
>> out. The easiest way is to look at our config:
>>
>> https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/
>>
>> Ismael
>>
>> On Mon, Sep 25, 2017 at 8:02 AM, Jaikiran Pai <ja...@gmail.com>
>> wrote:
>>
>>> Hello Build Team,
>>>
>>> I'm one of the committers of the Apache Ant project[1]. We use Jenkins
>>> hosted by the Infra team at builds.apache.org for automated triggering
>> of
>>> specific Jenkins jobs for pull requests that are submitted at the
>>> (read-only) mirrors of the project hosted at github[2]. The Jenkins job
>> is
>>> a typical job that follows the steps noted in this article[3]. Things
>> work
>>> fine and here's the Jenkins job we have[4].
>>>
>>> However, a couple of things that seem to be missing when compared to the
>>> "official" Jenkins Github integration plugin[5] are:
>>>
>>>    1. Ability to whitelist users who can submit a PR - this helps to
>>> avoid random users from creating (potentially malicious) PRs which
>> trigger
>>> a job against Jenkins
>>>
>>>    2. Ability to issue a "retest this please" command (by whitelisted
>>> users) as a comment on the PR to auto-trigger a new job for the PR.
>>>
>>> Are these features already available in the one that's hosted at
>>> builds.apache.org and if so, is there some documentation I can follow?
>> If
>>> not, is there any workaround for #1 or any plans to support these
>> features?
>>>
>>>
>>> [1] http://ant.apache.org/
>>>
>>> [2] https://github.com/apache/ant-ivy
>>>
>>> [3] https://blogs.apache.org/infra/entry/github_pull_request_builds_now
>>>
>>> [4] https://builds.apache.org/job/Ivy-GithubPR/
>>>
>>> [5] https://github.com/jenkinsci/ghprb-plugin/blob/master/README.md
>>>
>>> -Jaikiran
>>>
>>>
>>>
>>>
>>
>
>
>
> --
> -------
> Jason Kuster
> Apache Beam / Google Cloud Dataflow

Re: Jenkins Github PR integration - Support for whitelisting?

Posted by Meghna Baijal <me...@gmail.com>.
Hi All, 
I am also attempting to add similar functionality to MXNet builds. Is there any project using the Jenkins ‘multi branch pipeline’ job with such features ? (GitHub comment triggers, whitelisted users etc?). Though I currently have a working version, a reference project might give me a better idea of the best (& successful) practices !

Thanks,
Meghna Baijal

> On Sep 25, 2017, at 10:58 AM, Jason Kuster <ja...@google.com.INVALID> wrote:
> 
> Beam is also using the "official" plugin and has found it to be very useful
> (it also allows us to trigger postcommit builds against pull requests if a
> contributor wants to test something in more depth). All our jobs are
> defined in the Job DSL in our repository[1].
> 
> [1] https://github.com/apache/beam/tree/master/.test-infra/jenkins
> 
> On Mon, Sep 25, 2017 at 4:20 AM, Ismael Juma <is...@juma.me.uk> wrote:
> 
>> Hi,
>> 
>> It is possible to use the plugin you call "official" too. It became
>> available some time ago and we (Apache Kafka) switched to it once we found
>> out. The easiest way is to look at our config:
>> 
>> https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/
>> 
>> Ismael
>> 
>> On Mon, Sep 25, 2017 at 8:02 AM, Jaikiran Pai <ja...@gmail.com>
>> wrote:
>> 
>>> Hello Build Team,
>>> 
>>> I'm one of the committers of the Apache Ant project[1]. We use Jenkins
>>> hosted by the Infra team at builds.apache.org for automated triggering
>> of
>>> specific Jenkins jobs for pull requests that are submitted at the
>>> (read-only) mirrors of the project hosted at github[2]. The Jenkins job
>> is
>>> a typical job that follows the steps noted in this article[3]. Things
>> work
>>> fine and here's the Jenkins job we have[4].
>>> 
>>> However, a couple of things that seem to be missing when compared to the
>>> "official" Jenkins Github integration plugin[5] are:
>>> 
>>>    1. Ability to whitelist users who can submit a PR - this helps to
>>> avoid random users from creating (potentially malicious) PRs which
>> trigger
>>> a job against Jenkins
>>> 
>>>    2. Ability to issue a "retest this please" command (by whitelisted
>>> users) as a comment on the PR to auto-trigger a new job for the PR.
>>> 
>>> Are these features already available in the one that's hosted at
>>> builds.apache.org and if so, is there some documentation I can follow?
>> If
>>> not, is there any workaround for #1 or any plans to support these
>> features?
>>> 
>>> 
>>> [1] http://ant.apache.org/
>>> 
>>> [2] https://github.com/apache/ant-ivy
>>> 
>>> [3] https://blogs.apache.org/infra/entry/github_pull_request_builds_now
>>> 
>>> [4] https://builds.apache.org/job/Ivy-GithubPR/
>>> 
>>> [5] https://github.com/jenkinsci/ghprb-plugin/blob/master/README.md
>>> 
>>> -Jaikiran
>>> 
>>> 
>>> 
>>> 
>> 
> 
> 
> 
> -- 
> -------
> Jason Kuster
> Apache Beam / Google Cloud Dataflow


Re: Jenkins Github PR integration - Support for whitelisting?

Posted by Jason Kuster <ja...@google.com.INVALID>.
Beam is also using the "official" plugin and has found it to be very useful
(it also allows us to trigger postcommit builds against pull requests if a
contributor wants to test something in more depth). All our jobs are
defined in the Job DSL in our repository[1].

[1] https://github.com/apache/beam/tree/master/.test-infra/jenkins

On Mon, Sep 25, 2017 at 4:20 AM, Ismael Juma <is...@juma.me.uk> wrote:

> Hi,
>
> It is possible to use the plugin you call "official" too. It became
> available some time ago and we (Apache Kafka) switched to it once we found
> out. The easiest way is to look at our config:
>
> https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/
>
> Ismael
>
> On Mon, Sep 25, 2017 at 8:02 AM, Jaikiran Pai <ja...@gmail.com>
> wrote:
>
> > Hello Build Team,
> >
> > I'm one of the committers of the Apache Ant project[1]. We use Jenkins
> > hosted by the Infra team at builds.apache.org for automated triggering
> of
> > specific Jenkins jobs for pull requests that are submitted at the
> > (read-only) mirrors of the project hosted at github[2]. The Jenkins job
> is
> > a typical job that follows the steps noted in this article[3]. Things
> work
> > fine and here's the Jenkins job we have[4].
> >
> > However, a couple of things that seem to be missing when compared to the
> > "official" Jenkins Github integration plugin[5] are:
> >
> >     1. Ability to whitelist users who can submit a PR - this helps to
> > avoid random users from creating (potentially malicious) PRs which
> trigger
> > a job against Jenkins
> >
> >     2. Ability to issue a "retest this please" command (by whitelisted
> > users) as a comment on the PR to auto-trigger a new job for the PR.
> >
> > Are these features already available in the one that's hosted at
> > builds.apache.org and if so, is there some documentation I can follow?
> If
> > not, is there any workaround for #1 or any plans to support these
> features?
> >
> >
> > [1] http://ant.apache.org/
> >
> > [2] https://github.com/apache/ant-ivy
> >
> > [3] https://blogs.apache.org/infra/entry/github_pull_request_builds_now
> >
> > [4] https://builds.apache.org/job/Ivy-GithubPR/
> >
> > [5] https://github.com/jenkinsci/ghprb-plugin/blob/master/README.md
> >
> > -Jaikiran
> >
> >
> >
> >
>



-- 
-------
Jason Kuster
Apache Beam / Google Cloud Dataflow

Re: Jenkins Github PR integration - Support for whitelisting?

Posted by Ismael Juma <is...@juma.me.uk>.
Hi,

It is possible to use the plugin you call "official" too. It became
available some time ago and we (Apache Kafka) switched to it once we found
out. The easiest way is to look at our config:

https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/

Ismael

On Mon, Sep 25, 2017 at 8:02 AM, Jaikiran Pai <ja...@gmail.com>
wrote:

> Hello Build Team,
>
> I'm one of the committers of the Apache Ant project[1]. We use Jenkins
> hosted by the Infra team at builds.apache.org for automated triggering of
> specific Jenkins jobs for pull requests that are submitted at the
> (read-only) mirrors of the project hosted at github[2]. The Jenkins job is
> a typical job that follows the steps noted in this article[3]. Things work
> fine and here's the Jenkins job we have[4].
>
> However, a couple of things that seem to be missing when compared to the
> "official" Jenkins Github integration plugin[5] are:
>
>     1. Ability to whitelist users who can submit a PR - this helps to
> avoid random users from creating (potentially malicious) PRs which trigger
> a job against Jenkins
>
>     2. Ability to issue a "retest this please" command (by whitelisted
> users) as a comment on the PR to auto-trigger a new job for the PR.
>
> Are these features already available in the one that's hosted at
> builds.apache.org and if so, is there some documentation I can follow? If
> not, is there any workaround for #1 or any plans to support these features?
>
>
> [1] http://ant.apache.org/
>
> [2] https://github.com/apache/ant-ivy
>
> [3] https://blogs.apache.org/infra/entry/github_pull_request_builds_now
>
> [4] https://builds.apache.org/job/Ivy-GithubPR/
>
> [5] https://github.com/jenkinsci/ghprb-plugin/blob/master/README.md
>
> -Jaikiran
>
>
>
>