Skip to content
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

docs: add guidelines for breaking changes #2402

Merged
merged 5 commits into from
Jun 2, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 46 additions & 1 deletion docs/developers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ developing RDFLib code.
* You must supply tests for new code.
* RDFLib uses `Poetry <https://python-poetry.org/docs/master/>`_ for dependency management and packaging.

If you add a new cool feature, consider also adding an example in ``./examples``
If you add a new cool feature, consider also adding an example in ``./examples``.

Pull Requests Guidelines
------------------------
Expand Down Expand Up @@ -71,6 +71,51 @@ the users of this project.
Please note that while we would like all PRs to follow the guidelines given
here, we will not reject a PR just because it does not.

Guidelines for breaking changes
-------------------------------

Breaking changes to RDFLib's public API should be made incrementally, with small
pull requests to the main branch that change as few things as possible.

Breaking changes should be discussed first in an issue before work is started,
as it is possible that the change is not necessary or that there is a better way
to achieve the same goal, in which case the work on the PR would have been
wasted. This will however not be strictly enforced, and no PR will be rejected
solely on the basis that it was not discussed upfront.

RDFLib follows `semantic versioning <https://semver.org/spec/v2.0.0.html>`_ and `trunk-based development
<https://trunkbaseddevelopment.com/>`_, so if any breaking changes were
introduced into the main branch since the last release, then the next release
will be a major release with an incremented major version.

Releases of RDFLib will not as a rule be conditioned on specific features, so
there may be new major releases that contain very few breaking changes, and
there could be no minor or patch releases between two major releases.

Rationale
~~~~~~~~~
RDFLib has been around for more than a decade, and in this time both Python and
RDF have evolved, and RDFLib's API also has to evolve to keep up with these
changes and to make it easier for users to use. This will inevitably require
breaking changes.

There are more or less two ways to introduce breaking changes to RDFLib's public
API:

- Revolutionary: Create a new API from scratch and reimplement it, and when
ready, release a new version of RDFLib with the new API.
- Evolutionary: Incrementally improve the existing API with small changes and
release any breaking changes that were made at regular intervals.

While the revolutionary approach seems appealing, it is also risky and
time-consuming.

The evolutionary approach puts a lot of strain on the users of RDFLib as they
have to adapt to breaking changes more often, but the shortcomings of the RDFLib
public API also put a lot of strain on the users of RDFLib. On the other hand, a
major advantage of the evolutionary approach is that it is simple and achievable
from a maintenance and contributor perspective.

.. _tests:

Tests
Expand Down
10 changes: 10 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,16 @@ API reference:
.. * :ref:`genindex`
.. * :ref:`modindex`

Versioning
----------
RDFLib follows `Semantic Versioning 2.0.0 <https://semver.org/spec/v2.0.0.html>`_, which can be summarized as follows:

Given a version number ``MAJOR.MINOR.PATCH``, increment the:

#. ``MAJOR`` version when you make incompatible API changes
#. ``MINOR`` version when you add functionality in a backwards-compatible
manner
#. ``PATCH`` version when you make backwards-compatible bug fixes

For developers
--------------
Expand Down