sk0x50 commented on code in PR #202:
URL: 
https://github.com/apache/ignite-teamcity-bot/pull/202#discussion_r2510206416


##########
ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/jira/v2/JiraCommentsGeneratorV2.java:
##########
@@ -0,0 +1,198 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.ci.tcbot.jira.v2;
+
+import com.google.common.base.Strings;
+import java.util.List;
+import org.apache.ignite.ci.teamcity.ignited.buildtype.BuildTypeRefCompacted;
+import org.apache.ignite.tcbot.engine.ui.ShortSuiteNewTestsUi;
+import org.apache.ignite.tcbot.engine.ui.ShortSuiteUi;
+import org.apache.ignite.tcbot.engine.ui.ShortTestFailureUi;
+import org.apache.ignite.tcbot.engine.ui.ShortTestUi;
+import org.apache.ignite.tcbot.persistence.IStringCompactor;
+import org.apache.ignite.tcignited.ITeamcityIgnited;
+import org.apache.ignite.tcservice.ITeamcity;
+
+import static 
org.apache.ignite.ci.tcbot.jira.JiraCommentsGenerator.jiraEscText;
+import static org.apache.ignite.tcservice.util.XmlUtil.xmlEscapeText;
+
+public class JiraCommentsGeneratorV2 {
+    /**
+     * @param compactor String compactor.
+     * @param suites Suite Current Status.
+     * @param webUrl Build URL.
+     * @param buildTypeId Build type ID, for which visa was ordered.
+     * @param tcIgnited TC service.
+     * @param blockers Count of blockers.
+     * @param branchName TC Branch name, which was tested.
+     * @param baseBranch TC Base branch used for comment
+     * @return Comment, which should be sent to the JIRA ticket.
+     */
+    public static String generateJiraComment(
+        IStringCompactor compactor,
+        List<ShortSuiteUi> suites,
+        List<ShortSuiteNewTestsUi> newTestsStatuses,
+        String webUrl,
+        String buildTypeId,
+        ITeamcityIgnited tcIgnited,
+        int blockers,
+        String branchName,
+        String baseBranch
+    ) {
+        BuildTypeRefCompacted bt = tcIgnited.getBuildTypeRef(buildTypeId);
+
+        String suiteNameUsedForVisa = (bt != null ? bt.name(compactor) : 
buildTypeId);
+
+        StringBuilder res = new StringBuilder();
+
+        String baseBranchDisp = (Strings.isNullOrEmpty(baseBranch) || 
ITeamcity.DEFAULT.equals(baseBranch))
+            ? "master" :  baseBranch ;
+        for (ShortSuiteUi suite : suites) {
+            res.append("{color:#d04437}");

Review Comment:
   Thanks! Fixed.
   
   ```
       public static final String FAILED_TEST_SUITE_COLOR = "#d04437";
   
       public static final String NEW_TEST_SUITE_COLOR = "#00008b";
   
       public static final String FAILED_TEST_COLOR = "#8b0000";
   
       public static final String PASSED_TEST_COLOR = "#013220";
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to