-
Notifications
You must be signed in to change notification settings - Fork 146
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
Not building merged PR when source branch commit has been built, bug or ??? #222
Comments
I encountered the same problem in our build environment. Jenkins job A: Jenkins job B: Now the problem is, that the Pull Request Builder Plugin checks each commit with
If this endpoint responds with anything the plugin assumes that only itself has changed the build status of a commit. But in my case it was the other Jenkins job. In summary, the plugin should check the build-status for each commit and also consider that other jobs could have altered it. This can be done with the @CodeMonk FYI |
I'm pretty sure this is by design. The plugin stops building once a pr is merged, because there is no open PR. |
Ignore that other comment, I think I understand now - please bear with me while I paraphrase. A commit is built by ONE job, and the commit state is set for the hash. If that is the issue, I think the simplest fix would be to mark the commit with the particular job that started it, so that jobs do not conflict with each other. Is that a correct representation of the issue? (Not sure if my suggested fix is possible - I haven't looked at the commit marking stuff) |
Yes, your second comment hits the nail on the head. In my case, pushes to branches trigger a simple set of tests using just the contents of the branch. Changes to a branch that's part of a pull request run a bigger set of tests in an environment that the result of a transient merge of the "feature" branch and its base. At the moment I need to trigger them by hand because the more generic "push" tests have already "built" that commit. I could almost get the behavior I want by preventing the "push" commits from running on PR branches but it turns out that I want their results too. |
For my BitbucketServer version each commit has a build-status resource. And this Pull Request Plugin uses this resource to check if the plugin has already processed this commit.
To illustrate my problem: A multibranch pipeline which does NOT use Bitubucket Pull Request Builder detects a PR and builds it alters the build-status of a commit. If I query the REST API I get:
Now the second job which HAS Bitbucket Pull Request Plugin enabled queries this commit build state via REST and sees that this commit has already a build status and prints in the Jenkinslog that it already has processed this commit, which clearly it never has. In my opinion this is a bug. The plugin should check the Does this help? This might be a bold feature request, not a bug. Just wanted to give you guys more input on my view. |
lol - while I'm always the guy to correct bug -vs- feature request, I do believe this is a bug, and I think we're both on the same page. Do you have the skills to attempt a fix? I haven't looked at that portion of the code before, but, I'm happy to give it a shot. -Dave |
Lol, I'm asking anyone! Otherwise, I'll try to get to it. |
I try to file a pull request until the end of this week. |
I have two jobs defined for a particular repo.
One uses the
bitbucket
plugin and is configured to build for pushes to any branch, triggered via a web hook. I nicknamed this the "push job".The second uses the Bitbucket Pullrequest Builder plugin and is configured to merge the source branch into the target branch before testing. I've nicknamed this the "pr job".
I'd hoped that the "push" job would test the isolated commit and that the "pr" job would also run and test the merged results.
Instead, the push job runs and the pr job never bothers.
If I disable the push job and push something to the PR branch then the pr job does run.
If feels as if the pr job is deciding whether to run based on whether commit at the head of the source branch has been built, NOT whether the merge of that commit with the target branch has been built.
Is there a way to achieve the result I'm looking for?
Thanks!
The text was updated successfully, but these errors were encountered: