From commits-return-3199-archive-asf-public=cust-asf.ponee.io@metron.apache.org Mon Jun 11 23:53:27 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 73D95180789 for ; Mon, 11 Jun 2018 23:53:26 +0200 (CEST) Received: (qmail 69063 invoked by uid 500); 11 Jun 2018 21:53:25 -0000 Mailing-List: contact commits-help@metron.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@metron.apache.org Delivered-To: mailing list commits@metron.apache.org Received: (qmail 69026 invoked by uid 99); 11 Jun 2018 21:53:25 -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, 11 Jun 2018 21:53:25 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 16928E0C5A; Mon, 11 Jun 2018 21:53:25 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: cestella@apache.org To: commits@metron.apache.org Date: Mon, 11 Jun 2018 21:53:26 -0000 Message-Id: <76660ad375e04433b323c2fe481dacba@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [02/50] [abbrv] metron git commit: METRON-1553 Validate JIRA Script Error (nickwallen) closes apache/metron#1013 METRON-1553 Validate JIRA Script Error (nickwallen) closes apache/metron#1013 Project: http://git-wip-us.apache.org/repos/asf/metron/repo Commit: http://git-wip-us.apache.org/repos/asf/metron/commit/45e3ed87 Tree: http://git-wip-us.apache.org/repos/asf/metron/tree/45e3ed87 Diff: http://git-wip-us.apache.org/repos/asf/metron/diff/45e3ed87 Branch: refs/heads/feature/METRON-1416-upgrade-solr Commit: 45e3ed87ca4aceda7c8387389fc3a286ee5264d9 Parents: dbcc52c Author: nickwallen Authored: Tue Jun 5 11:50:58 2018 -0400 Committer: nickallen Committed: Tue Jun 5 11:50:58 2018 -0400 ---------------------------------------------------------------------- .../release-utils/validate-jira-for-release | 75 ++++++++++++-------- 1 file changed, 46 insertions(+), 29 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/metron/blob/45e3ed87/dev-utilities/release-utils/validate-jira-for-release ---------------------------------------------------------------------- diff --git a/dev-utilities/release-utils/validate-jira-for-release b/dev-utilities/release-utils/validate-jira-for-release index df5776c..5fd4367 100755 --- a/dev-utilities/release-utils/validate-jira-for-release +++ b/dev-utilities/release-utils/validate-jira-for-release @@ -137,35 +137,52 @@ for i in "$@"; do esac done -WORKDIR="~/tmp" # ensure all required values are set if [ -z "$VERSION" ]; then - echo "Missing -v/--version is is required" - exit 1 + help + echo "Missing -v/--version is is required" + exit 1 fi if [ -z "$START" ]; then - echo "Missing -s/--start which is required" - exit 1 + help + echo "Missing -s/--start which is required" + exit 1 fi if [ -z "$END" ]; then - echo "Missing -e/--end which is required" - exit 1 + help + echo "Missing -e/--end which is required" + exit 1 fi if [ -z "$REPO" ]; then - echo "Missing -r/--repo which is required" - exit 1 + help + echo "Missing -r/--repo which is required" + exit 1 fi if [ -z "$BRANCH" ]; then - echo "Missing -b/--branch which is required" - exit 1 + help + echo "Missing -b/--branch which is required" + exit 1 fi -# clone the metron repo and fetch all tags -git clone $REPO "metron-$VERSION" +TMPDIR="$HOME/tmp" +WORKDIR="$TMPDIR/metron-$VERSION" + +# warn the user if the working directory exists +if [ -d "$WORKDIR" ]; then + read -p " directory exists [$WORKDIR]. overwrite existing repo? [yN] " -n 1 -r + echo + if [[ ! $REPLY =~ ^[Yy]$ ]]; then + exit 1 + fi +fi + +# fetch the repo and all tags +rm -rf "$WORKDIR" +git clone $REPO "$WORKDIR" +cd "$WORKDIR" git checkout $BRANCH -cd "$WORKDIR/metron-$VERSION" -git fetch --all --tags +git fetch --tags # find all JIRAs that have been committed since the last release GET_JIRAS="git log $START..$END --oneline | grep -E -o 'METRON[- ]*[0-9]+'" @@ -177,21 +194,21 @@ printf "$FORMAT_STR" "JIRA" "STATUS" "FIX VERSION" "ASSIGNEE" "FIX" # for each JIRA since the last release tag... eval $GET_JIRAS | while read JIRA ; do - # fetch the JIRA content - URL="https://issues.apache.org/jira/si/jira.issueviews:issue-xml/$JIRA/$JIRA.xml" - CONTENT=`curl -s $URL` + # fetch the JIRA content + URL="https://issues.apache.org/jira/si/jira.issueviews:issue-xml/$JIRA/$JIRA.xml" + CONTENT=`curl -s $URL` - # painfully extract some fields - STATUS=`echo "$CONTENT" | grep "]*>" | sed 's/^.*]*>//' | sed 's/<.status>.*$//'` - ASSIGNEE=`echo "$CONTENT" | grep "]*>" | sed 's/^.*]*>//' | sed 's/<.assignee>.*$//'` - FIXV=`echo "$CONTENT" | grep "]*>" | sed 's/^.*]*>//' | sed 's/<.fixVersion>.*$//'` + # painfully extract some fields + STATUS=`echo "$CONTENT" | grep "]*>" | sed 's/^.*]*>//' | sed 's/<.status>.*$//'` + ASSIGNEE=`echo "$CONTENT" | grep "]*>" | sed 's/^.*]*>//' | sed 's/<.assignee>.*$//'` + FIXV=`echo "$CONTENT" | grep "]*>" | sed 's/^.*]*>//' | sed 's/<.fixVersion>.*$//'` - # the link is only populated, if there is something to fix - LINK="" - if [ "$FIXV" != "$VERSION" ] || [ "$STATUS" != "Done" ]; then - LINK="https://issues.apache.org/jira/browse/$JIRA" - fi + # the link is only populated, if there is something to fix + LINK="" + if [ "$FIXV" != "$VERSION" ] || [ "$STATUS" != "Done" ]; then + LINK="https://issues.apache.org/jira/browse/$JIRA" + fi - # show the JIRA - printf "$FORMAT_STR" "$JIRA" "$STATUS" "$FIXV" "$ASSIGNEE" "$LINK" + # show the JIRA + printf "$FORMAT_STR" "$JIRA" "$STATUS" "$FIXV" "$ASSIGNEE" "$LINK" done