[BitBucket Branch Source Plugin] Massive PR rebuild

91 views
Skip to first unread message

Dan Tran

unread,
May 15, 2018, 6:10:27 PM5/15/18
to Jenkins Users

Hi

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

Any advice is greatly appreciated

-D

Steven Foster

unread,
May 15, 2018, 6:44:26 PM5/15/18
to Jenkins Users
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.

Dan Tran

unread,
May 15, 2018, 11:10:28 PM5/15/18
to Jenkins Users
Awesome will try it out

Thanks

Dan Tran

unread,
May 16, 2018, 6:34:45 PM5/16/18
to Jenkins Users

I added 'build strategies'

    * Change requests

        Ignore rebuilding merge branches when only the target branch changed = check

    * Named branches
        Wildcard include/excludes: master

Without the second one, no build trigger at direct commit to master and PR merge into master

Sofar it seems to work.  

Thanks

-D 
Reply all
Reply to author
Forward
0 new messages