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

Proposal: API and SDK version labeling #280

Conversation

tigrannajaryan
Copy link
Member

@tigrannajaryan tigrannajaryan commented Oct 1, 2019

Problem Description

We assume that API specification will have a version number.
We also assume that SDK's will implement a particular API version.

Library authors may want to make multiple SDK releases that are
implementing a particular API version. For example, we may start
with API version 1.0.0 and make an SDK release 1.0.0 that
implements that particular API.

Later library authors may want to make a bug fix in the SDK and
release 1.0.1. Note that this release implements the same API
version, there are no changes from API perspective. Now we are in
a situation when API and SDK versions diverged.

This diverging seems inevitable because most likely API versions
will change much less frequently than library authors will want
to make SDK releases that implement those particular API versions.

Proposed Solution

Both API and SDK will use semantic version numbers. API and SDK
version numbers will not be coupled. API and SDK is free to have
separate version numberss

This decoupling of version numbers allows language library
authors to make patch and minor version API and SDK package releases
independently without the need to coordinate version numbers with
specification.

Alternate Solutions

Another solution was considered but saw less support:

Couple major and minor version numbers of SDK and API, only allow
SDK to freely change patch version number and always use 0 patch
number for API versions. The downside of this solution is that SDK
releases can only make patch releases if they implement the same
API or they have to break the semantic versioning rule and allow
significant changes while only incrementing patch number.

=======================
Implements #276 and #246

@@ -85,6 +85,16 @@ Note that mocking is also possible by using SDK and a Mock `Exporter` without ne

The mocking approach chosen will depend on the testing goals and at which point exactly it is desirable to intercept the telemetry data path during the test.

## Version Labeling

SDK must use semantic version numbering. SDK version number and version number of API that SDK implements can be different. SDK MUST be labeled with its own version number with one limitation: major version number of the SDK must be the same as the major version number of the API that the SDK implements.
Copy link
Member

Choose a reason for hiding this comment

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

I am confused about API and SDK.

I think there are 3 components here:
Specs - version
API (library artifact that includes only the API definition) - version
SDK (library artifact that includes the default implementation for the API) - version

Can we clarify this in what you wrote? I have a feeling that API in this text refers to Specs.

Copy link
Member Author

Choose a reason for hiding this comment

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

Is there a difference between API version and Spec version? API package 0.1.0 must implement Spec version 0.1.0. Do we have the need to make these 2 different?

Copy link
Member

Choose a reason for hiding this comment

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

I think we need to keep the API artifact and SDK in sync but those will not be in sync with Specs.

Imagine we start some parts of the v0.2 specs implementation which change the API add a new class. SDK will no longer work with the previous API because will try to implement a class that does not exist.

So I think API and SDK will always be released together and independent of the specs version

Copy link
Contributor

Choose a reason for hiding this comment

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

@bogdandrutu your last statement applies to the default SDK, but this document applies to any SDK.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think we need to keep the API artifact and SDK in sync but those will not be in sync with Specs.

@bogdandrutu I would expect that API artifact and Spec are in sync. The API artifact does not need to be re-released everytime you make a change in the SDK and make an SDK release if the SDK implements the same version of the spec.

API artifact needs to be re-released only when new spec version is created and the corresponding API artifact is created.

Imagine we start some parts of the v0.2 specs implementation which change the API add a new class. SDK will no longer work with the previous API because will try to implement a class that does not exist.

I do not fully get this example. My vision for Spec/API/SDK release timeline is the following:

  1. Spec v0.1.0 is defined.
  2. Language library authors read the spec and create API artifact v0.1.0. The artifact matches the spec v0.1.0.
  3. Language library authors create SDK v0.1.0. The SDK implements API/Spec v0.1.0.
  4. Language library authors continue working and make a new SDK release v0.1.1, then another release v0.2.0 and then another v0.2.1. All these SDKs implement API/Spec v0.1.0 and must be used together with API artifact v0.1.0. No new API artifacts are released.
  5. Spec v0.2.0 is defined.
  6. Language library authors read the spec and create API artifact v0.2.0. The artifact matches the spec v0.2.0.
  7. Language library authors create SDK v0.3.0. The SDK implements API/Spec v0.2.0.
  8. Language library authors continue working and make a new SDK release v0.3.1, then another release v0.3.2 and then another v0.4.0. All these SDKs implement API/Spec v0.2.0 and must be used together with API artifact v0.2.0. No new API artifacts are released.

and so on…

Copy link
Member

@SergeyKanzhelev SergeyKanzhelev left a comment

Choose a reason for hiding this comment

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

I like @bogdandrutu suggestion on being more explicit on what this note addresses - spec or actuarial libraries. But I think by itself this PR brings more clarity

@@ -85,6 +85,16 @@ Note that mocking is also possible by using SDK and a Mock `Exporter` without ne

The mocking approach chosen will depend on the testing goals and at which point exactly it is desirable to intercept the telemetry data path during the test.

## Version Labeling

SDK must use semantic version numbering. SDK version number and version number of API that SDK implements can be different. SDK MUST be labeled with its own version number with one limitation: major version number of the SDK must be the same as the major version number of the API that the SDK implements.
Copy link
Contributor

Choose a reason for hiding this comment

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

@bogdandrutu your last statement applies to the default SDK, but this document applies to any SDK.

@bogdandrutu
Copy link
Member

I think it is very hard to make only one API release for a spec version:

  1. Mistakes can happen and some feature are not implemented or not fully implemented.
  2. Between implementing two different spec versions if one language has fewer people almost never will get to the next version or very slow and we will be unable to make progress.
  3. If a bug in documentation or the "no-op" implementation - probably this will be a patch release.

I think because 1 and 2 we cannot keep the API in sync with Specs.

@yurishkuro
Copy link
Member

The motivation against completely decoupled versioning seems very slim, referring to some possible hypothetical use case in the future.

I think there is enough prior art, at least in the OpenTracing project, to demonstrate that all three versions, spec, API, and SDK, need to be decoupled.

@tigrannajaryan
Copy link
Member Author

I think it is very hard to make only one API release for a spec version:

1. Mistakes can happen and some feature are not implemented or not fully implemented.

2. Between implementing two different spec versions if one language has fewer people almost never will get to the next version or very slow and we will be unable to make progress.

3. If a bug in documentation or the "no-op" implementation - probably this will be a patch release.

I think because 1 and 2 we cannot keep the API in sync with Specs.

@bogdandrutu I understand now. Makes sense. So, basically it means we will have 3 different versions to deal with:

  • Spec version. This is the version of the documentation in this repo. It is defined when we (Spec SIG / TC) make a Spec release and add a release tag to this Github repo.

  • API package version. Can be different from Spec version. Must have the same major version as the Spec that it codifies in certain language. Multiple API packages may be released for the same Spec version. Such releases will typically increment patch number since releases will be usually needed if the API package has a bug, but in some rare cases there may be a need to increase minor version number (e.g. if the API package continues to codify the same Spec but in significantly improved way for the specific language). Every API package release must be clearly labeled with version number of the Spec that it codifies.

  • SDK package version. Can be different from Spec version and from API package version. Must have the same major version as the Spec that it implements in certain language. Multiple SDK packages may be released for the same API package version. Every SDK package release must be clearly labeled with version number of the API package that it corresponds to.

Note: SDK packages are labeled with API package version they correspond to, not with Spec version that they implement. This is important because different API packages that implement the same Spec version may be incompatible from internal implementation perspective with the SDK releases. This should be rare but it is still a possibility (because internal ABI between API and SDK is not defined in the Spec and language library authors must be free to modify internal ABI as needed).

Does this sound right?

@tigrannajaryan
Copy link
Member Author

The motivation against completely decoupled versioning seems very slim, referring to some possible hypothetical use case in the future.

@yurishkuro is this an argument for getting rid of the requirement to have the same major version number or you are asking to have 3 different version numbers?

I think there is enough prior art, at least in the OpenTracing project, to demonstrate that all three versions, spec, API, and SDK, need to be decoupled.

Yes, makes sense. Please see my previous comment in this thread, let me know if it correctly captures the idea.

@yurishkuro
Copy link
Member

@tigrannajaryan yes, previous comment looks good, except for this sentence in item 3: "Must have the same major version as the Spec that it implements in certain language. "

@tigrannajaryan
Copy link
Member Author

@tigrannajaryan yes, previous comment looks good, except for this sentence in item 3: "Must have the same major version as the Spec that it implements in certain language. "

@yurishkuro @bogdandrutu can you please discuss and come to a consensus on this one? I am OK with either approach (requiring or no requiring major version number to be the same). If you agree on what to do I will be happy to capture it in this PR.

@devinsba
Copy link

devinsba commented Oct 2, 2019

An unsolicited opinion:

  1. require the Version mapping from SDK -> Spec and API -> Spec be documented in the Readme for each SDK project within the org.
    a. For reasons of semantic versioning rules around breaking code changes I don't think the major version should be required to be aligned with the Spec for either the SDK or API
  2. Require major version (maybe even minor) bumps for SDK and API when they update the supported Spec major version (again, maybe minor as well)

@tigrannajaryan
Copy link
Member Author

@devinsba

  1. require the Version mapping from SDK -> Spec and API -> Spec be documented in the Readme for each SDK project within the org.

Yes, this is already added as a requirement in this PR.

a. For reasons of semantic versioning rules around breaking code changes I don't think the major version should be required to be aligned with the Spec for either the SDK or API

One argument in favour of aligning major version numbers is that it contains the decision that we are making now within current major version number (0.x). It requires that Spec, API and SDK all use 0 as major version number. If we remove this requirement we will allow to pollute version number space in a way that may not be reversible. If in the future we decide to change the decision that we are making now and have different rules for let's say version 1.x we may not be able to do it because we may have artifacts of Spec 0.x that are using version 1.x numbers (or even higher major version numbers).

  1. Require major version (maybe even minor) bumps for SDK and API when they update the supported Spec major version (again, maybe minor as well)

This is achieved automatically if we accept the requirement to keep major version numbers aligned.

@bogdandrutu
Copy link
Member

I think between API and SDK we can keep consistency version. The argument here can be:

  1. Easily understand the compatibility between API and SDK
  2. Allow features to be defined in the API and implemented in the SDK in the same PR. Otherwise this is impossible and hard to achieve.

@yurishkuro
Copy link
Member

@bogdandrutu if API and SDK are kept in the same repo, then PRs can still work the same, without coupling the versions.

As an example for decoupling versions, OpenTracing API for Python is v2.x, but Jaeger client implementing that API is v4.x - because the client (SDK) was evolving, changing its internal APIs, etc., so we had to release major versions to maintain the semver rules.

@bogdandrutu
Copy link
Member

Ok, I see your point @yurishkuro. Let's propose a compromise at least for v0.x, we release both packages in the same time API/SDK because we will most likely develop both in parallel and revisit this for >1.x?

@yurishkuro
Copy link
Member

yes, I think it's fine to do for 0.x and even 1.x, fairly unlikely that the major versions would diverge very quickly (especially given that SDKs are essentially recreated from prior art, including lessons learned)

@yurishkuro
Copy link
Member

But that would be just practical consequences, I would rather not enshrine major(API)==major(SDK) rule in the spec.


This weak coupling of version numbers allows language library authors to make patch and minor version SDK releases independently without the need to coordinate and match version numbers with API specification. The requirement to use the same major version number is aimed to avoid spilling over SDK version numbers into next major version in case we decide to change this policy starting from certain major version in the future.

Because API and SDK version numbers are not strictly coupled every SDK release MUST clearly specify API version number that it implements. Language library authors MUST include this information in SDK release notes. For example the release notes may say: "SDK 0.3.4, implements API 0.1.0".
Copy link
Contributor

Choose a reason for hiding this comment

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

Also, please reference the version of the spec.

@tedsuo
Copy link
Contributor

tedsuo commented Oct 3, 2019

Thanks for driving this @tigrannajaryan.

I share @yurishkuro's experiences from OpenTracing - too many practical difficulties presented themselves to keep the versions in sync at any level, even though we were interested in doing so. (I will point out that it could be possible to could keep the major version numbers the same, if we choose to not use semver for OpenTelemetry. But I'm not suggesting we do that.)

On the plus side, while it would be nice and clean to have the versions relate, I do not think it will be an issue in practice. End users, for the most part, do not notice these details very frequently, as most package managers handle the dependency resolution for them. And, for the most part, end users are not cross-referencing the work they are doing with the spec.

As long as we have a compatibility matrix posted in our documentation, and each SDK release references the API and spec it is built against, the users who need to cross-reference will be satisfied.

@tigrannajaryan
Copy link
Member Author

@yurishkuro @bogdandrutu @tedsuo to summarize this is what we are converging on:

  • We want to have 3 different decoupled version numbers (Spec, API package, SDK package).
  • We do not want to require major versions of API and SDK packages to match (although in near future they likely will).
  • We want to mandate all library authors to clearly label API and SDK packages with their own separate version numbers as well as version number of the Spec they implement.

Is this correct?

@SergeyKanzhelev
Copy link
Member

btw, would merging of https://github.com/open-telemetry/opentelemetry-specification/pull/115/files help to understand this PR as well?

@tigrannajaryan
Copy link
Member Author

btw, would merging of https://github.com/open-telemetry/opentelemetry-specification/pull/115/files help to understand this PR as well?

I beleive #115 depends on what we decide here. So this one should be resolved and merged first.

## Problem Description

We assume that API specification will have a version number.
We also assume that SDK's will implement a particular API version.

Library authors may want to make multiple SDK releases that are
implementing a particular API version. For example, we may start
with API version 1.0.0 and make an SDK release 1.0.0 that
implements that particular API.

Later library authors may want to make a bug fix in the SDK and
release 1.0.1. Note that this release implements the same API
version, there are no changes from API perspective. Now we are in
a situation when API and SDK versions diverged.

This diverging seems inevitable because most likely API versions
will change much less frequently than library authors will want
to make SDK releases that implement those particular API versions.

## Proposed Solution

Both API and SDK will semantic version numbers. API and SDK
version numbers will not be strictly coupled. SDK is free to have
a separate version number with one limitation: major version
number of the SDK must be the same as the major version number of
the API that the SDK implements.

For example SDKs 0.1.0, 0.2.3, 0.7.0 can all implement API 0.1.0,
but SDK 1.0.0 cannot implement API 0.1.0.

This weak coupling of version numbers allows language library
authors to make patch and minor version SDK releases
independently without the need to coordinate version numbers with
API specification. The requirement to use the same major version
number is aimed to minimize the element of surprise and avoid
spilling SDK version numbers into next major version in case we
decide the policy starting from certain major version in the future.

Because API and SDK version numbers are not strictly coupled every
SDK release must clearly specify API version number that it
implements. Language library authors must include this information
in SDK release notes. For example the release notes may say:
"SDK 0.3.4, implements API 0.1.0".

## Alternate Solutions

Two other solutions were considered but saw less support:

1. Complete decouple SDK and API version numbers. SDK can use any
version, including a different version number. The downside of this
solution is that it can create a situation when in the future if we
decide version labeling policy it may be too late since there may
exist SDKs versions that spill into the next major version. To keep
our options open the major version number restriction was proposed.

2. Couple major and minor version numbers of SDK and API, only allow
SDK to freely change patch version number and always use 0 patch
number for API versions. The downside of this solution is that SDK
releases can only make patch releases if they implement the same
API or they have to break the semantic versioning rule and allow
significant changes while only incrementing patch number.

Implements open-telemetry#276 and open-telemetry#246
@yurishkuro
Copy link
Member

#280 (comment) sgtm

@tedsuo tedsuo self-requested a review October 4, 2019 02:42
Copy link
Contributor

@tedsuo tedsuo left a comment

Choose a reason for hiding this comment

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

@tigrannajaryan I agree with your summary. Leave an approval now with the assumption a final PR will add the agreed upon changes.

@tigrannajaryan
Copy link
Member Author

@bogdandrutu @tedsuo @yurishkuro I updated the text, please have a look.

@tedsuo
Copy link
Contributor

tedsuo commented Oct 4, 2019

LGTM

@bogdandrutu bogdandrutu merged commit 5622123 into open-telemetry:master Oct 5, 2019
@tigrannajaryan tigrannajaryan deleted the feature/tigran/versionlabeling branch October 22, 2019 21:35
SergeyKanzhelev pushed a commit to SergeyKanzhelev/opentelemetry-specification that referenced this pull request Feb 18, 2020
* Proposal: API and SDK version labeling

## Problem Description

We assume that API specification will have a version number.
We also assume that SDK's will implement a particular API version.

Library authors may want to make multiple SDK releases that are
implementing a particular API version. For example, we may start
with API version 1.0.0 and make an SDK release 1.0.0 that
implements that particular API.

Later library authors may want to make a bug fix in the SDK and
release 1.0.1. Note that this release implements the same API
version, there are no changes from API perspective. Now we are in
a situation when API and SDK versions diverged.

This diverging seems inevitable because most likely API versions
will change much less frequently than library authors will want
to make SDK releases that implement those particular API versions.

## Proposed Solution

Both API and SDK will semantic version numbers. API and SDK
version numbers will not be strictly coupled. SDK is free to have
a separate version number with one limitation: major version
number of the SDK must be the same as the major version number of
the API that the SDK implements.

For example SDKs 0.1.0, 0.2.3, 0.7.0 can all implement API 0.1.0,
but SDK 1.0.0 cannot implement API 0.1.0.

This weak coupling of version numbers allows language library
authors to make patch and minor version SDK releases
independently without the need to coordinate version numbers with
API specification. The requirement to use the same major version
number is aimed to minimize the element of surprise and avoid
spilling SDK version numbers into next major version in case we
decide the policy starting from certain major version in the future.

Because API and SDK version numbers are not strictly coupled every
SDK release must clearly specify API version number that it
implements. Language library authors must include this information
in SDK release notes. For example the release notes may say:
"SDK 0.3.4, implements API 0.1.0".

## Alternate Solutions

Two other solutions were considered but saw less support:

1. Complete decouple SDK and API version numbers. SDK can use any
version, including a different version number. The downside of this
solution is that it can create a situation when in the future if we
decide version labeling policy it may be too late since there may
exist SDKs versions that spill into the next major version. To keep
our options open the major version number restriction was proposed.

2. Couple major and minor version numbers of SDK and API, only allow
SDK to freely change patch version number and always use 0 patch
number for API versions. The downside of this solution is that SDK
releases can only make patch releases if they implement the same
API or they have to break the semantic versioning rule and allow
significant changes while only incrementing patch number.

Implements open-telemetry#276 and open-telemetry#246

* PR fixes
TuckTuckFloof pushed a commit to TuckTuckFloof/opentelemetry-specification that referenced this pull request Oct 15, 2020
carlosalberto pushed a commit to carlosalberto/opentelemetry-specification that referenced this pull request Oct 31, 2024
* Proposal: API and SDK version labeling

## Problem Description

We assume that API specification will have a version number.
We also assume that SDK's will implement a particular API version.

Library authors may want to make multiple SDK releases that are
implementing a particular API version. For example, we may start
with API version 1.0.0 and make an SDK release 1.0.0 that
implements that particular API.

Later library authors may want to make a bug fix in the SDK and
release 1.0.1. Note that this release implements the same API
version, there are no changes from API perspective. Now we are in
a situation when API and SDK versions diverged.

This diverging seems inevitable because most likely API versions
will change much less frequently than library authors will want
to make SDK releases that implement those particular API versions.

## Proposed Solution

Both API and SDK will semantic version numbers. API and SDK
version numbers will not be strictly coupled. SDK is free to have
a separate version number with one limitation: major version
number of the SDK must be the same as the major version number of
the API that the SDK implements.

For example SDKs 0.1.0, 0.2.3, 0.7.0 can all implement API 0.1.0,
but SDK 1.0.0 cannot implement API 0.1.0.

This weak coupling of version numbers allows language library
authors to make patch and minor version SDK releases
independently without the need to coordinate version numbers with
API specification. The requirement to use the same major version
number is aimed to minimize the element of surprise and avoid
spilling SDK version numbers into next major version in case we
decide the policy starting from certain major version in the future.

Because API and SDK version numbers are not strictly coupled every
SDK release must clearly specify API version number that it
implements. Language library authors must include this information
in SDK release notes. For example the release notes may say:
"SDK 0.3.4, implements API 0.1.0".

## Alternate Solutions

Two other solutions were considered but saw less support:

1. Complete decouple SDK and API version numbers. SDK can use any
version, including a different version number. The downside of this
solution is that it can create a situation when in the future if we
decide version labeling policy it may be too late since there may
exist SDKs versions that spill into the next major version. To keep
our options open the major version number restriction was proposed.

2. Couple major and minor version numbers of SDK and API, only allow
SDK to freely change patch version number and always use 0 patch
number for API versions. The downside of this solution is that SDK
releases can only make patch releases if they implement the same
API or they have to break the semantic versioning rule and allow
significant changes while only incrementing patch number.

Implements open-telemetry#276 and open-telemetry#246

* PR fixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants