Hadoop Common
  1. Hadoop Common
  2. HADOOP-7384

Allow test-patch to be more flexible about patch format

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.23.0
    • Fix Version/s: 0.23.0
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      Right now the test-patch process only accepts patches that are generated as "-p0" relative to common/, hdfs/, or mapreduce/. This has always been annoying for git users where the default patch format is -p1. It's also now annoying for SVN users who may generate a patch relative to trunk/ instead of the subproject subdirectory. We should auto-detect the correct patch level.

        Issue Links

          Activity

          Hide
          Todd Lipcon added a comment -

          Here's a transcript of my manual testing:

          todd@todd-w510:~/git/hadoop-common/common$ git show | PATCH=echo src/test/bin/smart-apply-patch.sh -
          Looks like this is a git patch. Stripping a/ and b/ prefixes
          and incrementing PLEVEL
          Looks like this is relative to project root. Increasing PLEVEL
          Going to apply patch with: echo -p2
          -p2 -E
          todd@todd-w510:~/git/hadoop-common/common$ git show --no-prefix | PATCH=echo src/test/bin/smart-apply-patch.sh -
          Looks like this is relative to project root. Increasing PLEVEL
          Going to apply patch with: echo -p1
          -p1 -E
          todd@todd-w510:~/git/hadoop-common/common$ git show --relative | PATCH=echo src/test/bin/smart-apply-patch.sh -
          Looks like this is a git patch. Stripping a/ and b/ prefixes
          and incrementing PLEVEL
          Going to apply patch with: echo -p1
          -p1 -E
          todd@todd-w510:~/git/hadoop-common/common$ git show --relative --no-prefix | PATCH=echo src/test/bin/smart-apply-patch.sh -
          Going to apply patch with: echo -p0
          -p0 -E

          todd@todd-w510:~/git/hadoop-common/common$ echo > CHANGES.txt ; echo > ../mapreduce/CHANGES.txt

          todd@todd-w510:~/git/hadoop-common/common$ git diff | PATCH=echo src/test/bin/smart-apply-patch.sh -
          Looks like this is a git patch. Stripping a/ and b/ prefixes
          and incrementing PLEVEL
          Looks like this is a cross-subproject patch. Not supported!
          todd@todd-w510:~/git/hadoop-common/common$ echo $?
          1

          Show
          Todd Lipcon added a comment - Here's a transcript of my manual testing: todd@todd-w510:~/git/hadoop-common/common$ git show | PATCH=echo src/test/bin/smart-apply-patch.sh - Looks like this is a git patch. Stripping a/ and b/ prefixes and incrementing PLEVEL Looks like this is relative to project root. Increasing PLEVEL Going to apply patch with: echo -p2 -p2 -E todd@todd-w510:~/git/hadoop-common/common$ git show --no-prefix | PATCH=echo src/test/bin/smart-apply-patch.sh - Looks like this is relative to project root. Increasing PLEVEL Going to apply patch with: echo -p1 -p1 -E todd@todd-w510:~/git/hadoop-common/common$ git show --relative | PATCH=echo src/test/bin/smart-apply-patch.sh - Looks like this is a git patch. Stripping a/ and b/ prefixes and incrementing PLEVEL Going to apply patch with: echo -p1 -p1 -E todd@todd-w510:~/git/hadoop-common/common$ git show --relative --no-prefix | PATCH=echo src/test/bin/smart-apply-patch.sh - Going to apply patch with: echo -p0 -p0 -E todd@todd-w510:~/git/hadoop-common/common$ echo > CHANGES.txt ; echo > ../mapreduce/CHANGES.txt todd@todd-w510:~/git/hadoop-common/common$ git diff | PATCH=echo src/test/bin/smart-apply-patch.sh - Looks like this is a git patch. Stripping a/ and b/ prefixes and incrementing PLEVEL Looks like this is a cross-subproject patch. Not supported! todd@todd-w510:~/git/hadoop-common/common$ echo $? 1
          Hide
          Tom White added a comment -

          +1 This looks like a useful change.

          Show
          Tom White added a comment - +1 This looks like a useful change.
          Hide
          Hadoop QA added a comment -

          +1 overall. Here are the results of testing the latest attachment
          http://issues.apache.org/jira/secure/attachment/12482315/hadoop-7384.txt
          against trunk revision 1135333.

          +1 @author. The patch does not contain any @author tags.

          +1 tests included. The patch appears to include 7 new or modified tests.

          +1 javadoc. The javadoc tool did not generate any warning messages.

          +1 javac. The applied patch does not increase the total number of javac compiler warnings.

          +1 findbugs. The patch does not introduce any new Findbugs (version 1.3.9) warnings.

          +1 release audit. The applied patch does not increase the total number of release audit warnings.

          +1 core tests. The patch passed core unit tests.

          +1 system test framework. The patch passed system test framework compile.

          Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/620//testReport/
          Findbugs warnings: https://builds.apache.org/job/PreCommit-HADOOP-Build/620//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
          Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/620//console

          This message is automatically generated.

          Show
          Hadoop QA added a comment - +1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12482315/hadoop-7384.txt against trunk revision 1135333. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 7 new or modified tests. +1 javadoc. The javadoc tool did not generate any warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 findbugs. The patch does not introduce any new Findbugs (version 1.3.9) warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. +1 core tests. The patch passed core unit tests. +1 system test framework. The patch passed system test framework compile. Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/620//testReport/ Findbugs warnings: https://builds.apache.org/job/PreCommit-HADOOP-Build/620//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/620//console This message is automatically generated.
          Hide
          Todd Lipcon added a comment -

          Committed to trunk

          Show
          Todd Lipcon added a comment - Committed to trunk
          Hide
          Hudson added a comment -

          Integrated in Hadoop-Common-trunk-Commit #653 (See https://builds.apache.org/job/Hadoop-Common-trunk-Commit/653/)
          Amend commit of HADOOP-7384 to include svn:executable bit on smart-apply-patch.sh
          HADOOP-7384. Allow test-patch to be more flexible about patch format. Contributed by Todd Lipcon.

          todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1135636
          Files :

          • /hadoop/common/trunk/common/src/test/bin/smart-apply-patch.sh

          todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1135633
          Files :

          • /hadoop/common/trunk/common/CHANGES.txt
          • /hadoop/common/trunk/common/src/test/bin/smart-apply-patch.sh
          • /hadoop/common/trunk/common/src/test/bin/test-patch.sh
          Show
          Hudson added a comment - Integrated in Hadoop-Common-trunk-Commit #653 (See https://builds.apache.org/job/Hadoop-Common-trunk-Commit/653/ ) Amend commit of HADOOP-7384 to include svn:executable bit on smart-apply-patch.sh HADOOP-7384 . Allow test-patch to be more flexible about patch format. Contributed by Todd Lipcon. todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1135636 Files : /hadoop/common/trunk/common/src/test/bin/smart-apply-patch.sh todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1135633 Files : /hadoop/common/trunk/common/CHANGES.txt /hadoop/common/trunk/common/src/test/bin/smart-apply-patch.sh /hadoop/common/trunk/common/src/test/bin/test-patch.sh
          Hide
          Hudson added a comment -

          Integrated in Hadoop-Common-trunk-maven #17 (See https://builds.apache.org/job/Hadoop-Common-trunk-maven/17/)
          Amend commit of HADOOP-7384 to include svn:executable bit on smart-apply-patch.sh
          HADOOP-7384. Allow test-patch to be more flexible about patch format. Contributed by Todd Lipcon.

          todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1135636
          Files :

          • /hadoop/common/trunk/common/src/test/bin/smart-apply-patch.sh

          todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1135633
          Files :

          • /hadoop/common/trunk/common/CHANGES.txt
          • /hadoop/common/trunk/common/src/test/bin/smart-apply-patch.sh
          • /hadoop/common/trunk/common/src/test/bin/test-patch.sh
          Show
          Hudson added a comment - Integrated in Hadoop-Common-trunk-maven #17 (See https://builds.apache.org/job/Hadoop-Common-trunk-maven/17/ ) Amend commit of HADOOP-7384 to include svn:executable bit on smart-apply-patch.sh HADOOP-7384 . Allow test-patch to be more flexible about patch format. Contributed by Todd Lipcon. todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1135636 Files : /hadoop/common/trunk/common/src/test/bin/smart-apply-patch.sh todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1135633 Files : /hadoop/common/trunk/common/CHANGES.txt /hadoop/common/trunk/common/src/test/bin/smart-apply-patch.sh /hadoop/common/trunk/common/src/test/bin/test-patch.sh
          Hide
          Hudson added a comment -

          Integrated in Hadoop-Mapreduce-trunk-Commit #728 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Commit/728/)
          Amend commit of HADOOP-7384 to include svn:executable bit on smart-apply-patch.sh
          HADOOP-7384. Allow test-patch to be more flexible about patch format. Contributed by Todd Lipcon.

          todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1135636
          Files :

          • /hadoop/common/trunk/common/src/test/bin/smart-apply-patch.sh

          todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1135633
          Files :

          • /hadoop/common/trunk/common/CHANGES.txt
          • /hadoop/common/trunk/common/src/test/bin/smart-apply-patch.sh
          • /hadoop/common/trunk/common/src/test/bin/test-patch.sh
          Show
          Hudson added a comment - Integrated in Hadoop-Mapreduce-trunk-Commit #728 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Commit/728/ ) Amend commit of HADOOP-7384 to include svn:executable bit on smart-apply-patch.sh HADOOP-7384 . Allow test-patch to be more flexible about patch format. Contributed by Todd Lipcon. todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1135636 Files : /hadoop/common/trunk/common/src/test/bin/smart-apply-patch.sh todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1135633 Files : /hadoop/common/trunk/common/CHANGES.txt /hadoop/common/trunk/common/src/test/bin/smart-apply-patch.sh /hadoop/common/trunk/common/src/test/bin/test-patch.sh
          Hide
          Hudson added a comment -

          Integrated in Hadoop-Hdfs-trunk-Commit #746 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Commit/746/)

          Show
          Hudson added a comment - Integrated in Hadoop-Hdfs-trunk-Commit #746 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Commit/746/ )
          Hide
          Hudson added a comment -

          Integrated in Hadoop-Mapreduce-trunk #722 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/722/)

          Show
          Hudson added a comment - Integrated in Hadoop-Mapreduce-trunk #722 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/722/ )

            People

            • Assignee:
              Todd Lipcon
              Reporter:
              Todd Lipcon
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development