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

New blog post: Documentation Versioning #74

Closed
wants to merge 9 commits into from

Conversation

humitos
Copy link
Member

@humitos humitos commented Jul 23, 2019

This is my first post on Read the Docs' blog.

I tried to achieve what we have talked about Documentation Versioning mentioning what are the most common problems and what's the solution that we are proposing.

Overall, I like the post, but I feel that the solution proposed needs more strength to catch people's attention.

I'm open to suggestion on every single word --or even, rewriting it completely ;)

Rendered version: https://readthedocs-blog--74.org.readthedocs.build/documentation-versioning/

Closes #53

@humitos humitos requested a review from a team July 23, 2019 13:44
Copy link
Member

@ericholscher ericholscher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good post -- we should also update our docs with this content. I think it needs a bit more of a workflow defined. I think GitHub Flow is perhaps a good model to follow here.

We should also define the tense we're writing in. We switch from you to our, and we should keep it in one style. Are we talking about ourselves, or about the user?

documentation-versioning.rst Outdated Show resolved Hide resolved
documentation-versioning.rst Outdated Show resolved Hide resolved
documentation-versioning.rst Outdated Show resolved Hide resolved
documentation-versioning.rst Outdated Show resolved Hide resolved
documentation-versioning.rst Outdated Show resolved Hide resolved
documentation-versioning.rst Outdated Show resolved Hide resolved
documentation-versioning.rst Outdated Show resolved Hide resolved
documentation-versioning.rst Outdated Show resolved Hide resolved
documentation-versioning.rst Outdated Show resolved Hide resolved
* ``1.0.x`` is a release branch for the ``1.0`` version
* ``1.0.3`` is a similar tag for your ``1.0.x`` branch, with the latest release
* ``1.0.0`` is the first tag for your ``1.0.x`` branch.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like we need to expand more on this. This mostly matches what I had here: https://www.ericholscher.com/blog/2016/jul/1/sphinx-and-rtd-for-writers/#recommended-versioning-system -- but what do we do with the tags and old links to 1.0.3 when 1.0.4 is released? I think we need a bit more guidance there.

Copy link
Member Author

@humitos humitos Jul 24, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. I took the inspiration from there and my goal was to expand it and make it better. I failed 🙂

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the key is that if there will be more 1.0.x releases, there should be a release branch and documentation builds off that branch. If you have a typo in the docs or an example in the docs that doesn't work, you just make a new version and the 1.0.x docs get updated.

It also depends on whether there will be multiple concurrent versions. For example, Django is currently supporting 1.11.x, 2.1.x and 2.2.x and there are large differences between these. Users definitely should be looking at the right docs for their version.

If instead, you just want to have a few old versions of the docs around for users using the old stuff then I think tags are mostly fine. However, again if you're following semver you probably don't need docs for 1.0.3 and 1.0.4. I think that's worth mentioning in this post!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you're following semver you probably don't need docs for 1.0.3 and 1.0.4

I mean you have the docs in VCS but you don't need published docs for both when they're basically exactly the same.

@humitos
Copy link
Member Author

humitos commented Jul 24, 2019

I think it needs a bit more of a workflow defined.

I agree. I'm working on trying to make it better.

I think GitHub Flow is perhaps a good model to follow here.

I think that explaining this flow is out of the scope of this blog post. Although, I think it would be good to link this page, which is really nice: https://guides.github.com/introduction/flow/. It doesn't talk about "release branches", though.

@humitos
Copy link
Member Author

humitos commented Jul 24, 2019

You may probably refers to git-flow instead of GitHub Flow ;)

Copy link
Contributor

@davidfischer davidfischer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think rather than saying there's one way to version documentation, we should highlight a few alternatives, discuss their trade-offs, and give example projects using that strategy:

  • The latest/stable + tags strategy - This is appropriate for smaller projects especially when they aren't supporting multiple concurrent releases and they are mostly compatible between versions. This can be combined with having a few documentation versions from tags (you don't need all of them if 1.0.3 and 1.0.4 follow semver for example, but 1.0.0 and 1.1.0 seem good to have). This is probably appropriate if all your releases are tags from the master branch as opposed to the release coming off of another branch. It's a drawback of this strategy that changing documentation after the fact is challenging/impossible/hacky because it would involve rewriting tags.
  • Release branch strategy - This is appropriate for larger projects and definitely where multiple concurrent versions are supported. For example, the Django 1.11.x docs and the 2.2.x docs are very different but both minor versions are actively being supported and there are bugfix releases on them. They call the branches stable/1.11.x and stable/2.2.x respectively. For example, release 2.2.0, 2.2.1, and 2.2.2 all were branched off of stable/2.2.x rather than master. In fact, 1.11.22 was released at the same time as 2.2.3 and contains the same bugfixes.
  • Other strategies? - I'd look at our top 20-30 projects and see what they do. Do they all fit these two strategies? I bet there is a little bit of variation and that could make for something interesting!

documentation-versioning.rst Outdated Show resolved Hide resolved
========================================

Project releases and documentation versions are strongly related each other.
You usually want to have a release ``1.0.3`` with it's own documentation version ``1.0.3`` for that specific release.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Django and Flask don't do this. I'd actually say if you're following semver you probably don't need to document below the minor version level (eg. 1.0.x).

* ``1.0.x`` is a release branch for the ``1.0`` version
* ``1.0.3`` is a similar tag for your ``1.0.x`` branch, with the latest release
* ``1.0.0`` is the first tag for your ``1.0.x`` branch.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the key is that if there will be more 1.0.x releases, there should be a release branch and documentation builds off that branch. If you have a typo in the docs or an example in the docs that doesn't work, you just make a new version and the 1.0.x docs get updated.

It also depends on whether there will be multiple concurrent versions. For example, Django is currently supporting 1.11.x, 2.1.x and 2.2.x and there are large differences between these. Users definitely should be looking at the right docs for their version.

If instead, you just want to have a few old versions of the docs around for users using the old stuff then I think tags are mostly fine. However, again if you're following semver you probably don't need docs for 1.0.3 and 1.0.4. I think that's worth mentioning in this post!

Co-Authored-By: David Fischer <david@readthedocs.org>
@humitos humitos added the PR: work in progress Pull request is not ready for full review label Aug 22, 2019
@humitos
Copy link
Member Author

humitos commented Aug 22, 2019

Marking this as WIP because I want to revisit and re-write some sections after the feedback that I received and the discussion we have.

@humitos
Copy link
Member Author

humitos commented Jun 2, 2020

I revisited this PR twice this month and I'm still stuck thinking what's the recommendation I feel comfortable communicating to the audience. In the end, I found myself wanting version aliases combined with automation rules:

  • tag all the releases following SemVer (x.y.z)
  • always build latest/stable
  • an automated rule will create a version alias x.y (dropping z patch number) for the latest x.y.z tag in that minor y version

That will give me these type of versions, for example:

  • tags in VCS
    • 0.6.2
    • 0.6.3
    • 1.2.0
    • 1.3.0
    • 1.3.1
    • 2.0.0
  • alias on Read the Docs
    • 0.6.x -> points to 0.6.3
    • 1.3.x -> points to 1.3.1
    • 2.0.x -> points to 2.0.0
    • latest -> points to master
    • stable -> points to 2.0.0

(all the versions that are not alias are active=False in my head: 5 are enabled in total for this example)

Instead of putting the effort on the release process, we build a feature around it that makes it automatically for the users.

I really like what @davidfischer said in the last comment. However, I think the size of the project shouldn't be the main difference. I think that even if we are not maintaining 1.3.x anymore, we'd like users to read the latest patch version of that documentation instead of 1.3.0.

I'd look at our top 20-30 projects and see what they do. Do they all fit these two strategies?

  • pip: latest/stable
  • django: release branches (stable/1.11.x) + ask us for custom version alias + latest/stable
  • flask: call the branches exactly 1.1.x, 1.0.x and 0.12.x + master version
  • godot: release branches 3.2, 3.1, 3.0 and 2.1
  • requests: looks unmaintained. However, it looks like a good example of "latest patch version". They have the full SemVer (2.9.1) published, but then they released 2.9.2 and it's not published.
  • scrapy: release branches exactly named as flask does
  • bootstrap-datepicker: publish all full SemVer tags (1.7.1 and 1.7.0)

Summarizing, I'd like to promote two options whenever that would be possible:

  • latest/stable
  • automation rules + version alias

The others are too complicated in my opinion, require a specific branch naming in your VCS, point users to old documentation (fixed patch version tag), etc.

Recommended versioning strategy
-------------------------------

**The workflow we recommend for versioning your documentation is having release branches.**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get that this idea effectively encourages projects to follow Trunk Based Development https://trunkbaseddevelopment.com/ but there are other schemes https://www.toptal.com/software/trunk-based-development-git-flow

I wonder how applicable this is for projects not following Trunk Based Development

@astrojuanlu
Copy link
Contributor

astrojuanlu commented Sep 8, 2021

I'm going to distill some of these ideas in the tutorial readthedocs/readthedocs.org#8473

@astrojuanlu
Copy link
Contributor

(Edit, wrong link)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: work in progress Pull request is not ready for full review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"How to do documentation versioning" blog post
5 participants