[JIRA] (JENKINS-60845) Filter PR by branch source

34 views
Skip to first unread message

david.racodon@gmail.com (JIRA)

unread,
Jan 23, 2020, 12:27:04 PM1/23/20
to jenkinsc...@googlegroups.com
David Racodon created an issue
 
Jenkins / Improvement JENKINS-60845
Filter PR by branch source
Issue Type: Improvement Improvement
Assignee: Sam Gleske
Components: scm-filter-branch-pr-plugin
Created: 2020-01-23 17:26
Priority: Minor Minor
Reporter: David Racodon

It is possible to filter PRs to build by branch target.

Would it be possible to filter PRs by branch source?

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

sam.mxracer@gmail.com (JIRA)

unread,
Jan 23, 2020, 4:36:02 PM1/23/20
to jenkinsc...@googlegroups.com
Sam Gleske commented on Improvement JENKINS-60845
 
Re: Filter PR by branch source

It should be technically feasible.  Can you expand on your use case?

sam.mxracer@gmail.com (JIRA)

unread,
Jan 23, 2020, 4:38:02 PM1/23/20
to jenkinsc...@googlegroups.com
Sam Gleske edited a comment on Improvement JENKINS-60845
It should be technically feasible.  Can you expand on your use case?   The default behavior of SCM filter is kind of like this already.  I created this plugin to modify the default behavior.

david.racodon@gmail.com (JIRA)

unread,
Jan 24, 2020, 3:23:04 AM1/24/20
to jenkinsc...@googlegroups.com
David Racodon updated an issue
 
Change By: David Racodon
Attachment: image-2020-01-24-09-22-33-829.png

david.racodon@gmail.com (JIRA)

unread,
Jan 24, 2020, 3:44:03 AM1/24/20
to jenkinsc...@googlegroups.com
David Racodon commented on Improvement JENKINS-60845
 
Re: Filter PR by branch source

Hi Sam,

Thanks for your quick feedback.

My use case is a kind of monorepo approach. There's one single Bitbucket repository containing the source code of a product, plus some customization for each customer.

I have one multibranch pipeline job per customer. I only want to see branches, PRs and tags related to the customer in each pipeline job. The naming convention from branches and tags is <customer>/whatever. Filtering by name works fine with those branches and tags. But, I have no way to get the PRs related to the customer. If I don't include 'PR-', I get no PRs in the pipeline job. If I include 'PR-', I will get all the PRs whatever the customer. What I'd like to be able to do is to filter PRs whose source branch matches regular expression <customer>/whatever.

From what I understand, your plugin offers the opposite for now (filter PRs whose target/destination branch matches regular expression. Right?

For your information, here's my configuration:

Let me know your thoughts about adding filtering on source branch for PRs.

Thank you very much

Have a good day

David

david.racodon@gmail.com (JIRA)

unread,
Jan 24, 2020, 3:44:03 AM1/24/20
to jenkinsc...@googlegroups.com
David Racodon edited a comment on Improvement JENKINS-60845
Hi Sam,

Thanks for your quick feedback.

My use case is a kind of monorepo approach. There's one single Bitbucket repository containing the source code of a product, plus some customization for each customer.

I have one multibranch pipeline job per customer. I only want to see branches, PRs and tags related to the customer in each pipeline job. The naming convention from branches and tags is <customer>/whatever. Filtering by name works fine with those branches and tags. But, I have no way to get the PRs related to the customer. If I don't include 'PR-*' * , I get no PRs in the pipeline job. If I include 'PR- * ', I will get all the PRs whatever the customer. What I'd like to be able to do is to filter PRs whose source branch matches regular expression <customer>/whatever.


From what I understand, your plugin offers the opposite for now (filter PRs whose target/destination branch matches regular expression. Right?

For your information, here's my configuration:

!image-2020-01-24-09-22-33-829.png!


Let me know your thoughts about adding filtering on source branch for PRs.

Thank you very much

Have a good day

David

sam.mxracer@gmail.com (JIRA)

unread,
Jan 25, 2020, 2:59:02 PM1/25/20
to jenkinsc...@googlegroups.com

That is interesting and should be do-able.  I'll look at feasibility and maybe spend some time on it weekends / evenings.

sam.mxracer@gmail.com (JIRA)

unread,
Jan 25, 2020, 4:22:03 PM1/25/20
to jenkinsc...@googlegroups.com
Sam Gleske started work on Improvement JENKINS-60845
 
Change By: Sam Gleske
Status: Open In Progress

sam.mxracer@gmail.com (JIRA)

unread,
Jan 25, 2020, 4:22:03 PM1/25/20
to jenkinsc...@googlegroups.com

I have released a new version of scm-filter-branch-pr 0.5 which includes filtering by origin instead of target for change requests.  See https://github.com/jenkinsci/scm-filter-branch-pr-plugin/pull/5

 

You can wait a day for the release to become generally available in the Jenkins update center or you can download it and upload it manually.  Here's the download link.  https://repo.jenkins-ci.org/releases/org/jenkins-ci/plugins/scm-filter-branch-pr/0.5/scm-filter-branch-pr-0.5.hpi

sam.mxracer@gmail.com (JIRA)

unread,
Jan 25, 2020, 4:22:03 PM1/25/20
to jenkinsc...@googlegroups.com
Change By: Sam Gleske
Status: In Progress Review

sam.mxracer@gmail.com (JIRA)

unread,
Jan 25, 2020, 4:22:04 PM1/25/20
to jenkinsc...@googlegroups.com
Change By: Sam Gleske
Resolution: Fixed
Status: Resolved In Review

sam.mxracer@gmail.com (JIRA)

unread,
Jan 25, 2020, 4:22:04 PM1/25/20
to jenkinsc...@googlegroups.com
Change By: Sam Gleske
Status: In Review Resolved
Resolution: Fixed
Released As: scm-filter-branch-pr 0.5

sam.mxracer@gmail.com (JIRA)

unread,
Jan 25, 2020, 4:22:04 PM1/25/20
to jenkinsc...@googlegroups.com
 
Jenkins / Improvement JENKINS-60845
Filter PR by branch source
Change By: Sam Gleske
Status: In Review Resolved
Resolution: Fixed

david.racodon@gmail.com (JIRA)

unread,
Jan 25, 2020, 5:36:03 PM1/25/20
to jenkinsc...@googlegroups.com
David Racodon commented on Improvement JENKINS-60845
 
Re: Filter PR by branch source

Great! Many thanks! I'll have a try on Monday and let you know how it goes.

david.racodon@gmail.com (JIRA)

unread,
Jan 27, 2020, 3:46:03 AM1/27/20
to jenkinsc...@googlegroups.com

Hi Sam,

I just tested version 0.5.1 from the update center. It works as expected (I tried with wildcards).

Thanks again!

Have a good day

David

sam.mxracer@gmail.com (JIRA)

unread,
Jan 31, 2020, 8:23:03 PM1/31/20
to jenkinsc...@googlegroups.com

sam.mxracer@gmail.com (JIRA)

unread,
Jan 31, 2020, 8:23:03 PM1/31/20
to jenkinsc...@googlegroups.com
Sam Gleske edited a comment on Improvement JENKINS-60845
Great, you too.   Glad you don't have to jump through too many hoops.

sam.mxracer@gmail.com (JIRA)

unread,
Jan 31, 2020, 8:24:03 PM1/31/20
to jenkinsc...@googlegroups.com

Thanks for reporting back.

Reply all
Reply to author
Forward
0 new messages