Older revision can be detected after rebasing of PR
See original GitHub issueVersion report
Jenkins and plugins versions report: Jenkins LTS 2.303.3 Bitbucket Branch Source plugin 731.v1f980b7eba32
Bitbucket: v7.17.1
Reproduction steps
- Create a multibranch job with “Ignore rebuilding merge branches when only the target branch changed” build strategy
- Create a PR
- Commit something new into PR’s target branch
- Rebase PR with target branch (more reproducible with rebases via BB UI)
Results
Expected result:
- BB plugin is able to detect the new PR revision and start the build right away
Actual result:
- It detects older revision
No changes detected: PR-3 (still at 55a71a685c9c5d3540bfdaad1c4e969ca7dd0813+1ee697add8e1f9cb270074e1f6eed14b4766a356)
-
With my setup this is consistently reproducible for rebases via BB UI, but also periodically happens with manual rebases/pushes
-
Eventually it is mitigated after another push to the target branch and reindex e.g.
Changes detected: PR-3 (55a71a685c9c5d3540bfdaad1c4e969ca7dd0813+1ee697add8e1f9cb270074e1f6eed14b4766a356 → 4578a6126a3e968a5611cd5bc186377ff77c2d70+1e0bf4524c62ad5341b45d37f8c49d8eddb23889)
Some findings
Incorrect revision being returned from: https://github.com/jenkinsci/bitbucket-branch-source-plugin/blob/master/src/main/java/com/cloudbees/jenkins/plugins/bitbucket/hooks/NativeServerPushHookProcessor.java#L226
I don’t see such behaviour if I’d add a Thread.sleep
at the start of getPullRequests
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (4 by maintainers)
Top GitHub Comments
No further issues reported from my end too
has been resolved with the new version of the plugin