adoroszlai opened a new pull request #788: HDDS-3357. Add check for import from 
shaded package
URL: https://github.com/apache/hadoop-ozone/pull/788
 
 
   ## What changes were proposed in this pull request?
   
   Add a checkstyle rule to reject import from shaded packages.  This helps 
avoid accidentally using shaded transitive dependencies instead of direct, 
unshaded dependencies, eg. 
`org.apache.curator.shaded.com.google.common.collect.ImmutableSet` instead of 
`com.google.common.collect.ImmutableSet`.
   
   Also skip frontend install/compile for Recon (as checkstyle only applies to 
Java code) similarly to ac93176a0.
   
   https://issues.apache.org/jira/browse/HDDS-3357
   
   ## How was this patch tested?
   
   Temporarily added an import from a `sun.*` package, verified that it is 
flagged (along with the only current import from shaded package):
   
   ```
   $ hadoop-ozone/dev-support/checks/checkstyle.sh
   ...
   
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/ratis/RatisHelper.java
    21: Illegal import - sun.security.ec.ECKeyFactory.
   
hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestVolumeSetDiskChecks.java
    38: Illegal import - 
org.apache.curator.shaded.com.google.common.collect.ImmutableSet.
   $ echo $?
   1
   ```
   
   Failed check due to import from shaded package:
   https://github.com/adoroszlai/hadoop-ozone/runs/570614153
   
   Successful check after removing offender:
   https://github.com/adoroszlai/hadoop-ozone/runs/570825882

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to