-
Notifications
You must be signed in to change notification settings - Fork 551
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
feat: Restructure AIPs 213 and 215, with more common proto details #1117
Conversation
This is an alternative to #1107. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM. The only blocker I have is the should on being aware - doesn't feel actionable.
aip/general/0213.md
Outdated
organization-wide common proto package. | ||
- Organizations **must not** define generic protos in organization-specific | ||
common protos, instead preferring global common protos. | ||
- Common protos **must not** be "moved" from an organization-specific common |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if what was originally thought to be an organization-specific concept ends up being more globally applicable? e.g. other organizations would like to use it. Would each organization duplicate the original organization-specific proto?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either each org could duplicate it, or we could add it to the global common protos, but with the original organization having to stick with their own copy - at least for existing fields. (Perhaps use the new global proto for new APIs, but stick with the org-specific one for all existing APIs using it? Both options are a bit messy.)
Given that this isn't a great experience either way, we should try to avoid getting into this mess - suggestions for processes to help on that front would be welcome!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the type "graduates" to google.type, and remains wire-compatible (serialized proto and JSON), what's the problem with switching to the new copy of the type in google.type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a breaking change for API libraries in statically-typed languages, because the type would be different. Removing it from the org-specific common library would also be a breaking change, as removing public types always is.
The latter breaking change is the big problem, as a new major version of the org-specific common library requires a new major version of all API libraries depending on it.
Basically there are ways this could just about be done, but it's a lot of work - much better to really take the time to work out global/org-specific first. (The DateRange one earlier is a good example of a gray area... we may have got that wrong, but it's unclear. It's not obviously org-specific in that date ranges themselves are quite general - but the detailed requirements of the type around precision, inclusivity etc are org-specific.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I have an API client that expects google.shoe.type.ShoeSize
and the server is updated to use a graduated google.type.ShoeSize
...why would my client break?
I agree that a generated GAPIC in a statically typed language would contain a breaking change when regenerated after the switch to the graduated type, but that seems distinct from a breaking change in the API itself. Client code that isn't updated at all would keep working, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that a generated GAPIC in a statically typed language would contain a breaking change when regenerated after the switch to the graduated type
And that's what I'm talking about.
that seems distinct from a breaking change in the API itself.
We've always included "that would cause a breaking change in client libraries" as a breaking change, and I'd want to keep doing so. AIP-180 explicitly calls that out with 3 kinds of compatibility - this would be compatible with item 2 and 3 there, but not with item 1.
Client code that isn't updated at all would keep working, right?
Yes, unless the type is used as an "Any". But there's more to compatibility than "existing code against existing libraries keeps working".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah fair enough - since AIP-180's item 1 is explicitly includes newer versions of client libraries, that's that I suppose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Not resolving this thread since I didn't start it, but FWIW, it's resolved as far as I'm concerned.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@toumorokoshi: Are you happy to resolve this now?
FYI also to @rofrankel who's been looking into common protos for more general AIPs. |
aip/general/0213.md
Outdated
- Organizations **must not** define generic protos in organization-specific | ||
common protos, instead preferring global common protos. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...must not define...protos...in...protos
Something about this wording feels off. Maybe "organization-specific packages" rather than "organization-specific protos"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will go over that at the same time as looking at protos/components.
aip/general/0213.md
Outdated
organization-wide common proto package. | ||
- Organizations **must not** define generic protos in organization-specific | ||
common protos, instead preferring global common protos. | ||
- Common protos **must not** be "moved" from an organization-specific common |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the type "graduates" to google.type, and remains wire-compatible (serialized proto and JSON), what's the problem with switching to the new copy of the type in google.type?
e7e5248
to
fc6fc33
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rofrankel: I've taken another pass at this - PTAL. AIP-215 is still more "proto-oriented" than "component-oriented" as it's describing the API protos themselves; I'm hoping that's okay.
Feedback on any of the changes is welcome.
aip/general/0213.md
Outdated
organization-wide common proto package. | ||
- Organizations **must not** define generic protos in organization-specific | ||
common protos, instead preferring global common protos. | ||
- Common protos **must not** be "moved" from an organization-specific common |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Not resolving this thread since I didn't start it, but FWIW, it's resolved as far as I'm concerned.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving in order not to block any longer on the one remaining open thread - any resolution to it works for me. In general this seems like a good PR and it should get merged.
Added "do not merge" so that client libraries folks can take a look before we merge. |
@toumorokoshi: Please could you reapprove? (You requested changes about "should be aware" - I took your suggestion.) |
aip/general/0215.md
Outdated
resource names ([AIP-122][]), rather than using the resource messages. | ||
- When two versions of an API use effectively the same (API-specific) proto | ||
that proto **must** be duplicated in each version. (In other words, APIs | ||
**must not** create their own "API-specific common comonent" packages.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/comonent/component/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Darn, again? Sorry, will fix. (I'm going to look at the more significant comment tomorrow.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@toumorokoshi: Ping for reapproval? Will squash and merge if so - I think everyone from Client Libraries is happy now (or at least has had ample chance to raise objections). |
"generic" and "organization-specific" is a gray area; some generic *concepts* | ||
have organization-specific use cases which surface through the components. | ||
|
||
## Existing global common components |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd love to see a section for ## Existing organization-wide common components
as well. I understand that this runs the risk of going out of date, but it would still be very helpful to categorize the ones that exist today for reference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay - I'm basically on vacation now until next week, and I'd like to get this merged before then if possible, but I can definitely take this as an action item for next week.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM! Added an issue to follow up #1142
aip/general/0213.md
Outdated
organization-wide common component package. | ||
- Organizations **must not** define generic components in organization-specific | ||
common component packages, instead preferring global common components. | ||
- Common components **must not** be "moved" from an organization-specific common |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it'd be nice to define "move" a bit more here - is completely copying the proto not allowed? if not, what happens when a concept does become common across multiple protos?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added clarification, and a "may" for copy-without-removal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple nits but nothing blocking. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed review comments in a new commit - @toumorokoshi if you could review just the last commit to check that it works for you, that would be great.
aip/general/0213.md
Outdated
organization-wide common component package. | ||
- Organizations **must not** define generic components in organization-specific | ||
common component packages, instead preferring global common components. | ||
- Common components **must not** be "moved" from an organization-specific common |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added clarification, and a "may" for copy-without-removal.
This is a second attempt, which keeps API-specific protos separate from common protos.
Co-authored-by: Brent Shaffer <[email protected]>
This is a second attempt, which keeps API-specific protos separate from common protos.