You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

This section gives an overview of the proposed handling of API versions and their relation to release management.

It consolidates inputs from 

This page was briefly discussed on the RM call of 2024-03-19. Initial feedback was:

  • use work in progress "-wip.n" and release candidate "-rc.n" extensions instead of alpha and beta as the latter are not easy to define. These extensions would be only used internally in CAMARA for release management, but not in released APIs, which should only have semver numbers.
  • API implementers are free to use these non-released versions as they see fit, but there is no guarantee from CAMARA side that they will not change. 

API versioning

API version

The API version is defined in the "version" field of the OAS definition of an API. Its content MUST follow Semantic Versioning 2.0.0 | Semantic Versioning (semver.org).

An API version has the format:  x.y.z  where x, y and z are numbers corresponding to MAJOR, MINOR and PATCH releases.

The following provides some extracts of the semver 2.0 specification (and links to the corresponding spec item):

  • Major version zero (0.y.z) is for initial development. Anything MAY change at any time. The public API SHOULD NOT be considered stable. https://semver.org/#spec-item-4
  • Version 1.0.0 defines the public API. The way in which the version number is incremented after this release is dependent on this public API and how it changes. https://semver.org/#spec-item-5
    • Patch version Z (x.y.Z | x > 0) MUST be incremented if only backward compatible bug fixes are introduced. A bug fix is defined as an internal change that fixes incorrect behavior. https://semver.org/#spec-item-6

    • Minor version Y (x.Y.z | x > 0) MUST be incremented if new, backward compatible functionality is introduced to the public API. It MUST be incremented if any public API functionality is marked as deprecated. It MAY be incremented if substantial new functionality or improvements are introduced within the private code. It MAY include patch level changes. Patch version MUST be reset to 0 when minor version is incremented. 

    • Major version X (X.y.z | X > 0) MUST be incremented if any backward incompatible changes are introduced to the public API. It MAY also include minor and patch level changes. Patch and minor versions MUST be reset to 0 when major version is incremented.

Precedence example:  1.0.0 < 2.0.0 < 2.1.0 < 2.1.1.

The API guidelines describe the applicable versioning strategy.

API version extensions 

During the API development and release preparation, "work-in-progress" (-wip) or "release-candidate" (-rc) extensions shall be used to identify intermediate states of an API. 

The notions of work-in-progress and release-candidate API versions are internal to the CAMARA project and used only for the release management process.

The following extensions shall be used in the API version:

  • -wip.m
  • -rc.n

Extensions are post-fixed to the API version numbers and separated from it by a hyphen "-". m and n are numbers.

Precedence example: 1.0.0-wip.1 < 1.0.0-wip.2 < 1.1.0-wip.1 < 1.1.0-wip.2 < 1.1.0-rc.1 < 1.2.0-rc.2 < 1.2.0 (released)

NOTE: a released API version shall have no extensions, only the major.minor.patch version number as described in the previous section.

NOTE: alpha and beta extensions shall not used (as no clear criteria are identified). Only the extensions needed for release management shall be used.

API version pre-release and release creation

To prepare the release of an API, 

All pre-release and released API versions MUST have an API extension.

  • A work-in-progress API version MAY have a GitHub release package
  • A release-candidate and released API version MUST have a GitHub release package

To create an API version (pre-)release, the following assets need to be created with naming rules as indicated in the below table.

API versionGitHub branchTagGitHub release packagerelease package tag
work-in-progressrelease-x.y.z-wip.mvx.y.z-wip.m

[ release-x.y.z-wip.m ]

[ pre-release ]
release-candidate release-x.y.z-rc.nvx.y.z-rc.nrelease-x.y.z-rc.npre-release
releaserelease-x.y.zvx.y.zrelease-x.y.zlatest

Special case: v0 API versions

A newly introduced API is in the main branch and has API version 0.1.0.

The API version v0.y.z handling is slightly different from API versions > 0, as one or more working branches for minor API versions may be created during initial API development in the v0 context without creating GitHub release packages for these branches

Examples: release-0.1.1, release-0.2.0, release-0.2.1, release-0.3.0, etc. without creating release packages for these branches

Once an API version 0.y.z is deemed sufficiently stable, a first release-0.y.z-wip.1 branch shall be created with the corresponding GitHub release package.

From this point onwards, the below API (pre-)release steps apply.

The first release of an API version 0.y.z results in API version 1.0.0.

Preparing an API (pre-)release

An API sub-project can create as many work-in-progress API versions as they want during API development in preparation for the release.

  • A work-in-progress API version MAY have an associated GitHub release package

For API version > v0, the API version number is fixed when preparing as required by the next release and does NOT change during API development and release preparation, only the API version extensions and their numbers can change. 

To prepare the release of an API version, one or more release-candidate API versions MUST be created as follows:

  • At the M3 release milestone: when the API definition is agreed by the API Sub-project, before API testing as required by the release management process will be applied. As a result of testing, changes may result in additional release-candidate API versions.
  • At the M4 release milestone: the final release-candidate API version is delivered for meta release approval.
  • A release-candidate API version MUST have an associated GitHub release package

Releasing an API

A released API version is created when the release-candidate API version is approved for a meta release.

  • At the M5 release milestone, the final API version is created without any extension and included in the meta release.


Updating an API

After an API has been released, updates to the API need to be carefully planned.

to manage updates, the semver 2.0 versioning applies to the API as follows:

  • changes in the major number when creating non-backward compatible changes to the API
  • changes in the minor number when creating backward compatible changes to the API
  • changes in the patch number when correcting an error of the API

From this point (as opposed to v0 API versions), all intermediate API versions need to get the version extension to its release can be managed properly.

Example:

For a release v1.0.0, prepare a backward compatible change on branch release-1.1.0-wip.1.  Several intermediate wip branches may be created with or without release packages, and one or more release-candidate API version may be created with release packages (see example table below).

Example

The following table illustrates the usage of versions and version extensions throughout the API lifecycle.

release milestoneAPI version field

API version extension

API version in URLrelease branch namerelease branch tagrelease package namerelease taglater: PR annotation
API devt.0.9.0-wip.1v0wip1release-0.9.0-wip.1v0.9.0-wip.1release-0.9.0-wip.1development
API devt.0.10.0-wip.2v0wip2release-0.10.0-wip.2v0.10.0-wip.2release-0.10.0-wip.2development
M30.10.0-rc.1v0rc1release-0.10.0-rc.1v0.10.0-rc.1release-0.10.0-rc.1pre-release
M40.10.0-rc.2v0rc2release-0.10.0-rc.2v0.10.0-rc.2release-0.10.0-rc.2pre-release
M51.0.0
v1release-1.0.0v1.0.0release-1.0.0latest
....







M52.0.0
v2release-2.0.0v2.0.0release-2.0.0latest
M52.1.0
v2release-2.1.0v2.1.0release-2.1.0development
API devt.2.2.0-wip.1v2wip1release-2.2.0-wip.1v2.2.0-wip.1release-2.2.0-wip.1development
API devt.2.2.0-wip.2v2wip2release-2.2.0-wip.2v2.2.0-wip.2release-2.2.0-wip.2development
API devt.2.2.0-wip.3v2wip3release-2.2.0-wip.3v2.2.0-wip.3release-2.2.0-wip.3development
M3 compatible functional extension2.2.0-rc.1v2rc1release-2.2.0-rc.1v2.2.0-rc.1release-2.2.0-rc.1pre-release
API testing2.2.0-rc.2v2rc2release-2.2.0-rc.2v2.2.0-rc.2release-2.2.0-rc.2pre-release
M42.2.0-rc.3v2rc3release-2.2.0-rc.3v2.2.0-rc.3release-2.2.0-rc.3pre-release
M52.2.0
v2release-2.2.0v2.2.0release-2.2.0latest
....







API devt. non-compatible functional extension3.0.0-wip.1v3wip1release-3.0.0-wip.1v3.0.0-wip.1release-3.0.0-wip.1pre-release
API devt.  non-compatible functional extension3.0.0-wip.2v3wip2release-3.0.0-wip.2v3.0.0-wip.2release-3.0.0-wip.2pre-release
M33.0.0-rc.1v3rc1release-3.0.0-rc1v3.0.0-rc1release-3.0.0-rc1pre-release
M43.0.0-rc.2v3rc2release-3.0.0-rc2v3.0.0-rc2release-3.0.0-rc2pre-release
M53.0.0
v3release-3.0.0v3.0.0release-3.0.0latest

API version in URL

The API guidelines contain the following approach for defining the API endpoint URL:

servers:
  - url: "{apiRoot}/qod/v2"
    variables:
      apiRoot:
        default: http://localhost:9091
        description: API root

Once an API is released, the API version in the URL of a released API SHALL ONLY contain the MAJOR digit of the API version, e.g. "v2" in the above example.

The apiRoot is to be adapted by the implementer of the API endpoint (the API provider).

Before API release, the API definition and endpoint implementation may reflect the extension of the API in the URL, but without any hyphen or dots. 

Example: in the URL the version is v2wip1 for API version 2.y.z-wip.1

This simplifies testing of the API implementations during API development.

API family

The notion of API family will not be managed as part of release management. CAMARA releases only consider API versions.

It is recommended to adopt the proposal to make the API family a working group, and have the API sub-project focus on the development of one or more APIs.

See Herbert's proposal here: Proposal to establish API Families as Working Groups across API Sub Projects · Issue #7 · camaraproject/ReleaseManagement (github.com)

This will reduce the number of meetings and reporting load with the increasing number of APIs, and facilitate moving APIs from one family to another, or combining APIs from multiple families into into into family.

  • No labels