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
[NETBEANS-3799] Improve extracting types from PHP annotations #1934
Conversation
@czukowski Thank you for your contribution. We can't merge this soon because currently, the merge window is closing. (We can merge this after NB11.3 is released) @tmysik Should increase the spec version? Maybe, should also add unit tests to |
@junichi11 yes, I'm aware of that, it can wait. |
It depends. Without increasing the spec version, Auto Update will not notice and only new NB release will contain this change - is this what we want? If not, we need to increase the spec version of:
That would be nice. 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.
Please, see my comment in this PR about spec version increase and feel free to comment.
The change itself seems fine to me (personally I do not like the change of the test, it is not a typical "NetBeans way" but I am definitely not against it - if it passes :)
Thank you.
@tmysik I've had my doubts about changing the tests, but it wasn't easy to tell what were the individual tests actually doing (are they testing different things or same thing with different test cases?), so I've found out about the |
@czukowski I don't think it is (easily) doable. As I wrote, it is "just unusual" but no problem. AFAIK, Thank you for your work, once the dependencies are "solved" I am ready to approve this PR. |
@tmysik this is not really correct! This should only be required if the PR is against a release branch as a pushed update fix, and we haven't done that much. For master, the release manager increments every spec version before the merge window reopens. If you put a spec version change in a PR it probably won't merge cleanly. cc/ @ebarboni |
@neilcsmith-net Let me explain - in NetBeans, we used to have daily builds that were used by some of our users (in fact, quite many of them). For these users, no "Update available" would appear without increasing (all) the spec versions of the given modules. These users would need to go to our download page and download the whole, new/fresh NB build again to have this change in their NetBeans. @czukowski Thanks! CC @junichi11 |
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.
Based on the comments in this PR, I guess I can approve this change as it is.
@tmysik Thank you for your answer, Tomas! @czukowski $ find . -name '*.java' | xargs grep "@RunWith" Results
Currently, It seems that it is used only in several files. |
@tmysik that's an interesting point that maybe can be discussed on dev@ AFAIK we haven't had a valid update centre for any daily build since moving to Apache. And ideally the daily build would be on the same task as @ebarboni redone Jenkins pipeline, and potentially could have UC there. This process hasn't changed much as far as I know, except Enough chatter here on this topic, and apologies for the noise 😄 Can follow up on dev@ if need be. |
@junichi11 well, if the code is not very well readable, it kind of calls for action to do something about it, at least in my opinion, so I wouldn't say there was absolutely no reason to touch the tests 😀 Also this is the first time ever I've done anything in Java, while it didn't seem hard (perhaps given the size of the actual change), I was trying to be extra cautious not to break anything and really understand what the code in question does, and I've found myself having to re-examine each test method in order to see whether it does exactly the same thing as the next one, just with another set of inputs or maybe is there a subtle difference in the test logic itself, which I couldn't see at the first glance, and this reading and re-reading the test methods was quite time consuming. I would like to try and make some more contributions, but I would feel uncomfortable writing tests that I myself would have trouble reading later on. |
@czukowski Writing readable code is good. But I am worried that there might be problems at the moment(like |
@junichi11 maybe we should discuss and find a common ground on how the tests should be written in the most optimal way possible, both avoiding the code duplication and ensuring they stay in line and will remain compatible as NetBeans is moving forward. As @tmysik has pointed out, the current test suite implementation is based on an older JUint version, and I've noticed the compiler complaining about some deprecated usage too, so I think the time to deal with it is slowly approaching anyway. |
My opinion is - (always) make the patch simple and readable so it is easy to review (rollback, fix, etc.). This is maybe not the case for the test change in this PR but maybe (a) it is not easily doable and/or (b) it is not a bad thing since the author knows exactly what he is doing :) I don't use JUnit so I am not able to judge (a) and of course I hope for (b) :) |
@czukowski @tmysik |
Ok, so essentially I did it the other way around. But it is in a separate commit, so it should still be easy to review it, right? As for breaking anything, if my change breaks any tests, I assume it is my responsibility to fix it even before asking anybody to review (and if I miss it and ask for review, then I trust you to return this to me to fix, before you actually start reviewing the code). By the way, I can see that Travis is running quit a lot of jobs, I'm guessing I need to watch 'Test php modules' if I'm editing any of those, do you know of any other Travis jobs to keep an eye on? |
@czukowski Separating commit is good, of course. In this case, reviewers have to review at least 2 things at the same time(in the same PR). Source code changes and test code changes. The main changes are not changing test codes but fixing/improving the issue, I suppose. I don't think that we have to change the test codes absolutely if they work fine.
I'm not sure what this means, sorry. If you have a question about the Travis CI, please try asking on the mailing list. I'll approve this PR after you add unit tests to |
@junichi11 I think I could work with separating parts to different PRs in principle, but there is a couple of things bothering me:
Also, having to write tests only to rewrite them later seems like unnecessary work to me :)
Do you mean add tests for methods wherever |
@czukowski Please don't misunderstand. I don't say "don't change tests". (although I prefer the "usual" way at the moment because the "unusual" way is not used in other modules yet (except for several files).) Yes, we can say that for all PRs. (I also thought the same thing before.) Unfortunately, in the current way(PRs are not merged into the master branch until the next release), we just have to wait. So, smaller changes are better to avoid conflicting other changes. I don't think that we need to hurry to change tests. Anyway, let's separate it once if you would like to change it.
Yes, there is the cause in |
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.
Looks good. Thank you.
Apache NetBeans 12.0 merge windows OPEN : https://lists.apache.org/thread.html/r931f122d719f407fbc188a996ed45373f770ee618b80d0531c285210%40%3Cdev.netbeans.apache.org%3E Merging as I assume that you follow the ASL v2. I suggest that you submit icla if possible: https://www.apache.org/licenses/contributor-agreements.html Thanks. |
See Jira for details: https://issues.apache.org/jira/browse/NETBEANS-3799
There were some unused test methods for the class I've modified (and failing if renamed to be included when running tests), according to git history, they were just added and never actually tested:
https://github.com/emilianbold/netbeans-releases/blame/d5e07b7d6c95bf5342eb8bc351e2d09b88d5e0ad/php.api.annotation/test/unit/src/org/netbeans/modules/php/api/annotation/util/AnnotationUtilsTest.java
I've included these test cases to run and modified the expected values so that they don't fail, specifically not to expect
ManyToOne
type.