Return-Path: X-Original-To: apmail-ignite-commits-archive@minotaur.apache.org Delivered-To: apmail-ignite-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 84B8D17CCD for ; Mon, 1 Jun 2015 12:35:57 +0000 (UTC) Received: (qmail 48187 invoked by uid 500); 1 Jun 2015 12:35:54 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 48150 invoked by uid 500); 1 Jun 2015 12:35:54 -0000 Mailing-List: contact commits-help@ignite.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.incubator.apache.org Delivered-To: mailing list commits@ignite.incubator.apache.org Received: (qmail 48096 invoked by uid 99); 1 Jun 2015 12:35:54 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Jun 2015 12:35:54 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id E8F7D183A2E for ; Mon, 1 Jun 2015 12:35:53 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.79 X-Spam-Level: * X-Spam-Status: No, score=1.79 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 1o0yYN4fjK-j for ; Mon, 1 Jun 2015 12:35:38 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with SMTP id D4C172549D for ; Mon, 1 Jun 2015 12:35:37 +0000 (UTC) Received: (qmail 46309 invoked by uid 99); 1 Jun 2015 12:35:36 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Jun 2015 12:35:36 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 829E6E0525; Mon, 1 Jun 2015 12:35:36 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sboikov@apache.org To: commits@ignite.incubator.apache.org Date: Mon, 01 Jun 2015 12:35:36 -0000 Message-Id: <6bbf9626ffb4404eb0f409b97c3ce3f6@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [01/50] [abbrv] incubator-ignite git commit: # ignite-456: change history managment Repository: incubator-ignite Updated Branches: refs/heads/ignite-648 69c345099 -> c6fafea98 # ignite-456: change history managment Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/484a0fe0 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/484a0fe0 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/484a0fe0 Branch: refs/heads/ignite-648 Commit: 484a0fe0dc083745c2a0fc0c1a6bbbea601cc376 Parents: d2af9e2 Author: artem.shutak Authored: Tue May 26 17:03:06 2015 +0300 Committer: artem.shutak Committed: Tue May 26 17:03:06 2015 +0300 ---------------------------------------------------------------------- dev-tools/src/main/groovy/jiraslurp.groovy | 36 +++++++++++++++---------- 1 file changed, 22 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/484a0fe0/dev-tools/src/main/groovy/jiraslurp.groovy ---------------------------------------------------------------------- diff --git a/dev-tools/src/main/groovy/jiraslurp.groovy b/dev-tools/src/main/groovy/jiraslurp.groovy index 0920001..93349ef 100644 --- a/dev-tools/src/main/groovy/jiraslurp.groovy +++ b/dev-tools/src/main/groovy/jiraslurp.groovy @@ -117,8 +117,9 @@ def sendGetRequest = { urlString, user, pwd-> final GIT_REPO = "https://git1-us-west.apache.org/repos/asf/incubator-ignite.git" final JIRA_URL = "https://issues.apache.org" final ATTACHMENT_URL = "$JIRA_URL/jira/secure/attachment" -final validated_filename = "${System.getProperty("user.home")}/validated-jira.txt" -final LAST_SUCCESSFUL_ARTIFACT = "guestAuth/repository/download/Ignite_PatchValidation_PatchChecker/.lastSuccessful/$validated_filename" +final HISTORY_FILE = "${System.getProperty("user.home")}/validated-jira.txt" +final LAST_SUCCESSFUL_ARTIFACT = "guestAuth/repository/download/Ignite_PatchValidation_PatchChecker/.lastSuccessful/$HISTORY_FILE" +final NL = System.getProperty("line.separator") final def JIRA_CMD = System.getProperty('JIRA_COMMAND', 'jira.sh') @@ -162,16 +163,20 @@ def readHistory = { List validated_list = [] - def validated = new File(validated_filename) + def validated = new File(HISTORY_FILE) if (validated.exists()) { validated_list = validated.text.split('\n') } // Let's make sure the preserved history isn't too long - if (validated_list.size > MAX_HISTORY) + if (validated_list.size > MAX_HISTORY) { validated_list = validated_list[validated_list.size - MAX_HISTORY..validated_list.size - 1] + validated.delete() + validated << validated_list.join(NL) + } + println "History=$validated_list" validated_list @@ -211,31 +216,32 @@ def findAttachments = { "https://issues.apache.org/jira/sr/jira.issueviews:searchrequest-xml/12330308/SearchRequest-12330308.xml?tempMax=100&field=key&field=attachments" def rss = new XmlSlurper().parse(JIRA_FILTER) - List list = readHistory {} + final List history = readHistory {} LinkedHashMap attachments = [:] rss.channel.item.each { jira -> String row = getLatestAttachment(jira) - if (row != null && !list.contains(row)) { + if (row != null && !history.contains(row)) { def pair = row.split(',') attachments.put(pair[0] as String, pair[1] as String) - - list.add(row) } } - // Write everything back to persist the list - def validated = new File(validated_filename) + attachments +} - if (validated.exists()) - validated.delete() +/** + * Store jira with attachment id to hostory. + */ +def addToHistory = {jira, attachmentId -> + def validated = new File(HISTORY_FILE) - validated << list.join('\n') + assert validated.exists(), "History file does not exist." - attachments + validated << NL + "$jira,$attachmentId" } def tryGitAmAbort = { @@ -445,6 +451,8 @@ args.each { println "Triggering the test builds for: $k = $ATTACHMENT_URL/$v/" runAllTestBuilds(builds, k) + + addToHistory(k, v) } } else if (parameters.length >= 1 && parameters[0] == "patchApply") {