-
Bug
-
Resolution: Fixed
-
High
-
7.0.0
-
Severity 3 - Minor
-
12
-
Reproduction steps:
1) Create a branch “x” and create a pull request
2) while True: (run these steps on a script until you notice that the hashes don’t match up)
git commit —amend —no-edit # hashes change at this point.
git push origin x -f
if PR commit != the actual branch commit:
break # found the bug
Notes:
When someone unrelated to the PR pushes an unrelated commit to master (as opposed to the PR branch) it seems Bitbucket goes through its ref cache and updates them. At this time the PR decides to update its commit. This puts the PR in the expected and correct state. [1]
I suspect Bitbucket has some sort of cache or db of “ref -> sha” mapping. This mapping seems to not being updated or triggered correctly on every push.
I suspect that the reason the scenario above [1] works because another (potentially unrelated) push is correctly updating this mapping and therefere causing PR’s to fall into a correct state.
It's not 100% clear to me what the expectations are here, from a user perspective, but if this issue was about refs/pull-requests/*/from refs not being updated after a push, that behavior was changed in 7.12 by
BSERV-12284. Since then, from refs are updated eagerly whenever the source branch for a pull request changes.With regards to the reproduction script from the description, no matter what there would need to be some pauses/rechecks in the script for it to be valid because updating the pull request source branch is asynchronous from the push, which means some small delay (on the order of seconds, generally) should be expected. Once the pull request's source branch is updated, however, the from ref should be updated at (effectively) the same time.
If anyone is continuing to have issues that they think are recurrences of this, and are on 7.12+, please open a support case and share a new reproduction with us so we can investigate further.
Best regards,
Bryan Turner
Atlassian Bitbucket