|
| 1 | +<!-- |
| 2 | +Licensed to the Apache Software Foundation (ASF) under one or more |
| 3 | +contributor license agreements. See the NOTICE file distributed with |
| 4 | +this work for additional information regarding copyright ownership. |
| 5 | +The ASF licenses this file to You under the Apache License, Version 2.0 |
| 6 | +(the "License"); you may not use this file except in compliance with |
| 7 | +the License. You may obtain a copy of the License at |
| 8 | +
|
| 9 | +http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +
|
| 11 | +Unless required by applicable law or agreed to in writing, software |
| 12 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | +See the License for the specific language governing permissions and |
| 15 | +limitations under the License. |
| 16 | +--> |
| 17 | + |
| 18 | +Apache Hadoop Git/Jira FixVersion validation |
| 19 | +============================================================ |
| 20 | + |
| 21 | +Git commits in Apache Hadoop contains Jira number of the format |
| 22 | +HADOOP-XXXX or HDFS-XXXX or YARN-XXXX or MAPREDUCE-XXXX. |
| 23 | +While creating a release candidate, we also include changelist |
| 24 | +and this changelist can be identified based on Fixed/Closed Jiras |
| 25 | +with the correct fix versions. However, sometimes we face few |
| 26 | +inconsistencies between fixed Jira and Git commit message. |
| 27 | + |
| 28 | +git_jira_fix_version_check.py script takes care of |
| 29 | +identifying all git commits with commit |
| 30 | +messages with any of these issues: |
| 31 | + |
| 32 | +1. commit is reverted as per commit message |
| 33 | +2. commit does not contain Jira number format in message |
| 34 | +3. Jira does not have expected fixVersion |
| 35 | +4. Jira has expected fixVersion, but it is not yet resolved |
| 36 | + |
| 37 | +Moreover, this script also finds any resolved Jira with expected |
| 38 | +fixVersion but without any corresponding commit present. |
| 39 | + |
| 40 | +This should be useful as part of RC preparation. |
| 41 | + |
| 42 | +git_jira_fix_version_check supports python3 and it required |
| 43 | +installation of jira: |
| 44 | + |
| 45 | +``` |
| 46 | +$ python3 --version |
| 47 | +Python 3.9.7 |
| 48 | +
|
| 49 | +$ python3 -m venv ./venv |
| 50 | +
|
| 51 | +$ ./venv/bin/pip install -r dev-support/git-jira-validation/requirements.txt |
| 52 | +
|
| 53 | +$ ./venv/bin/python dev-support/git-jira-validation/git_jira_fix_version_check.py |
| 54 | +
|
| 55 | +``` |
| 56 | + |
| 57 | +The script also requires below inputs: |
| 58 | +``` |
| 59 | +1. First commit hash to start excluding commits from history: |
| 60 | + Usually we can provide latest commit hash from last tagged release |
| 61 | + so that the script will only loop through all commits in git commit |
| 62 | + history before this commit hash. e.g for 3.3.2 release, we can provide |
| 63 | + git hash: fa4915fdbbbec434ab41786cb17b82938a613f16 |
| 64 | + because this commit bumps up hadoop pom versions to 3.3.2: |
| 65 | + https://github.com/apache/hadoop/commit/fa4915fdbbbec434ab41786cb17b82938a613f16 |
| 66 | +
|
| 67 | +2. Fix Version: |
| 68 | + Exact fixVersion that we would like to compare all Jira's fixVersions |
| 69 | + with. e.g for 3.3.2 release, it should be 3.3.2. |
| 70 | +
|
| 71 | +3. JIRA Project Name: |
| 72 | + The exact name of Project as case-sensitive e.g HADOOP / OZONE |
| 73 | +
|
| 74 | +4. Path of project's working dir with release branch checked-in: |
| 75 | + Path of project from where we want to compare git hashes from. Local fork |
| 76 | + of the project should be up-to date with upstream and expected release |
| 77 | + branch should be checked-in. |
| 78 | +
|
| 79 | +5. Jira server url (default url: https://issues.apache.org/jira): |
| 80 | + Default value of server points to ASF Jiras but this script can be |
| 81 | + used outside of ASF Jira too. |
| 82 | +``` |
| 83 | + |
| 84 | + |
| 85 | +Example of script execution: |
| 86 | +``` |
| 87 | +JIRA Project Name (e.g HADOOP / OZONE etc): HADOOP |
| 88 | +First commit hash to start excluding commits from history: fa4915fdbbbec434ab41786cb17b82938a613f16 |
| 89 | +Fix Version: 3.3.2 |
| 90 | +Jira server url (default: https://issues.apache.org/jira): |
| 91 | +Path of project's working dir with release branch checked-in: /Users/vjasani/Documents/src/hadoop-3.3/hadoop |
| 92 | +
|
| 93 | +Check git status output and verify expected branch |
| 94 | +
|
| 95 | +On branch branch-3.3.2 |
| 96 | +Your branch is up to date with 'origin/branch-3.3.2'. |
| 97 | +
|
| 98 | +nothing to commit, working tree clean |
| 99 | +
|
| 100 | +
|
| 101 | +Jira/Git commit message diff starting: ############################################## |
| 102 | +Jira not present with version: 3.3.2. Commit: 8cd8e435fb43a251467ca74fadcb14f21a3e8163 HADOOP-17198. Support S3 Access Points (#3260) (branch-3.3.2) (#3955) |
| 103 | +WARN: Jira not found. Commit: 8af28b7cca5c6020de94e739e5373afc69f399e5 Updated the index as per 3.3.2 release |
| 104 | +WARN: Jira not found. Commit: e42e483d0085aa46543ebcb1196dd155ddb447d0 Make upstream aware of 3.3.1 release |
| 105 | +Commit seems reverted. Commit: 6db1165380cd308fb74c9d17a35c1e57174d1e09 Revert "HDFS-14099. Unknown frame descriptor when decompressing multiple frames (#3836)" |
| 106 | +Commit seems reverted. Commit: 1e3f94fa3c3d4a951d4f7438bc13e6f008f228f4 Revert "HDFS-16333. fix balancer bug when transfer an EC block (#3679)" |
| 107 | +Jira not present with version: 3.3.2. Commit: ce0bc7b473a62a580c1227a4de6b10b64b045d3a HDFS-16344. Improve DirectoryScanner.Stats#toString (#3695) |
| 108 | +Jira not present with version: 3.3.2. Commit: 30f0629d6e6f735c9f4808022f1a1827c5531f75 HDFS-16339. Show the threshold when mover threads quota is exceeded (#3689) |
| 109 | +Jira not present with version: 3.3.2. Commit: e449daccf486219e3050254d667b74f92e8fc476 YARN-11007. Correct words in YARN documents (#3680) |
| 110 | +Commit seems reverted. Commit: 5c189797828e60a3329fd920ecfb99bcbccfd82d Revert "HDFS-16336. Addendum: De-flake TestRollingUpgrade#testRollback (#3686)" |
| 111 | +Jira not present with version: 3.3.2. Commit: 544dffd179ed756bc163e4899e899a05b93d9234 HDFS-16171. De-flake testDecommissionStatus (#3280) |
| 112 | +Jira not present with version: 3.3.2. Commit: c6914b1cb6e4cab8263cd3ae5cc00bc7a8de25de HDFS-16350. Datanode start time should be set after RPC server starts successfully (#3711) |
| 113 | +Jira not present with version: 3.3.2. Commit: 328d3b84dfda9399021ccd1e3b7afd707e98912d HDFS-16336. Addendum: De-flake TestRollingUpgrade#testRollback (#3686) |
| 114 | +Jira not present with version: 3.3.2. Commit: 3ae8d4ccb911c9ababd871824a2fafbb0272c016 HDFS-16336. De-flake TestRollingUpgrade#testRollback (#3686) |
| 115 | +Jira not present with version: 3.3.2. Commit: 15d3448e25c797b7d0d401afdec54683055d4bb5 HADOOP-17975. Fallback to simple auth does not work for a secondary DistributedFileSystem instance. (#3579) |
| 116 | +Jira not present with version: 3.3.2. Commit: dd50261219de71eaa0a1ad28529953e12dfb92e0 YARN-10991. Fix to ignore the grouping "[]" for resourcesStr in parseResourcesString method (#3592) |
| 117 | +Jira not present with version: 3.3.2. Commit: ef462b21bf03b10361d2f9ea7b47d0f7360e517f HDFS-16332. Handle invalid token exception in sasl handshake (#3677) |
| 118 | +WARN: Jira not found. Commit: b55edde7071419410ea5bea4ce6462b980e48f5b Also update hadoop.version to 3.3.2 |
| 119 | +... |
| 120 | +... |
| 121 | +... |
| 122 | +Found first commit hash after which git history is redundant. commit: fa4915fdbbbec434ab41786cb17b82938a613f16 |
| 123 | +Exiting successfully |
| 124 | +Jira/Git commit message diff completed: ############################################## |
| 125 | +
|
| 126 | +Any resolved Jira with fixVersion 3.3.2 but corresponding commit not present |
| 127 | +Starting diff: ############################################## |
| 128 | +HADOOP-18066 is marked resolved with fixVersion 3.3.2 but no corresponding commit found |
| 129 | +HADOOP-17936 is marked resolved with fixVersion 3.3.2 but no corresponding commit found |
| 130 | +Completed diff: ############################################## |
| 131 | +
|
| 132 | +
|
| 133 | +``` |
| 134 | + |
0 commit comments