diff --git a/src/main/java/org/jenkinsci/plugins/codedx/TargetBranchChecker.java b/src/main/java/org/jenkinsci/plugins/codedx/TargetBranchChecker.java index 8023763..6e9628b 100644 --- a/src/main/java/org/jenkinsci/plugins/codedx/TargetBranchChecker.java +++ b/src/main/java/org/jenkinsci/plugins/codedx/TargetBranchChecker.java @@ -40,17 +40,16 @@ public String getBaseBranchName() { public void validate(CodeDxVersion codedxVersion, String targetBranch, String baseBranch) throws IOException, InterruptedException { if (targetBranch == null) { // no target branch, nothing branch-related to do here - this.targetBranchName = null; - this.baseBranchName = null; return; } if (codedxVersion.compareTo(CodeDxVersion.MIN_FOR_BRANCHING) < 0) { - throw new AbortException( + logger.println( "The connected Code Dx server with version " + codedxVersion + " does not support project branches. " + - "The minimum required version is " + CodeDxVersion.MIN_FOR_BRANCHING + ". Remove " + - "the target branch name or upgrade to a more recent version of Code Dx." + "The minimum required version is " + CodeDxVersion.MIN_FOR_BRANCHING + ". The target branch and base " + + "branch options will be ignored." ); + return; } this.targetBranchName = resolver.resolve("target branch", targetBranch); diff --git a/src/main/webapp/help-baseBranch.html b/src/main/webapp/help-baseBranch.html index 719dd93..5444e1b 100644 --- a/src/main/webapp/help-baseBranch.html +++ b/src/main/webapp/help-baseBranch.html @@ -1,16 +1,16 @@
- +

The Code Dx branch to use as the parent if the specified "target branch" does not exist yet. The new branch will inherit the findings of the base branch. The branch must exist in the Code Dx project beforehand. - - +

+

This field is ignored if a "target branch" is not specified, or if the target branch already exists. - - +

+

This field is required if the "target branch" does not exist yet. - - +

+

("Branches" refer to branches within the Code Dx project, not SCM branches.) - +

\ No newline at end of file diff --git a/src/main/webapp/help-targetBranch.html b/src/main/webapp/help-targetBranch.html index 848fb2f..e0383b9 100644 --- a/src/main/webapp/help-targetBranch.html +++ b/src/main/webapp/help-targetBranch.html @@ -1,10 +1,19 @@
- +

The Code Dx branch to store analysis results in. If the branch does not exist, it will be created with the specified "base branch". The "base branch" parameter is required if the target branch does not exist yet. - - +

+

("Branches" refer to branches within the Code Dx project, not SCM branches.) - +

+

+ You can use build/environment variables to construct the target branch dynamically. For example: +

${BRANCH_NAME}
+ would target the branch specified by that build variable. +

+

+ Note: the branching feature is only supported by Code Dx versions 2022.4.0 and up. This + option is ignored for older versions. +

\ No newline at end of file