You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "adoroszlai (via GitHub)" <gi...@apache.org> on 2023/12/10 13:54:37 UTC

[PR] HDDS-9885. Checkstyle check passing despite config error [ozone]

adoroszlai opened a new pull request, #5755:
URL: https://github.com/apache/ozone/pull/5755

   ## What changes were proposed in this pull request?
   
   _basic (checkstyle)_ is shown as passing if it fails with config error, not a checkstyle violation.
   
   https://issues.apache.org/jira/browse/HDDS-9885
   
   ## How was this patch tested?
   
   Verified that the check fails with https://github.com/apache/ozone/pull/921/commits/9b16de3fc1524cc263c5a14576559bec2722e7dd checked out (which had the config error):
   
   ```
   $ hadoop-ozone/dev-support/checks/checkstyle.sh > /dev/null
   
   $ hadoop-ozone/dev-support/checks/_summary.sh target/checkstyle/summary.txt
   13:58:11,624 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:3.1.2:check (default-cli) on project ozone-main: Failed during checkstyle configuration: cannot initialize module TreeWalker - TreeWalker is not allowed as a parent of LineLength Please review 'Parent Module' section for this Check in web documentation if Check is standard. -> [Help 1]
   
   $ echo $?
   1
   ```
   
   Verified the check still fails if there is checkstyle violation:
   
   ```
   $ hadoop-ozone/dev-support/checks/checkstyle.sh > /dev/null
   
   $ hadoop-ozone/dev-support/checks/_summary.sh target/checkstyle/summary.txt
   hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/OzoneConsts.java
    91: Line is longer than 80 characters (found 82).
    92: Line is longer than 80 characters (found 81).
   
   $ echo $?
   1
   ```
   
   Verified the check still passes with code conforming to checkstyle rules:
   
   ```
   $ hadoop-ozone/dev-support/checks/checkstyle.sh > /dev/null
   
   $ hadoop-ozone/dev-support/checks/_summary.sh target/checkstyle/summary.txt
   
   $ echo $?
   0
   ```
   
   CI:
   https://github.com/adoroszlai/ozone/actions/runs/7158011023/job/19489560474


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-9885. Checkstyle check passing despite config error [ozone]

Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on PR #5755:
URL: https://github.com/apache/ozone/pull/5755#issuecomment-1863998832

   Thanks @kerneltime for reviewing and merging this.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-9885. Checkstyle check passing despite config error [ozone]

Posted by "kerneltime (via GitHub)" <gi...@apache.org>.
kerneltime commented on code in PR #5755:
URL: https://github.com/apache/ozone/pull/5755#discussion_r1423151793


##########
hadoop-ozone/dev-support/checks/checkstyle.sh:
##########
@@ -30,13 +30,14 @@ declare -i rc
 mvn ${MAVEN_OPTIONS} checkstyle:check > "${REPORT_DIR}/output.log"
 rc=$?
 if [[ ${rc} -ne 0 ]]; then
-  mvn ${MAVEN_OPTIONS} clean test-compile checkstyle:check
+  mvn ${MAVEN_OPTIONS} clean test-compile checkstyle:check > output.log
   rc=$?
   mkdir -p "$REPORT_DIR" # removed by mvn clean
-else
-  cat "${REPORT_DIR}/output.log"
+  mv output.log "${REPORT_DIR}"/
 fi
 
+cat "${REPORT_DIR}/output.log"

Review Comment:
   why not inside the `if` condition?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-9885. Checkstyle check passing despite config error [ozone]

Posted by "kerneltime (via GitHub)" <gi...@apache.org>.
kerneltime merged PR #5755:
URL: https://github.com/apache/ozone/pull/5755


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-9885. Checkstyle check passing despite config error [ozone]

Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on code in PR #5755:
URL: https://github.com/apache/ozone/pull/5755#discussion_r1423598265


##########
hadoop-ozone/dev-support/checks/checkstyle.sh:
##########
@@ -30,13 +30,14 @@ declare -i rc
 mvn ${MAVEN_OPTIONS} checkstyle:check > "${REPORT_DIR}/output.log"
 rc=$?
 if [[ ${rc} -ne 0 ]]; then
-  mvn ${MAVEN_OPTIONS} clean test-compile checkstyle:check
+  mvn ${MAVEN_OPTIONS} clean test-compile checkstyle:check > output.log
   rc=$?
   mkdir -p "$REPORT_DIR" # removed by mvn clean
-else
-  cat "${REPORT_DIR}/output.log"
+  mv output.log "${REPORT_DIR}"/
 fi
 
+cat "${REPORT_DIR}/output.log"

Review Comment:
   Previously it was in the `else` branch, not the `if` (as only the first `mvn` execution was redirected to `output.log`).  With this change, both executions are redirected, so we'd need to `cat` in both `if` and `else`.  Which can be simplified by moving this common step after the `if`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org