Skip to content

Commit 66ba3b7

Browse files
committed
fix: serializable errors for objects to be rendered on jelly
1 parent 850132b commit 66ba3b7

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

src/main/java/com/browserstack/automate/ci/jenkins/BrowserStackReportForBuild.java

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,9 @@
3030
import static com.browserstack.automate.ci.common.logger.PluginLogger.logError;
3131

3232
public class BrowserStackReportForBuild extends AbstractBrowserStackReportForBuild {
33-
private static final int RESULT_META_MAX_SIZE = 5;
3433
private final String buildName;
35-
private final List<Session> browserStackSessions;
36-
private final List<JSONObject> result;
37-
private final List<JSONObject> resultMeta;
34+
private final transient List<Session> browserStackSessions;
35+
private final transient List<JSONObject> result;
3836
private final Map<String, String> resultAggregation;
3937
private final ProjectType projectType;
4038
private final transient PrintStream logger;
@@ -43,7 +41,7 @@ public class BrowserStackReportForBuild extends AbstractBrowserStackReportForBui
4341
// to make them available in jelly
4442
private final String errorConst = Constants.SessionStatus.ERROR;
4543
private final String failedConst = Constants.SessionStatus.FAILED;
46-
private Build browserStackBuild;
44+
private transient Build browserStackBuild;
4745
private String browserStackBuildBrowserUrl;
4846

4947
public BrowserStackReportForBuild(final Run<?, ?> build,
@@ -57,7 +55,6 @@ public BrowserStackReportForBuild(final Run<?, ?> build,
5755
this.buildName = buildName;
5856
this.browserStackSessions = new ArrayList<>();
5957
this.result = new ArrayList<>();
60-
this.resultMeta = new ArrayList<>();
6158
this.resultAggregation = new HashMap<>();
6259
this.projectType = projectType;
6360
this.logger = logger;
@@ -116,7 +113,6 @@ public boolean generateBrowserStackReport() {
116113

117114
if (result.size() > 0) {
118115
result.sort(new SessionsSortingComparator());
119-
resultMeta.addAll(result.subList(0, Math.min(result.size(), RESULT_META_MAX_SIZE)));
120116
generateAggregationInfo();
121117
return true;
122118
}
@@ -222,10 +218,6 @@ public List<JSONObject> getResult() {
222218
return result;
223219
}
224220

225-
public List<JSONObject> getResultMeta() {
226-
return resultMeta;
227-
}
228-
229221
public Map<String, String> getResultAggregation() {
230222
return resultAggregation;
231223
}

src/main/resources/com/browserstack/automate/ci/jenkins/AbstractBrowserStackReportForBuild/summary.jelly

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878

7979
</style>
8080
<t:summary icon="/plugin/browserstack-integration/images/logo.png">
81-
<j:if test="${(it.resultMeta.size() == 0)}">
81+
<j:if test="${(it.result.size() == 0)}">
8282
<div class="new-container">
8383
<div class="report-row">
8484
<p class="no-report-para"><strong class="strong-font-custom">No BrowserStack Report Available</strong></p>
@@ -93,7 +93,7 @@
9393
</div>
9494
</div>
9595
</j:if>
96-
<j:if test="${(it.resultMeta.size() > 0)}">
96+
<j:if test="${(it.result.size() > 0)}">
9797
<div class="new-container">
9898
<div class="report-row">
9999
<span class="meta-label">BUILD</span>

0 commit comments

Comments
 (0)