Skip to content

PHOENIX-6309 : Use maven enforcer plugin to ban imports from illegal packages (as per project guidelines) - #1082

Closed
virajjasani wants to merge 1 commit into
apache:masterfrom
virajjasani:PHOENIX-6309-master
Closed

PHOENIX-6309 : Use maven enforcer plugin to ban imports from illegal packages (as per project guidelines)#1082
virajjasani wants to merge 1 commit into
apache:masterfrom
virajjasani:PHOENIX-6309-master

Conversation

@virajjasani

Copy link
Copy Markdown
Contributor

No description provided.

@stoty

Copy link
Copy Markdown
Contributor

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec1m 5sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo case conflicting files found.
+1 💚@author0m 0sThe patch does not contain any @author tags.
-1 ❌test4tests0m 0sThe patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ master Compile Tests _
+1 💚mvninstall15m 42smaster passed
+1 💚compile1m 32smaster passed
+1 💚javadoc1m 17smaster passed
_ Patch Compile Tests _
+1 💚mvninstall9m 28sthe patch passed
+1 💚compile1m 32sthe patch passed
+1 💚javac1m 32sthe patch passed
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚xml0m 2sThe patch has no ill-formed XML file.
+1 💚javadoc1m 18sthe patch passed
_ Other Tests _
-1 ❌unit177m 54sroot in the patch failed.
+1 💚asflicense0m 27sThe patch does not generate ASF License warnings.
212m 35s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1082/2/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#1082
Optional Testsdupname asflicense javac javadoc unit xml compile
unameLinux 381bf3490809 4.15.0-126-generic #129-Ubuntu SMP Mon Nov 23 18:53:38 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev/phoenix-personality.sh
git revisionmaster / fe0b3ca
Default JavaPrivate Build-1.8.0_242-8u242-b08-0ubuntu3~16.04-b08
unithttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1082/2/artifact/yetus-general-check/output/patch-unit-root.txt
Test Resultshttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1082/2/testReport/
Max. process+thread count5755 (vs. ulimit of 30000)
modulesC: . U: .
Console outputhttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1082/2/console
versionsgit=2.7.4 maven=3.3.9
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@yanxinyi

Copy link
Copy Markdown
Contributor

LGTM +1 for the master branch. However, do we have a plan to do the same thing for the 4.x? I remember that we don't have enforcement for certain important. For example, we have import com.google.common.collect.ImmutableMap; and import org.apache.phoenix.thirdparty.com.google.common.collect.ImmutableMap;. Do we have a plan to clean the code and do the same thing at the 4.x branch?

@virajjasani

virajjasani commented Jan 11, 2021

Copy link
Copy Markdown
ContributorAuthor

Thanks @yanxinyi for the review.

Do we have a plan to clean the code and do the same thing at the 4.x branch?

@stoty has already created PHOENIX-6234 for replacing guava with thirdparty in 4.x.
Until then, the only enforcement we can see is to restrict old logging framework: #1083

@stoty

Copy link
Copy Markdown
Contributor

On master, this is somewhat redundant, as dependency-check will fail the build in these cases.
That was never backported to 4.x (but eventually should be)

However, as dependency-check runs AFTER the tests, and the tests still fail more oftent than not, this may be useful if this runs before the tests, (and on 4.x.)

The commons-logging and commons-lang stuff definitely applies to 4.x

@virajjasani

Copy link
Copy Markdown
ContributorAuthor

this may be useful if this runs before the tests, (and on 4.x.)

Yes, it does catch this before running tests.

@stoty

Copy link
Copy Markdown
Contributor

Does 4.x still have commons-lang ? That is probably a regression, and you may want to fix it in #1083 and add the rule.

@virajjasani

Copy link
Copy Markdown
ContributorAuthor

4.x has many references to commons-lang. Let me fix them and update #1083 quickly.

@stoty

stoty commented Jan 11, 2021

Copy link
Copy Markdown
Contributor

In that it probably not a regression, I just never got around to backporting that cleanup to 4.x

I'll leave it to your discretion wheter you want to that for this ticket.

@virajjasani

virajjasani commented Jan 11, 2021

Copy link
Copy Markdown
ContributorAuthor

Alright, Thanks @stoty@yanxinyi . Better not change it for now in 4.x as it is this way for quite some time (more than 2 yr).
We can revisit this after 4.16 release. Sounds good?

@virajjasani

Copy link
Copy Markdown
ContributorAuthor

On master, commons-lang was upgraded as part of PHOENIX-4880

@stoty

Copy link
Copy Markdown
Contributor

Sounds good. (good to know it wasn't me who skipped the 4.x backport)

@stotystoty left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The latest version for the rule seems to be 1.0.1
Is there any reason to use an older version?

@virajjasani

Copy link
Copy Markdown
ContributorAuthor

My bad, in fact we can use 1.1.0 instead.

@virajjasani

Copy link
Copy Markdown
ContributorAuthor

While copying from other project, I somehow missed looking at latest versions. Let me update PR.

@virajjasani

Copy link
Copy Markdown
ContributorAuthor

Attaching sample build failure:

[WARNING] Rule 2: de.skuzzle.enforcer.restrictimports.rule.RestrictImports failed with message:
Banned imports detected in TEST code:
Reason: Use commons lang 3
in file: org/apache/phoenix/end2end/AlterTableWithViewsIT.java
org.apache.commons.lang.StringUtils (Line: 41, Matched by: org.apache.commons.lang.**)
Analysis took 0 seconds
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] [INFO] Apache Phoenix 5.1.0-SNAPSHOT ...................... SUCCESS [ 1.701 s]
[INFO] Phoenix Hbase 2.4.0 compatibility .................. SUCCESS [ 3.718 s]
[INFO] Phoenix Hbase 2.3.0 compatibility .................. SUCCESS [ 0.946 s]
[INFO] Phoenix Hbase 2.2.1 compatibility .................. SUCCESS [ 0.893 s]
[INFO] Phoenix Hbase 2.1.6 compatibility .................. SUCCESS [ 0.620 s]
[INFO] Phoenix Core ....................................... FAILURE [ 3.595 s]
[INFO] Phoenix - Pherf .................................... SKIPPED
[INFO] Phoenix Client Parent .............................. SKIPPED
[INFO] Phoenix Client ..................................... SKIPPED
[INFO] Phoenix Server ..................................... SKIPPED
[INFO] Phoenix - Tracing Web Application .................. SKIPPED
[INFO] Phoenix Assembly ................................... SKIPPED
[INFO] phoenix-tools ...................................... SKIPPED
[INFO] Phoenix Client Embedded 5.1.0-SNAPSHOT ............. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12.127 s
[INFO] Finished at: 2021-01-11T12:57:06+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M3:enforce (banned-illegal-imports) on project phoenix-core: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed. -> [Help 1]
[ERROR] 

@stotystoty closed this Jan 11, 2021
@stoty

Copy link
Copy Markdown
Contributor

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec1m 9sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 1sNo case conflicting files found.
+1 💚@author0m 0sThe patch does not contain any @author tags.
-1 ❌test4tests0m 0sThe patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ master Compile Tests _
+1 💚mvninstall16m 7smaster passed
+1 💚compile1m 31smaster passed
+1 💚javadoc1m 17smaster passed
_ Patch Compile Tests _
+1 💚mvninstall9m 17sthe patch passed
+1 💚compile1m 36sthe patch passed
+1 💚javac1m 36sthe patch passed
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚xml0m 1sThe patch has no ill-formed XML file.
+1 💚javadoc1m 20sthe patch passed
_ Other Tests _
-1 ❌unit269m 1sroot in the patch failed.
+1 💚asflicense0m 30sThe patch does not generate ASF License warnings.
304m 9s
ReasonTests
Failed junit testsphoenix.end2end.index.GlobalMutableNonTxIndexIT
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1082/3/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#1082
Optional Testsdupname asflicense javac javadoc unit xml compile
unameLinux fd5ecc1bcde0 4.15.0-126-generic #129-Ubuntu SMP Mon Nov 23 18:53:38 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev/phoenix-personality.sh
git revisionmaster / fe0b3ca
Default JavaPrivate Build-1.8.0_242-8u242-b08-0ubuntu3~16.04-b08
unithttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1082/3/artifact/yetus-general-check/output/patch-unit-root.txt
Test Resultshttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1082/3/testReport/
Max. process+thread count5740 (vs. ulimit of 30000)
modulesC: . U: .
Console outputhttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1082/3/console
versionsgit=2.7.4 maven=3.3.9
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@virajjasani
virajjasani deleted the PHOENIX-6309-master branch January 11, 2021 14:45
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@virajjasani@stoty@yanxinyi