You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by aw...@apache.org on 2015/07/31 02:06:53 UTC

[1/2] hadoop git commit: HADOOP-12228. Document releasedocmaker (aw)

Repository: hadoop
Updated Branches:
  refs/heads/HADOOP-12111 8f1f650d8 -> a38e2f276


HADOOP-12228. Document releasedocmaker (aw)


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

Branch: refs/heads/HADOOP-12111
Commit: d793970290cf0923d97d70ecbacf2b789e6936ce
Parents: 8f1f650
Author: Allen Wittenauer <aw...@apache.org>
Authored: Thu Jul 30 17:06:02 2015 -0700
Committer: Allen Wittenauer <aw...@apache.org>
Committed: Thu Jul 30 17:06:02 2015 -0700

----------------------------------------------------------------------
 dev-support/docs/releasedocmaker.md | 230 +++++++++++++++++++++++++++++++
 1 file changed, 230 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/d7939702/dev-support/docs/releasedocmaker.md
----------------------------------------------------------------------
diff --git a/dev-support/docs/releasedocmaker.md b/dev-support/docs/releasedocmaker.md
new file mode 100644
index 0000000..d8eb13c
--- /dev/null
+++ b/dev-support/docs/releasedocmaker.md
@@ -0,0 +1,230 @@
+<!---
+  Licensed 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. See accompanying LICENSE file.
+-->
+
+releasedocmaker
+===============
+
+* [Purpose](#Purpose)
+* [Basic Usage](#Basic_Usage)
+* [Changing the Header](#Changing_the_Header)
+* [Multiple Versions](#Multiple_Versions)
+* [Unreleased Dates](#Unreleased_Dates)
+* [Lint Mode](#Lint_Mode)
+
+# Purpose
+
+Building changelog information in a form that is human digestible but still containing as much useful information is difficult.  Many attempts over the years have resulted in a variety of methods that projects use to solve this problem:
+
+* JIRA-generated release notes from the "Release Notes" button
+* Manually modified CHANGES file
+* Processing git log information
+
+All of these methods have their pros and cons.  Some have issues with accuracy.  Some have issues with lack of details. None of these methods seem to cover all of the needs of many projects and are full of potential pitfalls.
+
+In order to solve these problems, releasedocmaker was written to automatically generate a changelog and release notes by querying Apache's JIRA instance.
+
+# Basic Usage
+
+Minimally, the name of the JIRA project and a version registered in JIRA must be provided:
+
+```bash
+$ releasedocmaker.py --project (project) --version (version)
+```
+
+This will query Apache JIRA, generating two files in a directory named after the given version in an extended markdown format which can be processed by both mvn site and GitHub.
+
+* CHANGES.(version).md
+
+This is similar to the JIRA "Release Notes" button but is in tabular format and includes the priority, component, reporter, and contributor fields.  It also highlights Incompatible Changes so that readers know what to look out for when upgrading. The top of the file also includes the date that the version was marked as released in JIRA.
+
+
+* RELEASENOTES.(version).md
+
+If your JIRA project supports the release note field, this will contain any JIRA mentioned in the CHANGES log that is either an incompatible change or has a release note associated with it.  If your JIRA project does not support the release notes field, this will be the description field.
+
+For example, to build the release documentation for HBase v1.2.0...
+
+```bash
+$ releasedocmaker.py --project HBASE --version 1.2.0
+```
+
+... will create a 1.2.0 directory and inside that directory will be CHANGES.1.2.0.md and RELEASENOTES.1.2.0.md .
+
+
+# Changing the Header
+
+By default, it will use a header that matches the project name.  But that is kind of ugly and the case may be wrong.  Luckily, the title can be changed:
+
+```bash
+$ releasedocmaker.py --project HBASE --version 1.2.0 --projecttitle "Apache HBase"
+```
+
+Now instead of "HBASE", it will use "Apache HBASE" for some titles and headers.
+
+# Multiple Versions
+
+The script can also generate multiple versions at once, by
+
+```bash
+$ releasedocmaker.py --project HBASE --version 1.0.0 --version 1.2.0
+```
+
+This will create the files for versions 1.0.0 and versions 1.2.0 in their own directories.
+
+But what if the version numbers are not known?  releasedocmaker can also generate version data based upon ranges:
+
+```bash
+$ releasedocmaker.py --project HBASE --version 1.0.0 --version 1.2.0 --range
+```
+
+In this form, releasedocmaker will query JIRA, discover all versions that alphabetically appear to be between 1.0.0 and 1.2.0, inclusive, and generate all of the relative release documents.  This is especially useful when bootstrapping an existing project.
+
+# Unreleased Dates
+
+For released versions, releasedocmaker will pull the date of the release from JIRA.  However, for unreleased versions it marks the release as "Unreleased". This can be inconvenient when actually building a release and wanting to include it inside the source package.
+
+The --usetoday option can be used to signify that instead of using Unreleased, releasedocmaker should use today's date.
+
+```bash
+$ releasedocmaker.py --project HBASE --version 1.0.0 --usetoday
+```
+
+After using this option and release, don't forget to change JIRA's release date to match!
+
+# Lint Mode
+
+In order to ensure proper formatting while using mvn site, releasedocmaker puts in periods (.) for fields that are empty or unassigned.  This can be unsightly and not proper for any given project.  There are also other things, such as missing release notes for incompatible changes, that are less than desirable.
+
+In order to help release managers from having to scan through potentially large documents, releasedocmaker features a lint mode, triggered via --lint:
+
+```bash
+$ releasedocmaker.py --project HBASE --version 1.0.0 --lint
+```
+
+This will do the normal JIRA querying, looking for items it considers problematic.  It will print the information to the screen and then exit with either success or failure, depending upon if any issues were discovered.
+<!---
+  Licensed 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. See accompanying LICENSE file.
+-->
+
+releasedocmaker
+===============
+
+* [Purpose](#Purpose)
+* [Basic Usage](#Basic_Usage)
+* [Changing the Header](#Changing_the_Header)
+* [Multiple Versions](#Multiple_Versions)
+* [Unreleased Dates](#Unreleased_Dates)
+* [Lint Mode](#Lint_Mode)
+
+# Purpose
+
+Building changelog information in a form that is human digestible but still containing as much useful information is difficult.  Many attempts over the years have resulted in a variety of methods that projects use to solve this problem:
+
+* JIRA-generated release notes from the "Release Notes" button
+* Manually modified CHANGES file
+* Processing git log information
+
+All of these methods have their pros and cons.  Some have issues with accuracy.  Some have issues with lack of details. None of these methods seem to cover all of the needs of many projects and are full of potential pitfalls.
+
+In order to solve these problems, releasedocmaker was written to automatically generate a changelog and release notes by querying Apache's JIRA instance.
+
+# Basic Usage
+
+Minimally, the name of the JIRA project and a version registered in JIRA must be provided:
+
+```bash
+$ releasedocmaker.py --project (project) --version (version)
+```
+
+This will query Apache JIRA, generating two files in a directory named after the given version in an extended markdown format which can be processed by both mvn site and GitHub.
+
+* CHANGES.(version).md
+
+This is similar to the JIRA "Release Notes" button but is in tabular format and includes the priority, component, reporter, and contributor fields.  It also highlights Incompatible Changes so that readers know what to look out for when upgrading. The top of the file also includes the date that the version was marked as released in JIRA.
+
+
+* RELEASENOTES.(version).md
+
+If your JIRA project supports the release note field, this will contain any JIRA mentioned in the CHANGES log that is either an incompatible change or has a release note associated with it.  If your JIRA project does not support the release notes field, this will be the description field.
+
+For example, to build the release documentation for HBase v1.2.0...
+
+```bash
+$ releasedocmaker.py --project HBASE --version 1.2.0
+```
+
+... will create a 1.2.0 directory and inside that directory will be CHANGES.1.2.0.md and RELEASENOTES.1.2.0.md .
+
+
+# Changing the Header
+
+By default, it will use a header that matches the project name.  But that is kind of ugly and the case may be wrong.  Luckily, the title can be changed:
+
+```bash
+$ releasedocmaker.py --project HBASE --version 1.2.0 --projecttitle "Apache HBase"
+```
+
+Now instead of "HBASE", it will use "Apache HBASE" for some titles and headers.
+
+# Multiple Versions
+
+The script can also generate multiple versions at once, by
+
+```bash
+$ releasedocmaker.py --project HBASE --version 1.0.0 --version 1.2.0
+```
+
+This will create the files for versions 1.0.0 and versions 1.2.0 in their own directories.
+
+But what if the version numbers are not known?  releasedocmaker can also generate version data based upon ranges:
+
+```bash
+$ releasedocmaker.py --project HBASE --version 1.0.0 --version 1.2.0 --range
+```
+
+In this form, releasedocmaker will query JIRA, discover all versions that alphabetically appear to be between 1.0.0 and 1.2.0, inclusive, and generate all of the relative release documents.  This is especially useful when bootstrapping an existing project.
+
+# Unreleased Dates
+
+For released versions, releasedocmaker will pull the date of the release from JIRA.  However, for unreleased versions it marks the release as "Unreleased". This can be inconvenient when actually building a release and wanting to include it inside the source package.
+
+The --usetoday option can be used to signify that instead of using Unreleased, releasedocmaker should use today's date.
+
+```bash
+$ releasedocmaker.py --project HBASE --version 1.0.0 --usetoday
+```
+
+After using this option and release, don't forget to change JIRA's release date to match!
+
+# Lint Mode
+
+In order to ensure proper formatting while using mvn site, releasedocmaker puts in periods (.) for fields that are empty or unassigned.  This can be unsightly and not proper for any given project.  There are also other things, such as missing release notes for incompatible changes, that are less than desirable.
+
+In order to help release managers from having to scan through potentially large documents, releasedocmaker features a lint mode, triggered via --lint:
+
+```bash
+$ releasedocmaker.py --project HBASE --version 1.0.0 --lint
+```
+
+This will do the normal JIRA querying, looking for items it considers problematic.  It will print the information to the screen and then exit with either success or failure, depending upon if any issues were discovered.


[2/2] hadoop git commit: HADOOP-12255. Add support for rubocop (missed a file) (Kengo Seki via aw)

Posted by aw...@apache.org.
HADOOP-12255. Add support for rubocop (missed a file) (Kengo Seki via aw)


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

Branch: refs/heads/HADOOP-12111
Commit: a38e2f276fc41e5eb6bb316510b03dd65cec6e2c
Parents: d793970
Author: Allen Wittenauer <aw...@apache.org>
Authored: Thu Jul 30 17:06:42 2015 -0700
Committer: Allen Wittenauer <aw...@apache.org>
Committed: Thu Jul 30 17:06:42 2015 -0700

----------------------------------------------------------------------
 dev-support/test-patch.d/rubocop.sh | 140 +++++++++++++++++++++++++++++++
 1 file changed, 140 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/a38e2f27/dev-support/test-patch.d/rubocop.sh
----------------------------------------------------------------------
diff --git a/dev-support/test-patch.d/rubocop.sh b/dev-support/test-patch.d/rubocop.sh
new file mode 100755
index 0000000..ba9810e
--- /dev/null
+++ b/dev-support/test-patch.d/rubocop.sh
@@ -0,0 +1,140 @@
+#!/usr/bin/env bash
+# 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.
+
+add_plugin rubocop
+
+RUBOCOP_TIMER=0
+
+RUBOCOP=${RUBOCOP:-$(which rubocop 2>/dev/null)}
+
+function rubocop_usage
+{
+  echo "Rubocop specific:"
+  echo "--rubocop=<path> path to rubocop executable"
+}
+
+function rubocop_parse_args
+{
+  local i
+
+  for i in "$@"; do
+    case ${i} in
+    --rubocop=*)
+      RUBOCOP=${i#*=}
+    ;;
+    esac
+  done
+}
+
+function rubocop_filefilter
+{
+  local filename=$1
+
+  if [[ ${filename} =~ \.rb$ ]]; then
+    add_test rubocop
+  fi
+}
+
+function rubocop_preapply
+{
+  local i
+
+  verify_needed_test rubocop
+  if [[ $? == 0 ]]; then
+    return 0
+  fi
+
+  big_console_header "rubocop plugin: prepatch"
+
+  if [[ ! -x ${RUBOCOP} ]]; then
+    yetus_error "${RUBOCOP} does not exist."
+    return 0
+  fi
+
+  start_clock
+
+  echo "Running rubocop against modified ruby scripts."
+  pushd "${BASEDIR}" >/dev/null
+  for i in ${CHANGED_FILES}; do
+    if [[ ${i} =~ \.rb$ && -f ${i} ]]; then
+      ${RUBOCOP} -f c "${i}" | ${AWK} '!/[0-9]* files? inspected/' >> "${PATCH_DIR}/branch-rubocop-result.txt"
+    fi
+  done
+  popd >/dev/null
+  # keep track of how much as elapsed for us already
+  RUBOCOP_TIMER=$(stop_clock)
+  return 0
+}
+
+function rubocop_postapply
+{
+  local i
+  local numPrepatch
+  local numPostpatch
+  local diffPostpatch
+
+  verify_needed_test rubocop
+  if [[ $? == 0 ]]; then
+    return 0
+  fi
+
+  big_console_header "rubocop plugin: postpatch"
+
+  if [[ ! -x ${RUBOCOP} ]]; then
+    yetus_error "${RUBOCOP} is not available."
+    add_vote_table 0 rubocop "Rubocop was not available."
+    return 0
+  fi
+
+  start_clock
+
+  # add our previous elapsed to our new timer
+  # by setting the clock back
+  offset_clock "${RUBOCOP_TIMER}"
+
+  echo "Running rubocop against modified ruby scripts."
+  # we re-check this in case one has been added
+  pushd "${BASEDIR}" >/dev/null
+  for i in ${CHANGED_FILES}; do
+    if [[ ${i} =~ \.rb$ && -f ${i} ]]; then
+      ${RUBOCOP} -f c "${i}" | ${AWK} '!/[0-9]* files? inspected/' >> "${PATCH_DIR}/patch-rubocop-result.txt"
+    fi
+  done
+  popd >/dev/null
+
+  # shellcheck disable=SC2016
+  RUBOCOP_VERSION=$(${RUBOCOP} -v | ${AWK} '{print $NF}')
+  add_footer_table rubocop "v${RUBOCOP_VERSION}"
+
+  calcdiffs "${PATCH_DIR}/branch-rubocop-result.txt" "${PATCH_DIR}/patch-rubocop-result.txt" > "${PATCH_DIR}/diff-patch-rubocop.txt"
+  diffPostpatch=$(${AWK} -F: 'BEGIN {sum=0} 4<NF {sum+=1} END {print sum}' "${PATCH_DIR}/diff-patch-rubocop.txt")
+
+  if [[ ${diffPostpatch} -gt 0 ]] ; then
+    # shellcheck disable=SC2016
+    numPrepatch=$(${AWK} -F: 'BEGIN {sum=0} 4<NF {sum+=1} END {print sum}' "${PATCH_DIR}/branch-rubocop-result.txt")
+
+    # shellcheck disable=SC2016
+    numPostpatch=$(${AWK} -F: 'BEGIN {sum=0} 4<NF {sum+=1} END {print sum}' "${PATCH_DIR}/patch-rubocop-result.txt")
+
+    add_vote_table -1 rubocop "The applied patch generated "\
+      "${diffPostpatch} new rubocop issues (total was ${numPrepatch}, now ${numPostpatch})."
+    add_footer_table rubocop "@@BASE@@/diff-patch-rubocop.txt"
+    return 1
+  fi
+
+  add_vote_table +1 rubocop "There were no new rubocop issues."
+  return 0
+}