(Observed on Phacility earlier today)
We have repository object commit rules used to trigger Jenkins builds. Earlier today, because I needed to have OR and AND combination of conditions, I split them in 2.
The first rule simply checks if any files that are related to a given project have been modified like this (it uses OR):
The second rule does an AND between the first rule and the branch on which the commit is like this:
The intent of splitting the rules is to only trigger builds when committing on master and not on other branches. But the "Branch contains master" condition does not behave as expected:
- Right now, there's only a single master branch in the repo and pushing a new commit does trigger the build correctly.
- However, earlier today, there was another topic branch in the repo called mbedTLS:
- A commit was pushed to that branch
- Then the topic branch was fast-forwarded merged into master which was pushed
- The commit page was showing "Branches: master, mbedTLS" (it's not showing anymore since mbedTLS has been deleted, so I don't know what the exact order was, but it was certainly showing both)
- The second Herald rule failed even though the branches for the commit contain master