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

Commit 11aab1a

Browse files
author
Radislav Berkovich
committed
defect #868049 : Multibranch job with branch that contains '/' in name - test results are not reported and job can not be triggered from octane.
In getJobByRefId - Decoding is removed as not relevant (it was relevant only if we try to send task by direct URL, therefore was need to decode job name, now this option is not possible and decoding cause to job not to be found, why? jenkins encode '/' with %2f in job name, and if we replace %2f by '/' - job is not found)
1 parent 8bbf882 commit 11aab1a

File tree

2 files changed

+13
-18
lines changed

2 files changed

+13
-18
lines changed

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/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)