[JENKINS-36283] custom pr behavior#25
[JENKINS-36283] custom pr behavior#25pascallap wants to merge 5 commits intojenkinsci:masterfrom Nuglif:JENKINS-36283_Custom_PR_behavior
Conversation
|
This is great, we're currently building all commits twice because all our prs come from local branches. |
|
Yes I'd rather see this merged then #9 or #25 imho. Just because it has multiple options and is more like Github-source-plugin-#60. |
|
Pull Request is know rebase from #23. So conflict should be already resolved. |
|
@amuniz: A merge of this PR would also be very important for us. Let us know if we can contribute for getting this merged. |
|
@amuniz. Same here. This feature will be awesome for us. Feel free to ask us for help aswell. |
|
I'll try to review this as soon as possible, it is next in my queue. |
| revision = getRevision(head, hash, pr); | ||
| observer.observe(head, revision); | ||
| } | ||
| } |
There was a problem hiding this comment.
Suggestion if you'd like to reduce the amount of duplication here:
bool buildPRMerge = fork ? buildForkPRMerge : buildOriginPRMerge;
bool buildPRHead = fork ? buildForkPRHead : buildOriginPRHead;
bool addHeadSuffix = buildPRMerge && buildPRHead;
if (buildPRMerge) {
head = new PullRequestSCMHead(owner, repositoryName, branchName, pr, true);
revision = getRevision(head, hash, pr);
observer.observe(head, revision);
}
if (buildPRHead) {
head = new PullRequestSCMHead(owner, repositoryName, branchName, pr, false, addHeadSuffix);
revision = getRevision(head, hash, pr);
observer.observe(head, revision);
}
There was a problem hiding this comment.
Thanks, I knew that there was a better way to handle this.
|
Review ping. This will be a non-trivial improvement in my life. Would love to see it released. |
|
Being able to only build PRs and not branches and PRs at the same time is a big must for us as well, I'd love to get this installed on our Jenkins as soon as possible :) |
|
If there's anything we can help in testing, please let us know. I was about to build this PR but then noticed that some other SCM related plugins are missing / not published yet in the 2.x release line (see blog post here) Does it make sense to take this for a spin now, or better wait for a re-release of the 2.x release line of the SCM plugins? |
|
This Pull Request is using the added objects from 2.x scm api. If you want to test/evaluate functionality, you will have to use the experimental plugins repository. So you will get access to the 2.x plugin, until they are back in the stable plugin repository. (Don't do it on production system) For the re-release of the 2.x plugins and the value to review this at the moment, @amuniz and @stephenc are probably the best persons able to answer those questions. |
|
It would be great to allow "only PRs" as well as add specific branches. This would allow us to only build PRs as well as the master branch when things are merged into it. |
|
@amuniz , any ETA possible for this? Looks like this is a must have for many (including me). |
|
Personally I was to fix the "delete everything if there is an api error" bug first and get that released before considering and additional changes |
|
This really feels like replication of the death by 1000 check-boxes anti-pattern in the GitHub Branch Source. There will likely be other tweaks that will be needed on the PR building behaviour, so I would rather get the behaviour plugable and fix both plugins UI at the same time |
|
@stephenc That would be awesome, but what time frame are we talking then? Me and others have been longing for this functionality for half a year now, and at least for my own part I'd love to have death by checkboxes instead of nothing at all while we wait for a superior alternative. |
|
@stephenc this implementation might be death by a 1000 cuts for the handful of plugin developers working in both GU and BB, but the larger number of users of this plugin are already suffering from death by 1000 cuts of duplicate builds for origin PRs. |
|
+1 been quiet for a while but still eagerly waiting for that! 👍 |
|
I am against complicating the code further until I tidy up the configuration options. |
|
@stephenc that's incongruent with the priorities you indicated 3 weeks ago. |
|
Any ETA for merge @stephenc ? |
|
Awesome job guys! |
|
@fonsecas72 Is there a workaround to skip building PRs for now? This pull request is about 5 months old and still not merged unfortunately. |
|
@kevcodez we have some Jenkinsfile trickery to build either master or PR branches only: def isPr = {
String branch = env.BRANCH_NAME;
return branch.startsWith('PR-')
}Then simply node {
if (env.BRANCH_NAME == 'master' || isPr() == true) {
// your stuff
} |
|
@kevcodez @luispabon We have the following in "Branch names to build automatically" in the organization folder configuration, which accomplishes the same thing: |
|
@estyrke I've tried Looking up TSU/eos-ts-core for branches It does not exclude PRs :(. |
|
@kevcodez It should work. Go and try the branch I've mentioned. You should then have checkboxes (similar to github) which should allow you to build whatever you want. (ignore the label issues) |
|
@stephenc any update / approximate ETA on your earlier comment regarding the cleanup? |
|
👍 |
|
+1!!! |
|
It is being worked on through this EPIC: https://issues.jenkins-ci.org/browse/JENKINS-43426 |
|
Nice preview, the option "Only branches that are not also filed as PRs" would work excellent for our use case! We are standing by to upgrade asap :) |
|
Looking forward for merge for about a year :) |
|
@stephenc status ping, anything ready enough we could take for a test ride? |
|
@tknerr getting close... sometime next week I hope |
|
Awesome, thanks @stephenc! Looking forward to give it a spin.
Am 25.05.2017 05:15 schrieb "Stephen Connolly" <notifications@github.com>:
… @tknerr <https://github.com/tknerr> getting close... sometime next week I
hope
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#25 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAWUsB20HNOq2v9s0LQ4nzi9d861OXxNks5r9PIugaJpZM4KvzEo>
.
|
|
I'm trying to use @fonsecas72's version of this (as commented further up) and I'm hitting some problems: Also, we'd like to build only PRs and the master branch. Is there any way to do this? So far, I can manage to get it to build PRs or build master, but no option for "only PRs plus regex-matched branches" |
|
I have the same use-case as @palfrey. Currently I have that implemented as custom groovy script which simply does not run the build actions if not on master branch or on PR. |
|
Same for me; |
|
FYI my refactoring is nearly ready. Will add merge commit builds for PRs, ability to not build origin branches that are files as a PR, lots of control over git extensions, etc... may even change the baby's nappy. I will be looking for beta testers next week some time |
|
I started doing some work on this and if this is of any use, https://github.com/lshift/bitbucket-branch-source-plugin/tree/jenkins-36283 has
|
|
Traits makes most of that irrelevant. The git behaviours can be attached directly. More advanced "custom" behaviours can be encapsulated in their own plugins so that only those that need the functionality clutter their UI... and only when using it |
|
superseded by #53 |


Put in place the bases to solve: Jenkins-36283
Option to choose: