Skip to content
This repository was archived by the owner on Sep 30, 2025. It is now read-only.

Commit c8edcf8

Browse files
authored
Merge pull request #242 from MicroFocus/octane-dev-latest
octane 5.8.2 fixes
2 parents 4822b35 + edabb8e commit c8edcf8

File tree

12 files changed

+476
-287
lines changed

12 files changed

+476
-287
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@
470470
<dependency>
471471
<artifactId>integrations-sdk</artifactId>
472472
<groupId>com.hpe.adm.octane.ciplugins</groupId>
473-
<version>2.0.55</version>
473+
<version>2.0.63</version>
474474
</dependency>
475475

476476
<!--BUILDER providers integration-->

src/main/java/com/microfocus/application/automation/tools/model/TestsFramework.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,17 @@ public class TestsFramework {
2525
private String description;
2626
private String name;
2727
private String format;
28-
private String delimiter;
2928

3029
public TestsFramework() {
3130
this.name = "";
3231
this.description = "";
3332
this.format = "";
34-
this.delimiter = "";
3533
}
3634

37-
public TestsFramework(String name, String description, String format, String delimiter) {
35+
public TestsFramework(String name, String description, String format) {
3836
this.name = name;
3937
this.description = description;
4038
this.format = format;
41-
this.delimiter = delimiter;
4239
}
4340

4441
public String getDescription() {
@@ -53,8 +50,4 @@ public String getFormat() {
5350
return format;
5451
}
5552

56-
public String getDelimiter() {
57-
return delimiter;
58-
}
59-
6053
}

src/main/java/com/microfocus/application/automation/tools/octane/CIJenkinsServicesImpl.java

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -685,26 +685,21 @@ private List<ParameterValue> createParameters(Job project, CIParameters ciParame
685685
private Job getJobByRefId(String jobRefId) {
686686
Job result = null;
687687
if (jobRefId != null) {
688-
try {
689-
jobRefId = URLDecoder.decode(jobRefId, StandardCharsets.UTF_8.name());
690-
TopLevelItem item = getTopLevelItem(jobRefId);
691-
if (item instanceof Job) {
692-
result = (Job) item;
693-
} else if (jobRefId.contains("/") && item == null) {
694-
String newJobRefId = jobRefId.substring(0, jobRefId.indexOf("/"));
695-
item = getTopLevelItem(newJobRefId);
696-
if (item != null) {
697-
Collection<? extends Job> allJobs = item.getAllJobs();
698-
for (Job job : allJobs) {
699-
if (jobRefId.endsWith(job.getName())) {
700-
result = job;
701-
break;
702-
}
688+
TopLevelItem item = getTopLevelItem(jobRefId);
689+
if (item instanceof Job) {
690+
result = (Job) item;
691+
} else if (jobRefId.contains("/") && item == null) {
692+
String parentJobRefId = jobRefId.substring(0, jobRefId.indexOf('/'));
693+
item = getTopLevelItem(parentJobRefId);
694+
if (item != null) {
695+
Collection<? extends Job> allJobs = item.getAllJobs();
696+
for (Job job : allJobs) {
697+
if (jobRefId.endsWith(job.getName())) {
698+
result = job;
699+
break;
703700
}
704701
}
705702
}
706-
} catch (UnsupportedEncodingException uee) {
707-
logger.error("failed to decode job ref ID '" + jobRefId + "'", uee);
708703
}
709704
}
710705
return result;

src/main/java/com/microfocus/application/automation/tools/octane/configuration/ConfigurationValidator.java

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
package com.microfocus.application.automation.tools.octane.configuration;
2222

2323
import com.hp.octane.integrations.OctaneSDK;
24-
import com.hp.octane.integrations.dto.connectivity.OctaneResponse;
24+
import com.hp.octane.integrations.exceptions.OctaneConnectivityException;
2525
import com.microfocus.application.automation.tools.octane.CIJenkinsServicesImpl;
2626
import com.microfocus.application.automation.tools.octane.Messages;
2727
import hudson.ProxyConfiguration;
@@ -100,20 +100,14 @@ public static FormValidation checkConfigurationAndWrapWithFormValidation(String
100100
}
101101

102102
public static void checkConfiguration(List<String> errorMessages, String location, String sharedSpace, String username, Secret password) {
103-
OctaneResponse checkResponse;
103+
104104
try {
105-
checkResponse = OctaneSDK.testOctaneConfiguration(location, sharedSpace, username, password.getPlainText(), CIJenkinsServicesImpl.class);
106-
107-
if (checkResponse.getStatus() == 401) {
108-
errorMessages.add(Messages.AuthenticationFailure());
109-
} else if (checkResponse.getStatus() == 403) {
110-
errorMessages.add(Messages.AuthorizationFailure());
111-
} else if (checkResponse.getStatus() == 404) {
112-
errorMessages.add(Messages.ConnectionSharedSpaceInvalid());
113-
} else if (checkResponse.getStatus() != 200) {
114-
errorMessages.add(Messages.UnexpectedFailure() + ": " + checkResponse.getStatus());
115-
}
116-
} catch (IOException ioe) {
105+
OctaneSDK.testAndValidateOctaneConfiguration(location, sharedSpace, username, password.getPlainText(), CIJenkinsServicesImpl.class);
106+
107+
} catch (OctaneConnectivityException octaneException) {
108+
errorMessages.add(octaneException.getErrorMessageVal());
109+
110+
}catch (IOException ioe) {
117111
logger.warn("Connection check failed due to communication problem", ioe);
118112
errorMessages.add(Messages.ConnectionFailure());
119113
}

src/main/java/com/microfocus/application/automation/tools/octane/events/WorkflowListenerOctaneImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ private void sendPipelineStartedEvent(FlowNode flowNode) {
116116
event
117117
.setParentCiId(parentRun.getParent().getParent().getFullName())
118118
.setMultiBranchType(MultiBranchType.MULTI_BRANCH_CHILD)
119-
.setProjectDisplayName(parentRun.getParent().getFullName());
119+
.setProjectDisplayName(parentRun.getParent().getFullDisplayName().replaceAll(" » ", "/"));
120120
}
121121

122122
CIJenkinsServicesImpl.publishEventToRelevantClients(event);

0 commit comments

Comments
 (0)