Shared Jenkins library which all ODS projects & components use - provisioning, SonarQube code scanning, Nexus publishing, OpenShift template based deployments and repository orchestration
The feature/ prefix contains a stop-character, which conveys gives the impression that multiple branches could be mapped.
setMostSpecificEnvironment looks like this may be a feature. So the testing-more-edge-cases branch would not trigger the test-env run but test-more-edge-cases would? That is surprising to me :)
Proposed Solution
Put aside any discussions about compatibility, we could change to only trigger the startsWith match if the key ends with an asterisk:
Describe the bug
We have a fairly regular branch-mapping configured in our ODS 4.x project:
It "looks" like I had configured a simple 1:1 branch mapping.
But when I push a branch called
develop-foobar
two things happen:odsComponentStageBuildOpenShiftImage
does not build the image:(That is expected).
odsComponentStageRolloutOpenShiftDeployment
tries to rollout:That was unexpected.
Expected behavior
Both functions must make the same decision (either run or don't)
Both should decide against running because my branch map didn't indicate that I want "starts with" matches.
The second expectation is about the principle of least surprise.
This example is a bit more exciting:
The
feature/
prefix contains a stop-character, which conveys gives the impression that multiple branches could be mapped.setMostSpecificEnvironment
looks like this may be a feature. So thetesting-more-edge-cases
branch would not trigger the test-env run buttest-more-edge-cases
would? That is surprising to me :)Proposed Solution
Put aside any discussions about compatibility, we could change to only trigger the
startsWith
match if the key ends with an asterisk:If key ends with
*
then remove*
and go intoif startsWith
branch.This would run
test
,testing-more
andtest-more
,develop
,feature/
andfeature/foo
but NOTdevelop-more
andfeature
.Affected version (please complete the following information):