-
Notifications
You must be signed in to change notification settings - Fork 25
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
Allow jobs that are not named PR-.* #20
Comments
+1 Are there any plans to not hardcode the pattern? How about one can set the pattern manually for each pipeline? |
These event handlers receive all events. So this ensures that it matches a PR job named the same as the PR number. Otherwise you could have a branch named mybranch1 and it would match PR 1, etc. I'm happy to allow for modifying this in the configuration, but I don't have the time to implement it myself. Pull requests are welcome to implement this. |
That sounds really weird... So this also means that it's required to have previous job? This will not work, when want to trigger some one-time job (like "deploy", for example) which was not triggered before... |
@okainov, I'm not sure where you got anything about a previous job from. I didn't mention anything about previous job runs vs one-offs. All I was saying is that the pattern is there to make sure that the events received for a PR match the job that is for that PR (and no other jobs), we use that regex. If the jobs are named something else, that's something that needs to be configured. However, I still don't have time to pick this up, but would welcome any contributions from the community. |
The worst part of this is that it isn't even documented. That the job must be named |
I have set up the plugin for a multibranch pipeline. But the pull request comments are not triggering the build.
I was checking the plugin code.
There is a regex variable
pullRequestJobNamePattern=Pattern.compile("^PR-" + pullRequestId + "\\b.*$", Pattern.CASE_INSENSITIVE)
https://github.com/jenkinsci/github-pr-comment-build-plugin/blob/master/src/main/java/com/adobe/jenkins/github_pr_comment_build/IssueCommentGHEventSubscriber.java#L94
It is being used to match with the job name.
https://github.com/jenkinsci/github-pr-comment-build-plugin/blob/master/src/main/java/com/adobe/jenkins/github_pr_comment_build/IssueCommentGHEventSubscriber.java#L136
I need help in understanding why does this pattern have to be matched with the job name. As I could understand, the job name contains pipeline name and branch name concatenated by a slash (pipelineName/jobName). I debugged the code, In my case, this pattern is not being matched and hence pipeline is not being triggered.
Thanks
The text was updated successfully, but these errors were encountered: