Open CiocoiuRadu opened 1 year ago
Definitely not intended behavior. Trying to figure out what is different in your setup though, since we don't hit this problem and we have thousands of PRs across hundreds of repositories.
Ah, I missed originally that this is for a GitHub Organization Folder job. How did you configure this plugin for the folder? See also https://github.com/jenkinsci/github-pr-comment-build-plugin/issues/1 as this describes some of what might be involved. Otherwise I think you are the first one (or the first to report) to try this.
Hello, Thank you for the fast reply!
In the Jenkins organization folder, we just have the following (relevant?) settings:
I think these are the most relevant ones. I also have "Pull request" event configured in the Github webhook, and if I remove the "Trigger build on PR comment", a build will be triggered if I update one of the PRs, but it will trigger only for the relevant repo.
I had a quick look in the plugin code, as I was looking for the "Triggered build for <...>" source (from the log snippet), and if I interpreted it correctly, it will get all jobs, and if it matches the PR number, and the configured keyword, it will start a build: https://github.com/jenkinsci/github-pr-comment-build-plugin/blob/fef405665ee23acb44dea17ec12a36a887c58153/src/main/java/com/adobe/jenkins/github_pr_comment_build/IssueCommentGHEventSubscriber.java#L138C42-L138C42
I believe this is a misconfigured. As mentioned in #1, the trigger must be added in the Jenkinsfile and not on the organization folder itself. I think what is happening (just a guess though without actually seeing the config) is that the folder is the GitHubSCMSource and since it has the property on it, it triggers everything underneath it.
Jenkins and plugins versions report
Environment
Jenkins: 2.346.3 OS: Linux - 4.14.326-245.539.amzn2.x86_64 Java: 11.0.16 - Eclipse Adoptium (OpenJDK 64-Bit Server VM) ..... branch-api:2.1071.v1a_188a_562481 git:4.14.3 git-client:3.13.1 github:1.34.5 github-api:1.303-400.v35c2d8258028 github-branch-source:1696.v3a_7603564d04 github-checks:1.0.19 github-pr-comment-build:96.v9ff13b69dd66 ......What Operating System are you using (both controller, and any agents involved in the problem)?
OS: Linux - 4.14.326-245.539.amzn2.x86_64
Reproduction steps
Expected Results
The expected result would be that a build is triggered only in the repository in which the comment was posted
Actual Results
Builds are triggered for every "repository" in Jenkins that matches the PR number which sent the Github event
In the image above, a comment with the expected keyword was posted on first PR in the sw-prj-repo3 repository
Anything else?
Here is a log snippet:
Is this the intended behavior?