Closed kgluszczyk closed 1 year ago
What is the use case? What can you do with this patch, that you cannot do without it? Also provide a test case for that.
Within the Multibranch Pipeline project, we use that feature to trigger sanity build when a feature -> dev
PR is created. We can not hardcode that as the branch name is dynamic and we need to trigger only the build on the source branch. Another example is to trigger a build for the PR destination branch on merge.
I might be missing something, but is it not samme effect as this config?
regexpFilterExpression: "${env.BRANCH_NAME} MERGED",
regexpFilterText: "\$branch_to \$pr_state",
The screenshot above was a bit misleading. If we consider both events separately then yes, we could swap them.
The problematic part is when we have both triggers configured. We would need to determine if $branch_from
or $branch_to
should be interpolated conditionally after the variables are evaluated.
I did not test this, but is that not samme effect as this config?
regexpFilterExpression: "(.* development pr:merged)|(development .* pr:opened)",
regexpFilterText: "\$branch_from \$branch_to \$pr_state",
@tomasbjerre you're absolutely right, thanks for giving it a fresh look 😎
Variables used within
regexpFilterExpression
are not interpolated. This change mimic the existingregexpFilterText
interpolation which extends the number cases covered by the plugin.