-
Notifications
You must be signed in to change notification settings - Fork 156
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
[FLINK-36009] Architecture tests fixes #140
base: main
Are you sure you want to change the base?
Conversation
eskabetxe
commented
Aug 28, 2024
•
edited
Loading
edited
- Created the package "org.apache.flink.connector.jdbc.core.util" to have classes of flink that are Internal and fails on architecture (could be discussed)
- Precondition for Preconditions
- VisibleForTest for VisibleForTesting
- Other under evaluation, we still have 91 offends on "Connector production code must depend only on public API when outside of connector packages"
@RocMarshal @1996fanrui can you check when have time |
@Documented | ||
@Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD, ElementType.CONSTRUCTOR}) | ||
@PublicEvolving | ||
public @interface VisibleForTest {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious why it is necessary to create this new class?
I looked at the VisibleForTesting class in Flink and found that it is also annotated as Internal
.
Is the reason for introducing this class the same as the purpose of Preconditions
?
If so, if we decide to use this approach, we need to modify the relevant configuration items in checkstyle.xml
and add the likely comments like the new Preconditions
to clarify why need it.
Alternatively, can we initiate a discussion to change the annotations of these classes (VisibleForTesting and Preconditions) in the Flink package to non-internal
? (I think there’s probably missed some context in historical discussion about the annotations for related classes from my side. pls correct me if I'm wrong. )
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are duplicating the class because in Flink is annotated with internal and architecture tests fail because of that.. we cannot use any class annotated with internal (this is the same reason for Preconditions and we could have more classes with this problem)
I could revert this changes to allow the discussion, I also think that change on Flink class both classes to non-internal would be great.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx for the comment.
Maybe there’s no rush to modify anything before we reaching a conclusion.
I'm not familiar with the entire testing framework and the use of annotations in Flink, so I couldn't make useful ideas.
If we decide to change the relevant annotations and utility classes to non-internal
, we should confirm what impact this will have on the main Flink repository. If the impact is minimal, maybe we can initiate a discussion.
Hi, @MartijnVisser could you help give some ideas about it? Many thanks~ :)
* Preconditions is an Internal class of Flink. | ||
*/ | ||
@PublicEvolving | ||
public class Precondition { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we ultimately keep this class, what problems might arise from using the class name Preconditions?
What I mean is that since the comment mentions this is a code copy, perhaps we can just use the package name to differentiate it and keep the original class-name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
None, I simple give another name to be more easy to find the right class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, @eskabetxe thx for the pr.
LGTM on the whole.
I left a few of comments. PTAL if you had the free time.
@RocMarshal thanks for your review.. I think I could change this to 2 PRs... one with the new architecture module and another with changes to fix the "Connector production code must depend only on public API when outside of connector packages" |
good idea. Make sense to me~ |
Created another PR only with new module for architecture change here |