mirror of
https://github.com/semver/semver.git
synced 2026-07-10 19:50:47 -05:00
[GH-ISSUE #132] Missing: Major version MUST be incremented if the system behaviour changes in a backwards incompatible manner #2800
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @FrVaBe on GitHub (Jul 4, 2013).
Original GitHub issue: https://github.com/semver/semver/issues/132
If (public) API is ment as the way the system interacts with other components then the major number MUST also be incremented if the system behaviour changes in an backwards incompatible manner - even without API changes.
E.g. if the system offers a
saveAPI method which behaves like anupdateoperation so far but than changes to be ancreate or updateoperation.@FrVaBe commented on GitHub (Jul 4, 2013):
I am not quite sure about the meaning of term API here. After reading the document again it seems that it is not only meant as the way how to intercat with a system but also about the functionality that is expected. In this case changing the functionality - even without changing the way how to interact - is of course an API change so the issue could be closed. Would be nice if someone would do some clarification for me ;-)
@EddieGarmon commented on GitHub (Jul 18, 2013):
I think the understanding of what
Public APIis probably needs a FAQ entry. Generally for specifications, like SemVer, the behavior specified is the Public API. When you are talking about code, the types and methods you expose for consumption by others is the Public API.If you look at SemVer, the spec, the behavior is the API, and yes it follows its own rules.
In your example, you have a Code API. Behavior of a Code API is an implementation detail. The behavior of calling that API should be projected in the names of its members. I also do not see your example as a backwards incompatible change, since you are adding behavior. Personally I believe that naming methods correctly as to their intent helps eliminate these issues, and I would push back on a behavior change like this without changing the Code API, suggesting names like Create, Update, and CreateOrUpdate.
Again, if your
savemethods behavior went fromcreate or updateto onlyupdate, I would also assume that acreatemethod was introduced, which would be reflected in a change to the Public API.@mbaltaks commented on GitHub (Jul 24, 2013):
If you include the documentation of the API calls as part of the API, and more importantly the automated black box test cases also as part of the API, it might help decide how to handle this situation.
When the behaviour of a call changes, such as the
savebehaviour changing fromupdateonly tocreate and/or update, this would have to be followed by a change to the documentation, because the behaviour has now changed, even though the call signature has not changed. Also, the test cases that show how the original call failed whensavewas called on a non existent item will no longer pass, and so they need updating as well. Since the black box test cases for the original API no longer all pass, I'd call that an incompatible API change. That's just my opinion.@FrVaBe commented on GitHub (Jul 24, 2013):
In the meantime I also think that
public APIincludes the system behaviour in this document and not only the exposed programming interface. Thus I will close the issue. A FAQ entry about this would nevertheless be nice. Thanks everybody for clarification