[ 
https://issues.apache.org/jira/browse/HADOOP-17952?focusedWorklogId=660396&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-660396
 ]

ASF GitHub Bot logged work on HADOOP-17952:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 05/Oct/21 15:30
            Start Date: 05/Oct/21 15:30
    Worklog Time Spent: 10m 
      Work Description: amahussein commented on a change in pull request #3503:
URL: https://github.com/apache/hadoop/pull/3503#discussion_r722353666



##########
File path: hadoop-common-project/hadoop-auth/pom.xml
##########
@@ -248,6 +248,38 @@
           
<excludeFilterFile>${basedir}/dev-support/findbugsExcludeFile.xml</excludeFilterFile>
         </configuration>
       </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-enforcer-plugin</artifactId>
+        <dependencies>
+          <dependency>
+            <groupId>de.skuzzle.enforcer</groupId>
+            <artifactId>restrict-imports-enforcer-rule</artifactId>
+            <version>${restrict-imports.enforcer.version}</version>
+          </dependency>
+        </dependencies>
+        <executions>
+          <execution>
+            <id>banned-illegal-imports</id>
+            <phase>process-sources</phase>
+            <goals>
+              <goal>enforce</goal>
+            </goals>
+            <configuration>
+              <rules>
+                <restrictImports 
implementation="de.skuzzle.enforcer.restrictimports.rule.RestrictImports">
+                  <includeTestCode>true</includeTestCode>
+                  <reason>Use hadoop-common provided VisibleForTesting rather 
than the one provided by Guava</reason>
+                  <bannedImports>
+                    
<bannedImport>org.apache.hadoop.thirdparty.com.google.common.annotations.VisibleForTesting</bannedImport>
+                    
<bannedImport>com.google.common.annotations.VisibleForTesting</bannedImport>
+                  </bannedImports>
+                </restrictImports>
+              </rules>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>

Review comment:
       Is this new maven dependency necessary?
   AFAIK, hadoop repo used CheckStyle to check for packages/classes.
   In `hadoop-build-tools/src/main/resources/checkstyle/checkstyle.xml`, there 
is a list of `IllegalImport` with packages and classes.
   
   I would prefer having a single interface to define IllegalImports. So 
`org.apache.hadoop.thirdparty.com.google.common.annotations.VisibleForTesting` 
can be added to heckstyle.xml

##########
File path: hadoop-common-project/hadoop-common/pom.xml
##########
@@ -651,6 +651,38 @@
           </filesets>
         </configuration>
       </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-enforcer-plugin</artifactId>
+        <dependencies>
+          <dependency>
+            <groupId>de.skuzzle.enforcer</groupId>
+            <artifactId>restrict-imports-enforcer-rule</artifactId>
+            <version>${restrict-imports.enforcer.version}</version>
+          </dependency>
+        </dependencies>
+        <executions>
+          <execution>
+            <id>banned-illegal-imports</id>
+            <phase>process-sources</phase>
+            <goals>
+              <goal>enforce</goal>
+            </goals>
+            <configuration>
+              <rules>
+                <restrictImports 
implementation="de.skuzzle.enforcer.restrictimports.rule.RestrictImports">
+                  <includeTestCode>true</includeTestCode>
+                  <reason>Use hadoop-common provided VisibleForTesting rather 
than the one provided by Guava</reason>
+                  <bannedImports>
+                    
<bannedImport>org.apache.hadoop.thirdparty.com.google.common.annotations.VisibleForTesting</bannedImport>
+                    
<bannedImport>com.google.common.annotations.VisibleForTesting</bannedImport>
+                  </bannedImports>
+                </restrictImports>
+              </rules>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>

Review comment:
       Same as my previous comment. Better to be consistent with other guava 
banned imports.




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 660396)
    Time Spent: 50m  (was: 40m)

> Replace Guava VisibleForTesting by Hadoop's own annotation in 
> hadoop-common-project modules
> -------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-17952
>                 URL: https://issues.apache.org/jira/browse/HADOOP-17952
>             Project: Hadoop Common
>          Issue Type: Sub-task
>            Reporter: Viraj Jasani
>            Assignee: Viraj Jasani
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 50m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

Reply via email to