-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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-31806] Fix public API rule for connectors #22667
[FLINK-31806] Fix public API rule for connectors #22667
Conversation
Tested it on Cassandra connector and it reports these violations:
|
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.
So why didn't the previous version work? Is resideOutsideOfPackages
just a filter that works on a previously provided set of classes, and since we didn't specify anything like resideInAPackage
it filtered on an empty set?
I'd start a separate discussion on these. we likely want to make Preconditions/VisibleForTesting public. |
Anyway, for now we'll add exclusions and handle this in a follow-up. |
No, it did not work because the rule was conceptually wrong: see the review comment I have put on line 50 |
ok so, in the meantime, we should add them to the frozen violations, right ?
Yes I was about to open a dedicated Cassandra ticket for
+1 on the goal, maybe in the meantime, similarly add this exception to frozen exceptions |
|
f8327ef
to
124c40b
Compare
I don't see any comment; did you submit the review? |
...cture-tests-production/src/main/java/org/apache/flink/architecture/rules/ConnectorRules.java
Show resolved
Hide resolved
.and(not(modifier(PUBLIC)))) | ||
private static DescribedPredicate<JavaClass> | ||
areFlinkClassesThatResideOutsideOfConnectorPackagesAndAreNotPublic() { | ||
return JavaClass.Predicates.resideInAPackage("org.apache.flink..") |
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.
Added flink packages filter otherwise all classes (JDK, deps ...) could match the rule
My bad, forgot to submit the review. I thought it was automatic, this PR being my own code |
I don't get how the centralized flink-architecture-tests-production work. The azure CI complains about |
7e54120
to
124c40b
Compare
I had to recreate the violation store, just updating it did not work |
Addressed in Cassandra here: apache/flink-connector-cassandra#17 |
@flinkbot run azure |
relaunching CI because E2E preparation script failed |
@flinkbot run azure |
@flinkbot run azure |
@@ -0,0 +1,1486 @@ | |||
Class <org.apache.flink.connector.datagen.table.DataGenVisitorBase$TimeGenerator> implements interface <org.apache.flink.streaming.api.functions.source.datagen.DataGenerator> in (DataGenVisitorBase.java:0) |
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.
good god...this is gonna be fine to go through...
Rebasing the PR should resolve the e2e CI issue. |
...cture-tests-production/src/main/java/org/apache/flink/architecture/rules/ConnectorRules.java
Outdated
Show resolved
Hide resolved
7a43e59
to
694db68
Compare
|
694db68
to
ca743b3
Compare
...flink-architecture-tests-production/archunit-violations/e5126cae-f3fe-48aa-b6fb-60ae6cc3fcd5
Show resolved
Hide resolved
ca743b3
to
7d299be
Compare
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.
Since each of these modifies the rules I'd assume each of these individually would also have to update the store.
So it's either that or squash them all together.
(again, key rule is that each merged commit should individually pass on CI; if they'd already pass go ahead)
[FLINK-31806] Fix public API rule for connectors
[FLINK-31806] Add a rule to test non-public enclosing classes
[FLINK-31806] Reverse rule to positive asumption and update violation…
This is what I though but as you mentioned only the 2 commits below, I merged only these ones:
That being said, having all commits pass the CI makes total sense. As the first rule was missing the enclosed class case, the second rule was missing a sub-case, there is no point in keeping these commits, I'll squash them. |
7d299be
to
d27c40d
Compare
No description provided.