Gerrit Trigger if commit message contains regular expression

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Gerrit Trigger if commit message contains regular expression

Bassam Khouri
Hi,

I have a need where I want the Gerrit Trigger plugin to trigger Jenkins job if the commit message matches a regular expression.  I didn't find a Jira in the project and was thinking of implementing it, however I'm not sure how it should look in the UI, nor all other use cases.

I'm new to Jenkins plugin development and am wondering if someone can provide guidance as to how I should proceed to ensure I develop and test the changes against all possible scenarios.

The project github page does provide any documentation on setting up the dev environment. 

  • Is the developer environment something trivial?  how would I test my local plugin changes against a local Jenkins instance?
  • Can someone offer some guidance on how I am to proceed to add the "Commit message contains" functionality? 

Thanks in advance,

Bassam

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CAPeymodtrMV1EpJe3nbQQH8TBjuuiqrRfkje%3Da-jtmfpY2RXdg%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Gerrit Trigger if commit message contains regular expression

Gavin Mogan
> Is the developer environment something trivial?  how would I test my local plugin changes against a local Jenkins instance?

Generally yes. The parent pom file could be more modern (top of the pom file), but i think 3.x is modern enough. You should just be able run `mvn hpi:run` and it'll spin up an instance. 

As for how, thats a little harder. You'll either want to create or extend a descriptor. If you create you'll probably need a config.jelly, if you extend, you need to find the related jelly file. I would guess what your trying to do is add configuration to something that already exists, so you'll probably just want to look for the descriptor in the related class.

Gavin

On Wed, Oct 28, 2020 at 3:47 PM Bassam Khouri <[hidden email]> wrote:
Hi,

I have a need where I want the Gerrit Trigger plugin to trigger Jenkins job if the commit message matches a regular expression.  I didn't find a Jira in the project and was thinking of implementing it, however I'm not sure how it should look in the UI, nor all other use cases.

I'm new to Jenkins plugin development and am wondering if someone can provide guidance as to how I should proceed to ensure I develop and test the changes against all possible scenarios.

The project github page does provide any documentation on setting up the dev environment. 

  • Is the developer environment something trivial?  how would I test my local plugin changes against a local Jenkins instance?
  • Can someone offer some guidance on how I am to proceed to add the "Commit message contains" functionality? 

Thanks in advance,

Bassam

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CAPeymodtrMV1EpJe3nbQQH8TBjuuiqrRfkje%3Da-jtmfpY2RXdg%40mail.gmail.com.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CAG%3D_Duue7Q38Fu9F_wcxxjWmm0g3g5mnKPSo_3eXZ0u%2BgfWKyQ%40mail.gmail.com.