You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@helix.apache.org by ki...@apache.org on 2013/11/20 22:12:36 UTC
[21/52] [abbrv] git commit: [HELIX-304] Add rat check to hpost-review,
add missing license header
[HELIX-304] Add rat check to hpost-review, add missing license header
Project: http://git-wip-us.apache.org/repos/asf/incubator-helix/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-helix/commit/f3dd6331
Tree: http://git-wip-us.apache.org/repos/asf/incubator-helix/tree/f3dd6331
Diff: http://git-wip-us.apache.org/repos/asf/incubator-helix/diff/f3dd6331
Branch: refs/heads/helix-yarn
Commit: f3dd63312d75910e78821fbe3054b4c4150992c0
Parents: b3eca30
Author: Kanak Biscuitwala <ka...@apache.org>
Authored: Wed Nov 13 09:43:37 2013 -0800
Committer: Kanak Biscuitwala <ka...@apache.org>
Committed: Wed Nov 13 09:51:14 2013 -0800
----------------------------------------------------------------------
.../apache/helix/TestHelixVersionCompare.java | 19 +++++++++++++++++++
hpost-review.sh | 15 +++++++++++++++
2 files changed, 34 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/f3dd6331/helix-core/src/test/java/org/apache/helix/TestHelixVersionCompare.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/TestHelixVersionCompare.java b/helix-core/src/test/java/org/apache/helix/TestHelixVersionCompare.java
index ede570a..489369e 100644
--- a/helix-core/src/test/java/org/apache/helix/TestHelixVersionCompare.java
+++ b/helix-core/src/test/java/org/apache/helix/TestHelixVersionCompare.java
@@ -1,5 +1,24 @@
package org.apache.helix;
+/*
+ * 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.
+ */
+
import org.testng.Assert;
import org.testng.annotations.Test;
http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/f3dd6331/hpost-review.sh
----------------------------------------------------------------------
diff --git a/hpost-review.sh b/hpost-review.sh
index 0f1f5a1..7ccc41c 100755
--- a/hpost-review.sh
+++ b/hpost-review.sh
@@ -35,7 +35,19 @@ REVLIST=$1;
JIRA=$2
shift 2;
+# Run the rat plugin
+echo 'Checking source for license headers'
+mvn -Prat -DskipTests > /dev/null
+RAT_STATUS=$?
+
+if [[ $RAT_STATUS -ne 0 ]] ; then
+ echo "Maven rat plugin failed. Add license headers and try again."
+ exit 1;
+fi;
+echo 'Checking source for license headers: PASSED'
+
# Check if the commit is prefixed with [HELIX-NNN]
+echo 'Checking commit message format'
BUG_NAME=HELIX-$JIRA
COMMIT_PREFIX=\[$BUG_NAME\]
DESCRIPTION=$(git log --pretty=format:%s $REVLIST)
@@ -44,8 +56,10 @@ if [[ "$DESCRIPTION" != "$COMMIT_PREFIX"* ]] ; then
echo "Commit message must start with $COMMIT_PREFIX"
usage
fi;
+echo 'Checking commit message format: PASSED'
# Check if HELIX-NNN is a valid bug
+echo 'Checking JIRA existence'
JIRA_URL=https://issues.apache.org/jira/rest/api/latest/issue/$BUG_NAME
JIRA_STATUS=$(curl -o /dev/null --silent --head --write-out '%{http_code}\n' $JIRA_URL)
@@ -53,6 +67,7 @@ if [[ $JIRA_STATUS -eq 404 ]]; then
echo "$BUG_NAME does not exist in JIRA"
usage
fi;
+echo 'Checking JIRA existence: PASSED'
post-review --server="https://reviews.apache.org" --target-groups=helix --summary="$(git log --pretty=format:%s $REVLIST)" --description="$(git whatchanged $REVLIST)" --diff-filename=<(git diff --no-prefix $REVLIST) -o --bugs-closed=$BUG_NAME $*