Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #14424: Add option to skip validation based on list of annotations #14701

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

@Lmh-java Lmh-java force-pushed the minghao/skip-validation-with-hide-util-class branch from 8c907a3 to f763b2e Compare March 22, 2024 04:01
@Lmh-java
Copy link
Contributor Author

GitHub, generate report

@Lmh-java
Copy link
Contributor Author

GitHub, generate report

@Lmh-java Lmh-java marked this pull request as ready for review March 22, 2024 17:47
@Lmh-java
Copy link
Contributor Author

@nrmancuso @romani Please take a look

@nrmancuso nrmancuso self-assigned this Mar 26, 2024
@nrmancuso
Copy link
Member

Github, generate site

Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

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

only one minor:

Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

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

items:

@nrmancuso nrmancuso assigned romani and unassigned nrmancuso Mar 26, 2024
@Lmh-java Lmh-java force-pushed the minghao/skip-validation-with-hide-util-class branch from f763b2e to dfc82c6 Compare March 26, 2024 18:27
@Lmh-java Lmh-java requested a review from romani March 26, 2024 18:42
@romani
Copy link
Member

romani commented Mar 27, 2024

@Lmh-java, please reply "done" to each review item, to give us clear singnal your arer ready for review and nothing is missed to be addressed. Do not resolve conversations, maintainers will do this as confirmation that is done as expected.

Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

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

last minors:

@Lmh-java Lmh-java force-pushed the minghao/skip-validation-with-hide-util-class branch from dfc82c6 to 80b09ce Compare March 28, 2024 04:46
@Lmh-java Lmh-java requested a review from romani March 28, 2024 06:15
@romani
Copy link
Member

romani commented Mar 28, 2024

@Lmh-java , please reply "done" to each review item, it help a lot.

Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

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

last:

@romani
Copy link
Member

romani commented Mar 28, 2024

GitHub, generate website

Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

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

items:

@Lmh-java
Copy link
Contributor Author

Lmh-java commented Mar 28, 2024

@Lmh-java , please reply "done" to each review item, it help a lot.

@romani Yes, I believe I have replied "done" to each review item after you suggested it from last time. I just want to confirm that I am doing that correctly.

@Lmh-java Lmh-java force-pushed the minghao/skip-validation-with-hide-util-class branch from 80b09ce to c52a701 Compare March 28, 2024 16:20
@Lmh-java Lmh-java requested a review from romani March 28, 2024 18:04
@romani
Copy link
Member

romani commented Mar 28, 2024

Please reply "done" as confirmation that get best practice of PR review

@Lmh-java
Copy link
Contributor Author

Lmh-java commented Mar 28, 2024

Please reply "done" as confirmation that get best practice of PR review

Snipaste_2024-03-28_13-21-53

That's wired, I have always been replying with "done" since you suggested. Can you see them?

Okay, I see. I need to click review changes to submit all comments. I thought pending means my comment is waiting to get reviewed by maintainers. I've always been replying, but forgot to submit the comments. Sorry for taking so long to figure it out.

@romani romani assigned rnveach and unassigned nrmancuso Apr 17, 2024
Copy link
Member

@rnveach rnveach left a comment

Choose a reason for hiding this comment

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

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/f763b2e_2024052758/reports/diff/index.html

This only shows regression. We need a report for the new property as well. Configure it for some annotation. You can use the annotation specified in the issue.

@Lmh-java Lmh-java force-pushed the minghao/skip-validation-with-hide-util-class branch 3 times, most recently from 122dfa9 to 75e5ab1 Compare April 18, 2024 23:45
@Lmh-java
Copy link
Contributor Author

GitHub, generate report

@Lmh-java
Copy link
Contributor Author

Lmh-java commented Apr 19, 2024

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/f763b2e_2024052758/reports/diff/index.html

This only shows regression. We need a report for the new property as well. Configure it for some annotation. You can use the annotation specified in the issue.

@rnveach
The regression report for the new property is here.

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/75e5ab1_2024052933/reports/diff/index.html
All changes are related to the new property added in this PR.

I have to use a different project to test this new feature. I have gone through our default regression project list, but didn't see any valid test case satisfying all the conditions here.

@Lmh-java Lmh-java requested a review from rnveach April 19, 2024 05:33
@rnveach
Copy link
Member

rnveach commented Apr 24, 2024

gone through our default regression project list, but didn't see any valid test case

Report is fine, just that if original regression showed nothing for this change I would still leave the projects in there as proof they don't show anything.

@Lmh-java
Copy link
Contributor Author

GitHub, generate report

@Lmh-java Lmh-java force-pushed the minghao/skip-validation-with-hide-util-class branch from 75e5ab1 to 6bcff74 Compare April 24, 2024 18:22
@Lmh-java
Copy link
Contributor Author

Github, generate site

@Lmh-java
Copy link
Contributor Author

GitHub, generate report

@Lmh-java
Copy link
Contributor Author

@rnveach
The correct regression report is here. https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/6bcff74_2024195534/reports/diff/index.html.

There are no existing projects in the default list with this test case. They are either not having any annotation, or they are already final class, or they contain some non-static method, etc. The only changes is in the one project I configured additionally. Some main classes with SpringBootApplication annotation are ignored.


I think I messed up with the previous regression report. I have had one additional project of local-checkstyle in the project list by mistake.

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/75e5ab1_2024184427/reports/diff/index.html.

I noticed that we are not using local-checkstyle|local| config in the default project list. And if I use that, there will be some random differences.
https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/75e5ab1_2024184427/reports/diff/local-checkstyle/index.html.
If I run locally to compare between these two configs, there are no those difference as shown in the report. Do you have any thoughts on why this happens?

@rnveach
Copy link
Member

rnveach commented Apr 29, 2024

I noticed that we are not using local-checkstyle|local| config in the default project list. And if I use that, there will be some random differences.
If I run locally to compare between these two configs, there are no those difference as shown in the report.
local-checkstyle|local|../../../|master

It depends on where this local is coming from and if anything else is using it. If this is the same git repository provided to regression as the basis for checkstyle, then you have to know that part of the work regression does to do its magic is to switch branches in that git repository. It has to switch between master and the PR to install both versions of checkstyle in order to run them. That switching may cause issues with you defining it as a property to test on as it is only expecting to stay in master and not move around.

This is an issue to be able to set up a way to do regression on the changes in the PR itself.

Copy link
Member

@rnveach rnveach left a comment

Choose a reason for hiding this comment

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

Last things on documentation.

<module name="TreeWalker">
<module name="HideUtilityClassConstructor">
<property name="ignoreAnnotatedBy"
value="SpringBootApplication, java.lang.Deprecated" />
Copy link
Member

Choose a reason for hiding this comment

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

Annotation names provided in this property must exactly match the annotation names on the classes. If the target class has annotations specified with their fully qualified names (including package), the annotations in this property should also be specified with their fully qualified names. Similarly, if the target class has annotations specified with their simple names, this property should contain the annotations with the same simple names.

Show some of these issues in your example.

I assume Deprecated by itself won't work. Show that and put a comment to that effect.

Copy link
Member

Choose a reason for hiding this comment

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

Can you also provide me where we said we would be so strict?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I assume Deprecated by itself won't work.

Only Deprecated will not work if it doesn't match the annotation used.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can you also provide me where we said we would be so strict?

We mentioned this at #14424 (comment). We agreed to do exact match first as #14553. We might do pattern matching later, but they need to solve the problem of #5434 first.

Copy link
Member

@romani romani May 3, 2024

Choose a reason for hiding this comment

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

yes, I am fine to be strict for first step, we can improve later if sombody start to complain.
We just need to document this.

<td>Ignore classes annotated with the specified annotation(s). Annotation names provided in this property must exactly match the annotation names on the classes. If the target class has annotations specified with their fully qualified names (including package), the annotations in this property should also be specified with their fully qualified names. Similarly, if the target class has annotations specified with their simple names, this property should contain the annotations with the same simple names.</td>
<td><a href="../../property_types.html#String.5B.5D">String[]</a></td>
<td><code>{}</code></td>
<td>10.16.0</td>
Copy link
Member

Choose a reason for hiding this comment

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

Version needs updated.

Copy link
Member

Choose a reason for hiding this comment

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

should be 10.17.0

@romani
Copy link
Member

romani commented May 11, 2024

@Lmh-java , please help us to finish this PR, we are so close to merge state.
looks like only version should be changed.

@romani romani reopened this May 11, 2024
@Lmh-java Lmh-java force-pushed the minghao/skip-validation-with-hide-util-class branch from 6bcff74 to 4218a94 Compare May 12, 2024 16:09
@Lmh-java Lmh-java force-pushed the minghao/skip-validation-with-hide-util-class branch from 4218a94 to 70bd1b7 Compare May 12, 2024 16:13
@Lmh-java
Copy link
Contributor Author

@Lmh-java , please help us to finish this PR, we are so close to merge state.
looks like only version should be changed.

Sorry, I was quite occupied with other stuffs.

I have updated a new example for #14701 (comment) and updated the version.

@Lmh-java
Copy link
Contributor Author

GitHub, generate site

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants