-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[RFC] Versioning our user facing APIs #8561
Comments
Which specific problem are you trying to solve?
How would we use that to automatically notify a user?
The linked semantic versioning scheme is supposed to be used for implementations ("software", "packages"), not just an API. API only gets two numbers. |
People complaining about RIOT not being stable enough for their purposes / not being clear enough about API changes.
Why would an automatic notification be required? I know of no software platform that does that. This issue is about documenting API changes.
Where do you get this from? The linked document talks a lot about "public API[s]". Are you referring to comments made during that one meeting where we discussed this? If not, please provide a source. Regarding the comments in the meeting: I'm of a different opinion today. The fixes I exemplified for (3) show that bug fixes are also something that exists in the scope of API, though they only might have a far minor impact. Other such "bug fixes" (or let's call them changes that smaller than major or minor) would also be to document previously insufficiently documented return values (e.g. |
Well, for being "clear" about changes, documentation might be enough in order to later tell the unhappy people "look, the change was documented". RIOT's API not being stable is not fixed by versioning the API. Some tool telling users what changes affects their code, and a hint on how to fix, might help. Just asking.
Well, your linux box uses semantic versioning to dynamically link the correct library binaries.
"Bug fixes not affecting the API increment the patch version" -> something that is not the API can be changed -> triple is for software, not the API. Please don't get offended, I'm totally pro API versioning. Just trying to clarify things... |
True, but it makes changes more visible and easier to track: "Oh minor version change, well than I can be relieved, let's see what nice things they added" vs. "Mh major version change, let's see what changed so I can adapt". Hopefully major version steps become a rarer thing once we need to document the changes (developers hate documentation after all ;-)).
Well, the doc demon could also watch for the version tag, and whenever one is added, write a mail to users, generate a blog post at riot-os.org, etc. This might be even sensible to do anyway, so we can keep documentation on older versions of an API at doc.riot-os.org (e.g. http://doc.riot-os.org/group__drivers__netdev__api__v1.1.0.html). But this goes into details that might come to importants after we decided on this issue.
I don't know what this has to do with user notification (which my comment was about). I know however, that semantic versioning is wide spread and well-used, that's why I proposed it ;-).
Maaybee just maaaybe the third component is overkill. However, I'd like to keep it on the table for now.
No offense taken. Sorry for sounding more upset than I actually am ;-). I appreciate the input. |
I'm not so sure about that. These are the includes of a random real-world riot application:
I think almost all of the headers can be considered "user facing". There's no chance in hell that any API change in those headers won't be recognized by the compiler first (should they be incompatible), compared to the user checking the versions of the used modules in doxygen and realizing "oh, major change, I need to adapt". Worse, a documented change in the semantics (increasing maybe even the major version), which doesn't change the actual API header in an incompatible (to the compiler) way, will just stay unnoticed until the application misbehaves. IMO, something automatic nagging the user at compile time, pointing to "how-to-upgrade-your-code" docs, should be an important part of any versioning scheme that we come up with. |
Many I'm not really agreeing with. In particular: #include "gsm.h" // netdev?
#include "gps/serial.h" // saul?
#include "rtc_tim.h" // periph/rtc or POSIX gettimeofday?
#include "mma8x5x.h" // both saul?
#include "mma8x5x_params.h"
#include "jsmn.h" // isn't this external?
I think if we define how to version APIs first we can then talk about how to connect this to module definitions. But some thoughts from a high-level perspective: We could do it like most package management softwares (
|
(just musings of a person often implementing against python |
Does that matter? The point is, there'll be either many versioned API's, or not enough, or just one, (or none, which would be our current state). With "not enough" I would describe a state where maybe the core/ headers and sock are versioned and most other sys/ modules are not, making versioning's use quite limited.
Well, it might help to think about who'll be using / reading the versioning scheme, before agreeing on a way. |
Well, I opened this issue to potentially also discuss which APIs should be versioned. But maybe we should focus on the how first ;-). However, I think there is a sweet spot (or even sweet zone) between overkill and not enough / just one ;-). Tossing ideas around: maybe a user survey could offer some answers here.
Granted. |
My two cents: gcoap and nanocoap. And maybe this is redundant (or overkill), but any API making use of external packages. |
+1 to Semantic Does it make sense to:
The hardest part of 1. would be to agree in a commit message format. From semantic-release:
The rest comes almost our of the box :) |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions. |
Motivation
We discussed @ FU Berlin a while back offline that it might be a good idea to version some of our user facing APIs to make communication of changes in the API more obvious beyond just the RIOT release. And since I smell some major API reworks coming again (#8351, a
sock
rework @kaspar030 was proposing in #8149, ...) I think it is about time to pick this discussion up again.What are user facing APIs
Well... that needs to be discussed... I think that versioning all header files would be overkill. When they are identified they should be collected on a special page in the documentation for any user easy to find (which we should do anyway for new users, regardless of versioning) including their current version. From the top of my head I would include definitively and in no particular order:
core/include/
netdev
saul
xtimer
event
sock
vfs
How to version
Notation
In doxygen there is the
@version
tag which I think we can use. For examplesock
would be versioned insys/include/net/sock.h
Maybe even add the commit hash that changed the API to it as well.
Scheme
As to what scheme to use for versioning, semantic versioning was tossed around by @cladmi, @kYc0o and @aabadie: The version is a triple consisting of 3 numbers
const
, moving from a specific pointer to a genericvoid *
pointer etc.).API deprecation
With this process we could also add a BCP for API deprecation:
@deprecated
tag over@version
tags with a warning that this API will be removed after x releases (let's say 2, unless not all depending mainline features were ported until then).The text was updated successfully, but these errors were encountered: