-
Couldn't load subscription status.
- Fork 1.4k
Make project friendlier for Eclipse IDE development #11915
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
base: main
Are you sure you want to change the base?
Conversation
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 looks pretty messy to be honest.
Beauty is in the eye of the beholder 🤣 Anything in particular or all of it? |
|
I think it should keep the removed version files where they were for example. |
|
The assembly stuff is IMHO required for the build process. So not wure what sense does it make to disable it. |
|
Splitting this into individual things and doing them one step at a time might also improve the reviewibility quite significantly. |
be05de5 to
b6459ae
Compare
The idea is that it's not really useful when building the project in an IDE. The goal with it is to create archives for distribution, right? Moving to a profile and disabling it means when opening the project you don't need to have those tasks running (assuming the IDE runs them) and prebuilding/installing the project so the dependencies can be copied.
I'll do that. |
Why would an IDE run a package process at startup? That seems wrong. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #11915 +/- ##
============================================
+ Coverage 74.79% 74.81% +0.01%
+ Complexity 6617 6616 -1
============================================
Files 376 376
Lines 25325 25325
Branches 3389 3389
============================================
+ Hits 18943 18946 +3
+ Misses 4996 4994 -2
+ Partials 1386 1385 -1
🚀 New features to boost your workflow:
|
b6459ae to
fedc1c9
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.
@MikeEdgar thanks for this. I think the project should be friendly with other IDEs than IntelliJ. I left a few questions tough trying to understand the meaning of the changes to make it working within Eclipse.
| return TopicOperatorUtil.partitionedByError(reconcilableTopics.stream().map(reconcilableTopic -> { | ||
| if (newTopicsErrors.containsKey(reconcilableTopic)) { | ||
| return new Pair<>(reconcilableTopic, Either.ofLeft(newTopicsErrors.get(reconcilableTopic))); | ||
| return new Pair<>(reconcilableTopic, Either.<TopicOperatorException, TopicState>ofLeft(newTopicsErrors.get(reconcilableTopic))); |
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.
why these changes? Does Eclipse fail the compile without them?
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.
Yes, it seems as though Eclipse JDT is not smart enough to determine the generic type arguments on these. I suspect the same errors would appear in VS Code, which at some point also used JDT.
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.
The problem I have with this is that we can fix them now. Then we'll develop more but not using this syntax and then at some point someone using Eclipse will raise the issue. Is there really nothing that can't be done in Eclipse JDT to avoid this?
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.
It's for sure an issue, but as I understand it the JDT compiler is a different implementation aiming for incremental compilation in the editor so it's always possible for these kind of differences. The generic use in this class is probably on the more complex end of the spectrum, so it may not be that common and it could just be dealt with if they occur again.
There are other occurrences of the type params being set already in this class, so it's not unprecedented. Apparently even javac was stunned by it at some point 😆
strimzi-kafka-operator/topic-operator/src/main/java/io/strimzi/operator/topic/KafkaHandler.java
Lines 193 to 195 in d311680
| LOGGER.traceOp("Admin.listPartitionReassignments({}) failed with {}", apparentDifferentRfPartitions, e); | |
| return apparentlyDifferentRfTopics.stream().map(pair -> | |
| new Pair<>(pair.getKey(), Either.<TopicOperatorException, TopicState>ofLeft(handleAdminException(e)))).toList(); |
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.
FYI, I did find that Intellij can use the Eclipse compiler via Settings > Build, Execution, Deployment > Compiler > Java Compiler.
| <includes> | ||
| <include>kafka-versions.yaml</include> | ||
| </includes> | ||
| </resource> |
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 am struggling to understand why it was removed from here but then having an execution task to copy it, IIUC
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.
Basically, it's due to this bug in Eclipse: eclipse-m2e/m2e-core#1790
Granted, it's Eclipse's bug, but nonetheless an impediment to using that IDE with Strimzi.
|
Job failure seem unrelated: |
fedc1c9 to
8533192
Compare
| return TopicOperatorUtil.partitionedByError(reconcilableTopics.stream().map(reconcilableTopic -> { | ||
| if (newTopicsErrors.containsKey(reconcilableTopic)) { | ||
| return new Pair<>(reconcilableTopic, Either.ofLeft(newTopicsErrors.get(reconcilableTopic))); | ||
| return new Pair<>(reconcilableTopic, Either.<TopicOperatorException, TopicState>ofLeft(newTopicsErrors.get(reconcilableTopic))); |
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.
The problem I have with this is that we can fix them now. Then we'll develop more but not using this syntax and then at some point someone using Eclipse will raise the issue. Is there really nothing that can't be done in Eclipse JDT to avoid this?
|
The goal of this PR should be to make Strimzi more Eclipse-friendly (we should try the same for VS Code as well). I was wondering what are other @strimzi/maintainers opinions on the needed changes here. There could be users who would like to contribute but they are not allowed to use IntelliJ (while mostly all of us can use it). |
I do not have a problem with the goal per se. I think there should be more discussion about what the problems are and what the right solutions are. That will also help us understand the issues Eclipse as, and try to avoid them in the future. But unless someone from the core team uses Eclipses daily, it might be hard to maintain. I also in particular do not like the idea of moving or copying key files around. That does not help transparency or understanding of how things work and make things more complicated for everyone else. I also do not understand the motivation given there never was any previous demand. (Quite frankly, I know some people using VSCode ... but I thought Eclipse users were already extint ;-)) That is important aspect to decide on the trade-offs. |
|
How do we proceed here? As far as discussion of the issues, the ones addressed with this PR are:
It's clear that without core maintainers using a range of development environments, things like this will creep into the project and those affected will need to either work around them locally or propose changes to resolve them. I suppose that's the same as with any piece of code where certain users are affected by edge cases and need to deal with it in some way. |
e5c09ca to
6573c21
Compare
|
I can understand Jakub's concerns but at the same time I think we should discuss more about this (maybe on a community call) because I think it's important having Strimzi working easily with other IDEs like Eclipse and VSCode.
I don't think we should not be strict on what maintainers are using. People can move across companies and can get restrictions on IDEs to use, so what I can use and work today could not be the same tomorrow. Also working with other IDEs allows to increase the contributors space with people not using IntelliJ. For example, I had a dev within IBM using Eclipse and he has been having the same issue. I pointed him to this PR to understand if the fixes proposed by Michael works for him or there is anything to improve. Others I engaged are using VSCode instead. What the other @strimzi/maintainers think about the above discussion? |
Yes, I think that makes sense. I'd also add that I don't think an individual needs to use a particular IDE daily just to check in on bigger changes, etc. to see if one IDE has many new errors or warnings of some kind. Speaking for myself, although I am not doing much development in Strimzi, I do always have it open in Eclipse and track |
- use maven-resources-plugin/copy-resources instead of referencing resources outside of module project directories - provide generic argument type hints in several locations in the topic operator's `TypeHandler` Signed-off-by: Michael Edgar <[email protected]>
6573c21 to
cebe1bc
Compare
Type of change
Description
Project modifications to resolve several errors in Eclipse IDE. This is intended to drive discussion better than an issue without the proposed changes being available.
kafka-versions.yamlandbridge.versionfiles duringprocess-resourcesphase of cluster-operator and systemtests modules. This avoids having the modules reach out into the parent directory for resources.TypeHandler.Checklist
Please go through this checklist and make sure all applicable tasks have been done