You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by dp...@apache.org on 2019/01/29 11:59:54 UTC
[ignite-teamcity-bot] branch ignite-11105-alias updated:
IGNITE-11105 Support Teamcity servers aliases: Additional JIRA fields
This is an automated email from the ASF dual-hosted git repository.
dpavlov pushed a commit to branch ignite-11105-alias
in repository https://gitbox.apache.org/repos/asf/ignite-teamcity-bot.git
The following commit(s) were added to refs/heads/ignite-11105-alias by this push:
new c4250cf IGNITE-11105 Support Teamcity servers aliases: Additional JIRA fields
c4250cf is described below
commit c4250cf0c14e6b91dd915acfc3ce15d37a0eaf65
Author: Dmitriy Pavlov <dp...@apache.org>
AuthorDate: Tue Jan 29 14:59:51 2019 +0300
IGNITE-11105 Support Teamcity servers aliases: Additional JIRA fields
---
.../ignite/ci/jira/ignited/TicketCompacted.java | 22 +++++++++++++++++-----
.../ignite/ci/tcbot/conf/JiraServerConfig.java | 13 ++++++++++++-
2 files changed, 29 insertions(+), 6 deletions(-)
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/ignited/TicketCompacted.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/ignited/TicketCompacted.java
index 8ccfe4d..a0da352 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/ignited/TicketCompacted.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/ignited/TicketCompacted.java
@@ -41,16 +41,24 @@ public class TicketCompacted {
/** Summary, nullable because of older entries. */
@Nullable private StringFieldCompacted summary = new StringFieldCompacted();
+ /** Custom field, to be queriable after persisting in Ignite, nullable because of older entry versions. */
+ @Nullable private StringFieldCompacted customfield_11050 = new StringFieldCompacted();
+
+ /** Full description, nullable because of older entry versions. */
+ @Nullable private StringFieldCompacted description = new StringFieldCompacted();
+
/**
* @param ticket Jira ticket.
* @param comp Compactor.
- * @param ticketTemplate Ticket name template.
+ * @param ticketForCommentPrefix Ticket name prefix.
*/
- public TicketCompacted(Ticket ticket, IStringCompactor comp, String ticketTemplate) {
+ public TicketCompacted(Ticket ticket, IStringCompactor comp, String ticketForCommentPrefix) {
id = ticket.id;
- igniteId = Integer.valueOf(ticket.key.substring(ticketTemplate.length()));
+ igniteId = Integer.valueOf(ticket.key.substring(ticketForCommentPrefix.length()));
status = comp.getStringId(ticket.fields.status.name);
summary.setValue(ticket.fields.summary);
+ customfield_11050.setValue(ticket.fields.customfield_11050);
+ description.setValue(ticket.fields.description);
}
/**
@@ -65,6 +73,8 @@ public class TicketCompacted {
ticket.fields = new Fields();
ticket.fields.status = new Status(comp.getStringFromId(status));
ticket.fields.summary = summary != null ? summary.getValue() : null;
+ ticket.fields.customfield_11050 = customfield_11050 != null ? customfield_11050.getValue() : null;
+ ticket.fields.description = description != null ? description.getValue() : null;
return ticket;
}
@@ -79,11 +89,13 @@ public class TicketCompacted {
return id == compacted.id &&
igniteId == compacted.igniteId &&
status == compacted.status &&
- Objects.equal(summary, compacted.summary);
+ Objects.equal(summary, compacted.summary) &&
+ Objects.equal(customfield_11050, compacted.customfield_11050) &&
+ Objects.equal(description, compacted.description);
}
/** {@inheritDoc} */
@Override public int hashCode() {
- return Objects.hashCode(id, igniteId, status, summary);
+ return Objects.hashCode(id, igniteId, status, summary, customfield_11050, description);
}
}
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/JiraServerConfig.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/JiraServerConfig.java
index 24e7ba6..946f252 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/JiraServerConfig.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/JiraServerConfig.java
@@ -20,6 +20,7 @@ import com.google.common.base.Strings;
import java.util.ArrayList;
import java.util.Properties;
import org.apache.ignite.ci.HelperConfig;
+import org.apache.ignite.ci.jira.pure.Fields;
/**
*
@@ -32,8 +33,18 @@ public class JiraServerConfig implements IJiraServerConfig {
*/
private String projectCode;
+ /**
+ * Branch ticket template, if specified, tickets maching branches have another identification.
+ * For exaple some ticket having ID {@link #projectCode}-N1 will be commented, but a branch will be identified using
+ * {@link #branchTicketTemplate}N2 with another number of tickets. Search of branches will be performed using
+ * {@link #projectCode}-N1 ticket fields listed in {@link #branchTicketTemplateSearchFields}.
+ */
private String branchTicketTemplate;
- /** Branch ticket template search fields, list of JIRA fields IDs to be checked for finding out branch. */
+
+ /**
+ * Branch ticket template search fields, list of JIRA fields IDs to be checked for finding out branch.
+ * Available fields are field names from {@link Fields} class.
+ */
private ArrayList<String> branchTicketTemplateSearchFields;
private Properties props;