We are using BitBucket branch source plugin in combination with withMaven from pipeline-maven-plugin. Around 2 PM, an unknown timer kicks off and rescan, forcing all existing PRs to rebuild. The manual scan does not see this issue
Configuration: Latest Jenkins LTS and plugins:
* Filter by name (with wildcards) include: *
* Discover branches: all branches
* Discover pull requests from origin: Merging the pull request with the current target branch revision
* Filter by name including PRs destined for this branch (with wildcards): master release/*
* Checkout over SSH
* Override hook management: Use item credentials for hook management
Scan Organization Folder Triggers
* Periodically if not otherwise run: interval - 1 day
* Build whenever a SNAPSHOT dependency is built: check
It might be rebuilding because the daily repo scan sees that the target branch has been changed (e.g. master). I'm not sure why the manual scan wouldn't see this, too.
I'm using github branch source and had this issue, so it might be different in bitbucket but the repo scan log should mention something when this happens. It might say something about the current PR commit being unchanged, but the target branch commit changed.
The https://github.com/jenkinsci/basic-branch-build-strategies-plugin lets you disable building PRs when only the target branch has changed which is what I used.