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

api: add API_VERSIONING.md. #8399

Merged
merged 7 commits into from
Oct 3, 2019
Merged

Conversation

htuch
Copy link
Member

@htuch htuch commented Sep 26, 2019

This captures the API versioning guidelines implied by
https://docs.google.com/document/d/1xeVvJ6KjFBkNjVspPbY_PwEDHC7XPi0J5p1SqUXcCl8/edit#heading=h.xgk8xel154p (from #6271)
and splits apart the Envoy API and internal implementation breaking change policies.

Some of the policy decisions (e.g. not allowing vNalpha to be hand edited, how we do manual breaking
changes, etc.) have been added to these guidelines based on recent experience with protoxform and
mechanical major version upgrade work, they are not part of the original stable API versioning work.

Risk level: Low
Testing: Formatting and docs build.

Fixes #8371

Signed-off-by: Harvey Tuch [email protected]

This captures the API versioning guidelines implied by
https://docs.google.com/document/d/1xeVvJ6KjFBkNjVspPbY_PwEDHC7XPi0J5p1SqUXcCl8/edit#heading=h.xgk8xel154p
and splits apart the Envoy API and internal implementation breaking change policies.

Some of the policy decisions (e.g. not allowing vNalpha to be hand edited, how we do manual breaking
changes, etc.) have been added to these guidelines based on recent experience with protoxform and
mechanical major version upgrade work, they are not part of the original stable API versioning work.

Risk level: Low
Testing: Formatting and docs build.

Fixes envoyproxy#8371

Signed-off-by: Harvey Tuch <[email protected]>
@repokitteh-read-only
Copy link

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to api/.

🐱

Caused by: #8399 was opened by htuch.

see: more, trace.

@htuch
Copy link
Member Author

htuch commented Sep 26, 2019

CC @markdroth @dfawley (please tag Eric as well, I forget his GH username) for review as well, thanks. This largely formalizes the earlier work on the stable versioning Doc, and makes it accessible to Envoy devs. There have been some changes to flow based on how this policy is likely to work out for v3.

@markdroth
Copy link
Contributor

@ejona86

Copy link
Contributor

@markdroth markdroth left a comment

Choose a reason for hiding this comment

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

This looks pretty good to me. I have a few comments, all fairly minor.

CONTRIBUTING.md Outdated Show resolved Hide resolved
api/API_VERSIONING.md Outdated Show resolved Hide resolved
`envoy.config.bootstrap.v4`. The `envoy.config.bootstrap.v3` package will become the previous stable
major version and support for `envoy.config.bootstrap.v2` will be dropped from the Envoy
implementation. Note that some transitively referenced package, e.g.
`envoy.config.filter.network.foo.v2` may remain at version 2 during this release, if no changes were
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any reason not to bump the version number of all packages when we introduce a new major version, even if the protos themselves did not change? It seems like that might make the dependency story a bit easier to deal with.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah. I think this will be too cumbersome to management server vendors. We have O(100) protos. If we ask management server vendors to rewrite their logic for O(100) protos on each major version upgrade, this is a lot more expensive than rewriting for O(10) protos.

Within Envoy, we plan on doing some fancy reflection gymnastics to do runtime rewriting from v2 to v3alpha (I'm working on this right now), when API messages are mostly unchanged. Internally, Envoy will always consume from the latest API, e.g. v3alpha. I think it's not reasonable to expect every management server to invent clever techniques like this though, we should assume the bulk of them will cope with churn via manual toil.

There will be no major `vN` initiative to address technical debt beyond that enabled by the above
process.

# One Definition Rule (ODR)
Copy link
Contributor

Choose a reason for hiding this comment

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

If the major version is always part of the package name, doesn't that prevent ODR violations? I don't quite understand the problem here -- can you give a concrete example to illustrate?

Copy link
Member Author

Choose a reason for hiding this comment

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

envoy.foo.v4 refers to envoy.bar.v4 and envoy.baz.v3. envoy.bar.v4 refers to envoy.blah.v2 while envoy.baz.v3 refers to envoy.blah.v3. Voila, transitively envoy.foo.v4 references envoy.blah.v2 and envoy.blah.v3.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure, but since envoy.blah.v2 and envoy.blah.v3 are different namespaces, how does that cause an ODR violation?

Copy link
Member Author

Choose a reason for hiding this comment

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

It doesn't at a C++ level, but it does at a higher level, since by allowing these multiple definitions, envoy.blah now needs to maintain an arbitrary number of stable versions, rather than just the trailing two versions. That includes all the code backing these versions. By forcing an "ODR-style" rule here, we avoid this quagmire.

Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

Thanks this is great. Flushing out some minor comments.

/wait

CONTRIBUTING.md Outdated Show resolved Hide resolved
api/API_VERSIONING.md Outdated Show resolved Hide resolved
api/API_VERSIONING.md Outdated Show resolved Hide resolved
api/API_VERSIONING.md Outdated Show resolved Hide resolved
api/API_VERSIONING.md Outdated Show resolved Hide resolved
api/API_VERSIONING.md Outdated Show resolved Hide resolved
api/API_VERSIONING.md Show resolved Hide resolved
Signed-off-by: Harvey Tuch <[email protected]>
minimize API churn by deferring application of discretionary changes until a major version cycle
where the respective message is undergoing a mandatory change.

The Envoy API structure helps with minimizing churn between versions. Developers should architect
Copy link
Member Author

Choose a reason for hiding this comment

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

@alyssawilk I think this covers what we discussed the other day, an advisory statement on organizing to minimize churn.

mattklein123
mattklein123 previously approved these changes Sep 27, 2019
Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks a ton for putting this together. Will defer to others for further review.

markdroth
markdroth previously approved these changes Sep 27, 2019
@htuch htuch mentioned this pull request Sep 29, 2019
Copy link
Contributor

@alyssawilk alyssawilk left a comment

Choose a reason for hiding this comment

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

Very cool. Couple of thoughts below

CONTRIBUTING.md Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
CONTRIBUTING.md Show resolved Hide resolved
In everyday discussion and GitHub labels, we refer to the `v2`, `v3`, `vN`, `...` APIs. This has a
specific technical meaning. Any given message in the Envoy API, e.g. the `Bootstrap` at
`envoy.config.bootstrap.v3.Boostrap`, will transitively reference a number of packages in the Envoy
API. These may be at `vN`, `v(N-1)`, etc. The Envoy API is technically a DAG of versioned package
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 whole paragraph might be usefully replaced with an example set of configurations.

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'll have something more tangible to put here once we have the final cut of the v3alpha API and have updated the Envoy config examples, so I suggest punting until then.

@htuch htuch dismissed stale reviews from markdroth and mattklein123 via 58553dc October 2, 2019 19:19
@htuch
Copy link
Member Author

htuch commented Oct 3, 2019

I chatted with @alyssawilk and she's happy with this PR, so if I don't get any more feedback I'll merge in a couple of hours.

Copy link
Member

@dfawley dfawley left a comment

Choose a reason for hiding this comment

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

Thanks for the heads-up, @htuch. Just one comment otherwise this looks great to me!

api/API_VERSIONING.md Outdated Show resolved Hide resolved
Signed-off-by: Harvey Tuch <[email protected]>
@htuch htuch merged commit 3801c68 into envoyproxy:master Oct 3, 2019
@htuch htuch deleted the api-versioning-md branch October 3, 2019 17:30
danzh2010 pushed a commit to danzh2010/envoy that referenced this pull request Oct 4, 2019
This captures the API versioning guidelines implied by
https://docs.google.com/document/d/1xeVvJ6KjFBkNjVspPbY_PwEDHC7XPi0J5p1SqUXcCl8/edit#heading=h.xgk8xel154p
and splits apart the Envoy API and internal implementation breaking change policies.

Some of the policy decisions (e.g. not allowing vNalpha to be hand edited, how we do manual breaking
changes, etc.) have been added to these guidelines based on recent experience with protoxform and
mechanical major version upgrade work, they are not part of the original stable API versioning work.

Risk level: Low
Testing: Formatting and docs build.

Fixes envoyproxy#8371

Signed-off-by: Harvey Tuch <[email protected]>
nandu-vinodan pushed a commit to nandu-vinodan/envoy that referenced this pull request Oct 17, 2019
This captures the API versioning guidelines implied by
https://docs.google.com/document/d/1xeVvJ6KjFBkNjVspPbY_PwEDHC7XPi0J5p1SqUXcCl8/edit#heading=h.xgk8xel154p
and splits apart the Envoy API and internal implementation breaking change policies.

Some of the policy decisions (e.g. not allowing vNalpha to be hand edited, how we do manual breaking
changes, etc.) have been added to these guidelines based on recent experience with protoxform and
mechanical major version upgrade work, they are not part of the original stable API versioning work.

Risk level: Low
Testing: Formatting and docs build.

Fixes envoyproxy#8371

Signed-off-by: Harvey Tuch <[email protected]>
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.

Markdown documentation for Envoy stable API versioning policy
5 participants