Repository: sqoop
Updated Branches:
  refs/heads/sqoop2 bb425e63a -> 7e092f5bf


SQOOP-2805: Sqoop2: Detect if both fixVersion and affectedVersions are empty 
and report it
 (Jarek Jarcec Cecho via Colin Ma)


Project: http://git-wip-us.apache.org/repos/asf/sqoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/sqoop/commit/7e092f5b
Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/7e092f5b
Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/7e092f5b

Branch: refs/heads/sqoop2
Commit: 7e092f5bf4abd17837da12ce20971f3a158999d4
Parents: bb425e6
Author: Colin Ma <[email protected]>
Authored: Thu Feb 4 12:04:32 2016 +0800
Committer: Colin Ma <[email protected]>
Committed: Thu Feb 4 12:04:32 2016 +0800

----------------------------------------------------------------------
 dev-support/upload-patch.py | 9 +++++++++
 1 file changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/7e092f5b/dev-support/upload-patch.py
----------------------------------------------------------------------
diff --git a/dev-support/upload-patch.py b/dev-support/upload-patch.py
index 23bcf07..5c17e58 100755
--- a/dev-support/upload-patch.py
+++ b/dev-support/upload-patch.py
@@ -194,6 +194,15 @@ if options.verbose:
 print "Getting details for JIRA %s" % (options.jira)
 jiraDetails = jira_get_issue(options)
 
+# Verify that JIRA is properly marked with versions (otherwise precommit hook 
would fail)
+versions = []
+for version in jiraDetails.get("fields").get("versions"):
+  versions = versions + [version.get("name")]
+for version in jiraDetails.get("fields").get("fixVersions"):
+  versions = versions + [version.get("name")]
+if not versions:
+  exit("Both 'Affected Version(s)' and 'Fix Version(s)' JIRA fields are empty. 
Please fill one of them with desired version first.")
+
 # Review board handling
 rbClient = RBClient(options.rb_url, username=options.rb_user, 
password=options.rb_password)
 rbRoot = rbClient.get_root()

Reply via email to