question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Older revision can be detected after rebasing of PR

See original GitHub issue

Version 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:closed
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
rausetcommented, Dec 28, 2021

No further issues reported from my end too

1reaction
sams-glebcommented, Dec 6, 2021

has been resolved with the new version of the plugin

Read more comments on GitHub >

github_iconTop Results From Across the Web

git rebase -i shows wrong commit history after ... - Stack Overflow
One of your commits is a merge. Whenever you try to squash [interactive rebase] you will get all the commits. If there is...
Read more >
The beginner's guide to rebasing your PR
Rebase essentially rolls up all the commits on your branch and then moves the branch to the tip of master and then replays...
Read more >
Master the Rebase (and the Other Way Around) | Algolia Blog
It is very important to observe that those two operations are performed in order, and that the rebase is not a substitution of...
Read more >
EGit/User Guide - Eclipsepedia
A local branch helps with this task by providing a (local) name by which the "current" commit can be found. When changes are...
Read more >
Introduction to Git rebase and force-push - GitLab Docs
Git imports all the commits submitted to main after the moment you created ... You can rebase your feature branch directly from the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found