Skip to content

Clarify API versioning for alpha APIs #17920

Closed

Description

@jpeach

Title: Clarify API versioning for alpha APIs

Description:

The API_VERSIONING doc has a couple of exceptions for the compatibility policy:

  1. Changes made within 14 days of the introduction of a new API field or message.
  2. API versions tagged vNalpha. Within an alpha major version, arbitrary breaking changes are allowed.

In (1), even if the 14 days has not elapsed, and API might still be included in an official Envoy release. In this case, can we make it clear that once included in a release, the API is subject to compatibility?

In (2), if a v1alpha API can be changed in any way at any time, how can a control plane ever feel safe experimenting with it? As a control plane author, this is telling me that an alpha API can have breaking changes with no way for me to handle the transition. Does this mean that an API at the samev1alpha2 version can be completely incompatible between Envoy versions?

Finally, as a blanket rule, can we ban re-use of field numbers? AFAICT, this makes is difficult to impossible for a control plane to track API changes across Envoy versions. If a breaking change is needed, then dropping support for a field number (but not re-using that number), still makes it possible for me to carry a patch where I can serve different field numbers to different Envoy versions.

Activity

  1. added
    enhancement
    triage
    on Aug 31, 2021
  2. mattklein123 commented on Aug 31, 2021

    @mattklein123
    Member

    cc @envoyproxy/api-shepherds

    I agree about (1). Please raise a PR to adjust this text.

    I think (2) is going to require a lot more thinking. I agree that with breaking changes we are going to reduce the chance that people will experiment with the API. So this leaves us with:

    1. Just stop doing alpha and admit that all APIs are basically final (I'm getting pretty close to leaning in this direction myself)
    2. Do alpha, but avoid breaking changes, and then have some official policy for locking in the move to non-alpha. (Rename just to connote stability and possibly clean up deprecated fields while still reserving them.)
    3. Other?

    Thoughts?

  3. added
    help wanted
    and removed
    enhancement
    triage
    on Aug 31, 2021
  4. jpeach commented on Aug 31, 2021

    @jpeach
    ContributorAuthor

    cc @envoyproxy/api-shepherds

    I agree about (1). Please raise a PR to adjust this text.

    I think (2) is going to require a lot more thinking. I agree that with breaking changes we are going to reduce the chance that people will experiment with the API.

    I do think that is is OK for alpha APIs to spend less on compatibility than major version APIs. People adopting them should be prepared to do at least some transition work across Envoy releases. I'm not sure how to couch it in spec language, but breakages are OK as long as you can migrate between Envoy releases.

  5. htuch commented on Sep 1, 2021

    @htuch
    Member

    My basic thinking is that alpha APIs are unfit for use in production systems and control planes should not support them in situations when you need to do things like binary upgrades. This aligns with @mattklein123 take that basically all APIs are final. The question is how do we enforce this for contrib/?

    In any case, I think whatever rules we adopt have to be machine enforced with buf. We're past the point that humans can consistently enforce them in a scalable way across the full surface.

  6. adisuissa commented on Sep 1, 2021

    @adisuissa
    Contributor

    I also agree that at the moment anything added as alpha is essentially final. I think that typically alpha/beta is used for a specific version release of a binary, during which the API can change. However, this makes little sense in how Envoy's versioning works as the binary version is orthogonal to the API version.

    For contrib/ I think the bar is much lower, and it is up to a contributor to set their API as alpha or not.
    Using alpha implies that the API may introduce breaking changes, and this might be ok in use-cases where the extension depends on something very dynamic and it may not be clear up-front. The users of an alpha extension essentially agree that the API may break.
    Once the API is final, or if there's sufficient community around it, the API can move to non-alpha mode. This is also required when moving it from a contrib to a regular extension.

  7. jpeach commented on Sep 1, 2021

    @jpeach
    ContributorAuthor

    Perhaps a middle ground for alpha APIs is to be more aggressive about incrementing version numbers. Rather than making changes to v1alpha1 that are not wire-compatible, leave v1alpha1 in place N and make the change in v1alpha2. Envoy doesn't need to support both versions, but would continue to ship the protobufs (because go-control-plane isn't strongly bound to Envoy releases). Then control planes can pick the right version of the alpha API to serve to the right version on Envoy if they need to.

  8. jpeach commented on Sep 1, 2021

    @jpeach
    ContributorAuthor

    My basic thinking is that alpha APIs are unfit for use in production systems and control planes should not support them in situations when you need to do things like binary upgrades.

    IME, the envoy project has been really good at API compatibility, so it's easy to make the same assumptions about alpha APIs :)

  9. mattklein123 commented on Sep 1, 2021

    @mattklein123
    Member

    Having thought about this a bit more, I would vote for one of two extreme options:

    1. No more alpha outside of contrib.
    2. Alpha outside of contrib is allowed during development of a feature, but there is a extremely clear understanding that alpha APIs are not stable, should not be used in production, and if someone wants to use a feature in production they need to say so so we can move the API to non alpha.

    We have run into alpha -> non-alpha problems often enough that I think it's time to do away with it or be much more explicit about what guarantees there are.

    Thoughts?

  10. lizan commented on Sep 1, 2021

    @lizan
    Member

    I'm leaning to 1. as we have contrib now, new extensions can be started in contrib during its development and then moved into main if there's desire.

  11. mattklein123 commented on Sep 1, 2021

    @mattklein123
    Member

    Yes (1) is my vote also.

  12. 25 remaining items

  13. added a commit that references this issue on Sep 27, 2021
  14. added a commit that references this issue on Oct 3, 2021
  15. added a commit that references this issue on Oct 4, 2021
  16. added a commit that references this issue on Oct 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

apihelp wanted

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions