SomeFire commented on a change in pull request #27: IGNITE-9770 Add 'Re-run possible blockers' button
URL:
https://github.com/apache/ignite-teamcity-bot/pull/27#discussion_r222642529
##########
File path: ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/TriggerBuild.java
##########
@@ -195,31 +196,42 @@ private String observeJira(
@GET
@Path("triggerBuilds")
public SimpleResult triggerBuilds(
- @Nullable @QueryParam("serverId") String serverId,
+ @Nullable @QueryParam("serverId") String srvId,
@Nullable @QueryParam("branchName") String branchName,
@NotNull @QueryParam("suiteIdList") String suiteIdList,
- @Nullable @QueryParam("top") Boolean top) {
+ @Nullable @QueryParam("top") Boolean top,
+ @Nullable @QueryParam("observe") Boolean observe,
+ @Nullable @QueryParam("ticketId") String ticketId) {
+
+ String jiraRes = "";
final ICredentialsProv prov = ICredentialsProv.get(req);
- if (!prov.hasAccess(serverId))
- throw ServiceUnauthorizedException.noCreds(serverId);
+ if (!prov.hasAccess(srvId))
+ throw ServiceUnauthorizedException.noCreds(srvId);
List<String> strings = Arrays.asList(suiteIdList.split(","));
if (strings.isEmpty())
return new SimpleResult("Error: nothing to run");
- final ITeamcity helper = CtxListener.getTcHelper(context).server(serverId, prov);
+ ITcHelper helper = CtxListener.getTcHelper(context);
+
+ final ITeamcity teamcity = helper.server(srvId, prov);
boolean queueToTop = top != null && top;
+ List<Build> buildList = new ArrayList<>();
+
for (String suiteId : strings) {
System.out.println("Triggering [ " + suiteId + "," + branchName + "," + "top=" + queueToTop + "]");
- helper.triggerBuild(suiteId, branchName, false, queueToTop);
+ buildList.add(teamcity.triggerBuild(suiteId, branchName, false, queueToTop));
}
- return new SimpleResult("OK");
+ if (observe != null && observe)
+ jiraRes = observeJira(srvId, branchName, ticketId, helper, teamcity, prov, buildList.toArray(new Build[0]));
Review comment:
Redundant argument `new Build[0]`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[hidden email]
With regards,
Apache Git Services