-
Notifications
You must be signed in to change notification settings - Fork 1.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
Split the classes from the io.strimzi.api.kafka.model package to multiple sub-packages #9207
Conversation
2a91372
to
b8f85ef
Compare
b8f85ef
to
fbb61ce
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.
For lot of the files, the ordering of the imports seems to be complete mess. I wonder if we should use this as an opportunity where we already touch so many files to enforce some import ordering by checkstyle (if that is possible)
api/src/main/java/io/strimzi/api/kafka/model/common/CustomResourceConditions.java
Show resolved
Hide resolved
api/src/main/java/io/strimzi/api/kafka/model/common/CustomResourceConditions.java
Show resolved
Hide resolved
import io.strimzi.api.kafka.model.common.CertSecretSource; | ||
import io.strimzi.api.kafka.model.common.ClientTls; | ||
import io.strimzi.api.kafka.model.common.JvmOptions; | ||
import io.strimzi.api.kafka.model.bridge.KafkaBridge; | ||
import io.strimzi.api.kafka.model.bridge.KafkaBridgeAdminClientSpec; | ||
import io.strimzi.api.kafka.model.bridge.KafkaBridgeConsumerSpec; | ||
import io.strimzi.api.kafka.model.bridge.KafkaBridgeHttpConfig; | ||
import io.strimzi.api.kafka.model.bridge.KafkaBridgeProducerSpec; | ||
import io.strimzi.api.kafka.model.bridge.KafkaBridgeResources; | ||
import io.strimzi.api.kafka.model.bridge.KafkaBridgeSpec; | ||
import io.strimzi.api.kafka.model.common.Rack; | ||
import io.strimzi.api.kafka.model.common.authentication.KafkaClientAuthentication; | ||
import io.strimzi.api.kafka.model.common.template.ContainerTemplate; | ||
import io.strimzi.api.kafka.model.common.template.DeploymentStrategy; | ||
import io.strimzi.api.kafka.model.common.template.DeploymentTemplate; | ||
import io.strimzi.api.kafka.model.common.template.InternalServiceTemplate; | ||
import io.strimzi.api.kafka.model.bridge.KafkaBridgeTemplate; | ||
import io.strimzi.api.kafka.model.common.template.PodDisruptionBudgetTemplate; | ||
import io.strimzi.api.kafka.model.common.template.PodTemplate; | ||
import io.strimzi.api.kafka.model.common.template.ResourceTemplate; | ||
import io.strimzi.api.kafka.model.common.tracing.Tracing; |
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.
Should we have some ordering of the imports? They seem to be mixing up pretty badly.
cluster-operator/src/main/java/io/strimzi/operator/cluster/model/KafkaCluster.java
Show resolved
Hide resolved
c7ee75e
to
840d188
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.
LGTM, 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.
Actually, does not LGTM -> you have to fix the tests. At least some of them are IMHO failing because you have to rename some resources etc.
But the imports and core changes itself look good to me. |
14c0e31
to
7af4f9f
Compare
@scholzj Is there a way to restart these tests? |
@ShubhamRwt I restarted them. |
CHANGELOG.md
Outdated
@@ -43,6 +43,7 @@ | |||
config.providers.env.class: org.apache.kafka.common.config.provider.EnvVarConfigProvider | |||
# ... | |||
``` | |||
* The `api` module was refactored and classes were moved to new packages |
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.
You have to move this to 0.39.0.
/azp run regression |
Azure Pipelines successfully started running 1 pipeline(s). |
f833fb9
to
c719477
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.
I left one question but no need to change ... but my biggest doubt is ...
should we really have io.strimzi.api.kafka.model
and not just io.strimzi.api.model
?
I mean, we have a package like io.strimzi.api.kafka.model.kafka.*
so kafka
is twice in the hierarchy.
@@ -2,7 +2,7 @@ | |||
* Copyright Strimzi authors. | |||
* License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html). | |||
*/ | |||
package io.strimzi.api.kafka.model; | |||
package io.strimzi.api.kafka.model.acl; |
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.
just an idea, doesn't it make more sense having under user
package so ... io.strimzi.api.kafka.model.user.acl
?
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.
Yeah that was what we thought at start. But if you go through this sheet -> https://docs.google.com/document/d/1uZwYGZFo9FIR-95q2PV5Npl6IN1KfWSr12cRp21VMpM/edit, I made this change based on Tom's comment
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.
@ppatierno WDYT about this? Do you want @ShubhamRwt to change or or are you fine with it?
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.
Tbh I didn't get what @tombentley meant with that comment :-)
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.
@tombentley Hi, should we have the acl's under user package?
Update for community call: I was waiting for reviews regarding the new structure so that I can push those changes and rebase this PR together since the merge conflicts keeps happening when other PRs are merged due to dependency import changes |
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.
@ShubhamRwt thanks for this! Sorry for not having taken a look sooner. There are some build conflicts (which are probably my fault for not having reviewed sooner) which will need to be fixed.
We should consider adding to the rules in .checkstyle/import-control.xml
, which currently only really enforces a few things in the operator, not anything in the api
module. For example (these are off the top of my head, so might not actually be correct; treat them as illustrative):
* each of the CRD-specific packages in the model
module is allowed import the common one, but not vice versa.
* the certificate-manager shouldn't be allowed to import any other Strimzi code
api/pom.xml
Outdated
<argument>io.strimzi.api.kafka.model.bridge.KafkaBridge=${project.basedir}${file.separator}..${file.separator}packaging${file.separator}install${file.separator}cluster-operator${file.separator}046-Crd-kafkabridge.yaml</argument> | ||
<argument>io.strimzi.api.kafka.model.connector.KafkaConnector=${project.basedir}${file.separator}..${file.separator}packaging${file.separator}install${file.separator}cluster-operator${file.separator}047-Crd-kafkaconnector.yaml</argument> | ||
<argument>io.strimzi.api.kafka.model.mirrormaker2.KafkaMirrorMaker2=${project.basedir}${file.separator}..${file.separator}packaging${file.separator}install${file.separator}cluster-operator${file.separator}048-Crd-kafkamirrormaker2.yaml</argument> | ||
<argument>io.strimzi.api.kafka.model.balancing.KafkaRebalance=${project.basedir}${file.separator}..${file.separator}packaging${file.separator}install${file.separator}cluster-operator${file.separator}049-Crd-kafkarebalance.yaml</argument> |
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.
This stands out as the only package name that's a gerund. We don't have connecting
, bridging
or mirrormaking
. Perhaps this should be rebalance
instead?
@ShubhamRwt @tombentley Where do we stand on with this PR? |
c719477
to
afd7bdd
Compare
@scholzj @tombentley What do you suggest, should I make |
I would not go for such a major change given this is essentially a part of an public API. |
3b4a460
to
c7667bb
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.
LGTM, thanks @ShubhamRwt
@ShubhamRwt I could have another pass on this but I think you should first resolve all the conflicts. |
Signed-off-by: ShubhamRwt <[email protected]>
Signed-off-by: ShubhamRwt <[email protected]>
Signed-off-by: ShubhamRwt <[email protected]>
Signed-off-by: ShubhamRwt <[email protected]>
c7667bb
to
4a33a94
Compare
@ppatierno Hi, I have rebased it now |
Type of change
Select the type of your PR
Description
This PR fixes #8628. This PR moves moves classes to their corresponding packages. This PR adds import order checkstyle rule which makes sure that the imports are ordered properly
Checklist
Please go through this checklist and make sure all applicable tasks have been done