Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle (un)labeled pull request hooks #639

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Rechi
Copy link
Contributor

@Rechi Rechi commented Mar 4, 2018

Without handling the unlabeled hook jenkins still things the ignore label is present (#431) and skips building the PR.
This might also fix #496.

@@ -389,7 +389,8 @@ void onPullRequestHook(PullRequest pr) throws IOException {
doSave = true;
} else if (!trigger.isActive()) {
LOGGER.log(Level.FINE, "Not processing Pull request since the build is disabled");
} else if ("edited".equals(action) || "opened".equals(action) || "reopened".equals(action) || "synchronize".equals(action)) {
} else if ("edited".equals(action) || "labeled".equals(action) || "opened".equals(action)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you move the list of allowed labels to a static defined lists and than check if the label is inside the list?

This would improve the readability :)

Also, do we need to alter any kind of tests?

@bjoernhaeuser
Copy link
Contributor

I assume you made a manual test of this?

@Rechi
Copy link
Contributor Author

Rechi commented Mar 5, 2018

Although this solved the issue with removing blacklist labels, I just noticed that adding new labels to a PR after it was merged, caused it to be rebuild.
I'll investigate a fix for that behaviour and update the PR.

see
http://jenkins.kodi.tv/view/Automation/job/BuildMulti-PR/7295/
http://jenkins.kodi.tv/view/Automation/job/BuildMulti-PR/7296/

@bjoernhaeuser
Copy link
Contributor

Thanks!

@xwartz
Copy link

xwartz commented Apr 30, 2018

any update on this?

@Kalvin126
Copy link

Would love to get this change in. List of GitHub labels for which the build should not be triggered works but if labels are removed, builds still won't be triggered

@Rechi Rechi force-pushed the labeled-hook branch 3 times, most recently from d9a01ab to d9ab004 Compare September 24, 2018 13:53
@bjoernhaeuser
Copy link
Contributor

@Rechi do you have an update on your issue?

@therapy-lf
Copy link

Also wondering when it will be merged?

@droca
Copy link

droca commented Feb 28, 2019

Sorry for the extra comment, but I'm really interested in having this change merged.

@s1113950
Copy link

s1113950 commented Mar 4, 2019

+1 to this feature as well!

@droca
Copy link

droca commented Mar 5, 2019

It looks good enough to me, even if there are some edge cases that might still not be covered, most of them are.

@silva96
Copy link

silva96 commented Jun 26, 2019

+1 too

Copy link

@DinaGamalMahmoud DinaGamalMahmoud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 i really need to trigger jenkins if labeled or unlabeled

@DinaGamalMahmoud
Copy link

DinaGamalMahmoud commented Nov 11, 2019

@Rechi I tried to build your edits and added the plugin manually to jenkins but still changes labels couldn't be triggered by jenkins

@l3ender
Copy link

l3ender commented Mar 16, 2020

Hi all, is there anything I can do to help move this forward? We'd love to utilize this feature in our workflow. Thanks!

@mattymo
Copy link

mattymo commented Dec 11, 2020

@janinko I really would like to get your opinion on this PR

My team strongly relies on label events to trigger builds. Can you consider accepting and merging the pull request as it is (with conflict fixes)? I would prefer not to fork your project in order to get this functionality working.

If the pull request needs any fixes, I would be happy to take care of them.

@janinko
Copy link
Member

janinko commented Dec 11, 2020

Even though I'm the original author of this plugin, I'm not its maintainer anymore for a long time. If there are no active maintainer I suggest to look at https://www.jenkins.io/doc/developer/plugin-governance/adopt-a-plugin/

@mattymo
Copy link

mattymo commented Dec 11, 2020

@janinko I really appreciate you getting back about this! It's understandable if you don't want to maintain the plugin.

@bjoernhaeuser Are you also no longer an active maintainer?

@mattymo
Copy link

mattymo commented Dec 11, 2020

@janinko In the off chance that this PR is acceptable, I'm going to file a duplicate PR that addresses comments and fixes the merge conflict.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Label changes in GitHub are ignored after a PR has been opened