-
Notifications
You must be signed in to change notification settings - Fork 368
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
Add revapi maven plugin to build system to check API. #1168
Conversation
Once archive is built, you can change the configuration and only launch : |
Maybe that is a general idea, but here, that doesn't make sense for me. |
Ok I get you point. I understand that you think that nobody will use this field and so you can change it freely. (I'm not sure I agree but anyway I get it) That's generally why a project begin by putting a lot of thing in "internal" package and move it bit by bit in the public API if needed.
Without that convention, you can only bet on "good sense" which is very subjective and brings confusion. Without tooling I pretty sure we will also break "real API" accidentally. In this particular case, if we want to support semantic versioning this would be easy : |
FMPOV that "programming language based check" is in the current state of californium source the wrong approach! I don't see the real benefit. It just nails down code without real reason. To use such a tool, I would prefer to use then a maintained list of exclusions (as above). |
Do you plan to invest your time in a API cleanup as base for 3.0? |
I don't get it. Could you reword ?
You mean :
I really don't like the 2., because as explained this means that users are not able to clearly now what is API or not.
I can try to find time to work on this but I will probably need your help to know what is part of the API.
For me :
I'm open to all this ways, but saying that "we do semantic versioning without claiming clearly what is API" disturbs to me a lot. |
That means: according the programming language, changing something "protected" to "final" maybe considered to be a breaking API change. Considering the "domain", it maybe more a bugfix. Same would apply to change
That's the hard part and it will be time consuming. And I have my strong doubts about the benefits. I still think, use the tool, but with explicit list all breaks and document, why it's considered that these breaks are internal. If someone has a use-case to consider it as public, then we may even change such stuff again. That procedure will not "block the development ahead" for the API cleanup. |
So we strongly disagree about how to handle versioning... 😿
I don't test the json way, I just play with the xml way to exclude package or class.
I'm not sure to understand but "the non breaking way to fix this API inconsistency" is to make the class OidEntityDefinition to public.
I can not understand how this could be a bug fix ? I agree that this could be a kind of "API bug" and so I can not see the urgency to fix it in a minor version. If it exists case where there is a real conflict between fixing a real impacting bug and breaking the API of course we could discuss if this is worth to increment the major or not (and maybe do an exception) My guess is this is really rare. |
FMPOV, that will result in arguments based on the programming language. |
Then any "cleanup" like this will be postponed. |
Yes and why this is such a problem ? again if you don't want to postponed just increment the major. |
Sorry, for me that is just useless boiler plate! |
Yes, an API is a programming language contract between user and developer. (This very long discussion is a good example) |
This is not how a contract works ... Why this seems to you such a big issue to just keep this field public (and optionally deprecated) ? I don't get why this could be a such big issue to do that. @sophokles73 please help us !!! 😫 we are going in circles ... |
Here are my two cents We are using semantic versioning. In particular this means that a developer building an application based on Cf 2.0.0's public API should be able to replace Cf 2.0.0 artifacts with 2.x artifacts without being required to change any of his application code. To me, the only question remaining in this context is: which of Cf 2.0.0's packages and classes do we consider public API. I agree with @boaks in that we should make this assessment/decision based on practical requirements and use cases or usage scenarios instead of merely based on the name of the package. I do agree with @sbernard31 in that in the next major release we should start reflecting the fact whether a class is public API or not also in the name of the package that it belongs to, e.g. introducing package names that end in Using a maven plugin to detect breaking of public API makes a lot of sense to me as it is hard to keep track of transitive dependencies. FMPOV it will be a matter of configuring the plugin appropriately based on our assessment of which classes constitute the public API. In any case, I guess we will not get around making that assessment first so that we can decide how to proceed with any of the warnings issued so far. |
I think a good question is : Should we release a 2.1 ? what is the benefits of that ? |
It does for 3.0.0. But what about 3.1.0?
I guess that depends on the content of 2.1. For a service release, i.e. 2.0.1, the benefit is that users can take advantage of fixes without be required to change their code. |
Maybe, I'm wrong but I understand that every body(3 of us) pretty much agree that for the 3.0 we should separate clearly public and internal API using package naming + tooling ?
If we decide that a 2.1 would be great, the idea would be to create a 3.0 with the objective in mind to limit/avoid the break with "our unclear 2.0 public API". So strictly a 3.0 but for most users a smooth upgrade. The 3.0 will not be a guarantee but a pragmatic best effort, then we will provide real guarantee with next release cycle thanks to revapi. |
Not because of revapi but because we then (hopefully) have defined which is public API and which is not ;-) |
Sounds good. Let me know if I can help. However, I have to admit that my Cf knowledge and the purpose of all its classes has become a little rusty over the years ;-) |
@sbernard31, about 3.0 instead of 2.1: I simply don't consider you're findings so far (mainly by the strict technical analysis) as issues. |
You find at least me. 😅 How many people do you need ? 😁
I think this is a kind of a caricature 😞. The supposedly pragmatic way about breaking because surely nobody use it, then hoping that people will open a ticket, then fix it and so maybe generating a new break @boaks, I believed that what is most important for you :
I do my best to try to find a solution which would satisfy that unless the number of the version...and it sounds not enough... 😢 |
I agree with that.
I assume you meant
And I also agree with that. FMPOV there is no way around establishing a base line of what we (currently) consider public API as that will determine, if we need to create a 3.0.0 for a breaking change or if we can include it in a 2.1.0 ... |
I get your point but my position is : |
FMPOV, it's more about the use-cases, then about the number of people. |
FYI: Don't hesitate to fix it and enable it again, if that pays off for you. |
The idea is to add tooling to check API break using revapi.
For now I only push this modification in master (2.1?) branch.
If we agree about using this tool, we should also include this in the future 2.0.x branch.
revapi will fail the build if API break is detected.
I configure it to :
demo-apps
projects.About the last point, I think this is not good practice and we should fix this
Non-Public Part of API
instead. Here 1 example :I also add some commented samples about classes or packages filtering but I still think that the right way is to defined a package naming convention. This will make the configuration simpler and will allow us to have a simple claim about what is API or not.
If you cherry pick this commit on Check key usage and adapt certificate validation commit, you should see something like this :
(At first sight, all this breaks seems easy to avoid)