Istio API Feature Status using proto annotations#2013
Istio API Feature Status using proto annotations#2013zhlsunshine wants to merge 1 commit intoistio:masterfrom
Conversation
|
😊 Welcome @zhlsunshine! This is either your first contribution to the Istio api repo, or it's been You can learn more about the Istio working groups, code of conduct, and contributing guidelines Thanks for contributing! Courtesy of your friendly welcome wagon. |
|
/test release-notes_api |
|
Adding @jasonwzm who authored this design. |
|
@zhlsunshine Thanks for working on this! The feature name should be from the features defined in Istio repos. Do you plan to help implement the proto feature status? If so, we should definitely sync before more work is done this. :) Your contribution is much appreciated! |
|
@jasonwzm yes, it will be great if I can help on the proto feature status. And I also hope to sync with u @jasonwzm @therealmitchconnors for the next step. ^_^ |
|
/test build_api |
|
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
|
I have already completed the re-based, thanks! |
|
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
1 similar comment
|
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
|
This looks good to me. |
| // the destination rule is declared in. Similarly, the value "*" is reserved and | ||
| // defines an export to all namespaces. | ||
| repeated string export_to = 4; | ||
| repeated string export_to = 4 [(istio.extensions.feature) = {status: "alpha", name: "dr-export-to", id: "traffic.sidecar"}]; |
There was a problem hiding this comment.
Putting a name on every field seems extremely tedious. Do we need it? It already has a name
There was a problem hiding this comment.
Yes, sure, it's tedious, however besides helping to categorize all Isito features in alpha, beta or maturity, it will also be more cautious when changing or creating features for Istio API, and the owners of feature need to add this label by themselves.
There was a problem hiding this comment.
How is it helpful to give it another name though? It seems we are just repeating the name (in a slightly different, form, that is likely inconsistent between every field). For example, we could automatically derive this is name: "DestinationRule.spec.exportTo".
This form already has meaning as well:
$ kubectl explain DestinationRule.spec.exportTo
KIND: DestinationRule
VERSION: networking.istio.io/v1beta1
FIELD: exportTo <[]string>
DESCRIPTION:
A list of namespaces to which this destination rule is exported.
There was a problem hiding this comment.
there are 3 fields in optional properties: status, name and id for field exportTo. I think both status and id are clear. It seems that every feature name in features.yaml is high level and large-scope, so name could contain more detail information for specified field to some features. A field of specified resource may support more than one features and one feature may also include more than one fields. So I think both id comes from features.yaml and name defined by feature author can help to accurately reflect the relationship between feature and field of the resource.
There was a problem hiding this comment.
So:
- Status - this is clear, its the new identifier we are adding
- id - this is clear, its how we associate a field with a feature
But name - the field already has a name. It doesn't need two names.
name defined by feature author can help to accurately reflect the relationship between feature and field of the resource.
This sounds like you are saying its the name of the feature, not the field? In which case, why do we need id and name?
There was a problem hiding this comment.
Isn't traffic.sidecar the name of the feature?
I also don't see how this allows for multiple features?
There was a problem hiding this comment.
traffic.sidecar should be a high level feature name, and more detail may be helpful and easy for user to trace the status and progress. Such as override injection for XXX for traffic.sidecar.
For multiple features, I think the optional id can be traffic.sidecar|traffic.control, and name can be feature_name_1|feature_name_2 for multiple features.
There was a problem hiding this comment.
Hi @howardjohn, how about change like this:
- make the field option looks like this
repeated string export_to = 4 [(istio.extensions.feature) = {status: "alpha", id: "traffic.sidecar"}];and keep the definition of field optionistio.extensions.feature.name. - init
istio.extensions.feature.namewith its message name + field name when using this field option in later.
Does it make sense?
There was a problem hiding this comment.
I am not sure what that helps with or how we will fill in that setting?
There was a problem hiding this comment.
Hi @howardjohn according to the design doc, the property istio.extensions.feature.name should be kept, and at least this property can support more detail of new feature even if it can not be filled for now. So @therealmitchconnors & @jasonwzm, any idea from you?
| // label the feature's status, available status values may be alpha, beta and stable | ||
| // there would be experimental in future. | ||
| optional string status = 1; | ||
| // show the feature field for specified resource, such as vs-export-to shows the virtualservice's field export_to, |
There was a problem hiding this comment.
What do we mean by 'show' here? I can't quite tell if it's
- As a link in user-facing docs to the feature definition & status (seems like that would be derived via 'id')
- As a means to 'name' the above or at least ensure that there is a reconciled name defined either here or in features.yaml
There was a problem hiding this comment.
@louiscryan already existing features.yaml is for user-facing docs, and this change is used for doing statistics of API feature according to feature status. Generally, feature author needs to add this optional properties based on API field level when they are working on a new feature. Moreover, this optional properties should be mapped with features.yaml via its id, so there is a optional property named id in message IstioFeature. For your question, the name here would contains more detail information than in features.yaml because a new feature maybe include more than one API fields.
|
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
| // the destination rule is declared in. Similarly, the value "*" is reserved and | ||
| // defines an export to all namespaces. | ||
| repeated string export_to = 4; | ||
| repeated string export_to = 4 [(istio.extensions.feature) = {status: "alpha", name: "dr-export-to", id: "traffic.control"}]; |
There was a problem hiding this comment.
what is a bit confusing is that you highlight this export_to feature status as alpha and API is also alpha. Do you mean this feature is alpha while the rest of DR is beta?
What is the criteria for adding the istio feature status out of so many fields in DR or any other resource?
There was a problem hiding this comment.
Q: what is a bit confusing is that you highlight this export_to feature status as alpha and API is also alpha. Do you mean this feature is alpha while the rest of DR is beta?
A: In fact, user may pay more attention on the status of these new imported features which may be alpha or beta or experimental, and user also want to know more details about the status and progress for these features, so it should not be key point for the rest which is not highlighted. And @jasonwzm please correct me if I am wrong.
Q: What is the criteria for adding the istio feature status out of so many fields in DR or any other resource?
A: Thanks for this question. In spite of more details for field based on feature status, I think this doc of the criteria still can be a great reference.
| // there would be experimental in future. | ||
| optional string status = 1; | ||
| // show the feature field for specified resource, such as vs-export-to shows the virtualservice's field export_to, | ||
| // it can be defined by feature owner. |
There was a problem hiding this comment.
any approval process needed? or just the normal PR approval?
also, how a feature owner know which ones they should add this status field? (asked below in the example below)
There was a problem hiding this comment.
Q: any approval process needed? or just the normal PR approval?
A: I think normal PR approval is enough, because API repo change is a significant thing. Any other idea?
Q: how a feature owner know which ones they should add this status field? (asked below in the example below)
A: I think doc should be a great referenced criteria for feature owner. Beside that, I think proposal doc or PR review would be a right place to discuss the status field.
|
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
1 similar comment
|
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
|
Can we build the tooling that makes these fields useful before merging it into the API? my concern is we will end up like the test frameworks features thing - it adds a significant burden to developers, but has yet to be useful. Before we go add another hurdle to merging a PR, we need to make sure its actually giving us a benefit today |
Hi @howardjohn, I understand your worry about it. However, this PR is the first phase to this API feature status, and I will build a tool to make these fields useful based on the design doc once this PR can be merged. According to the design, there would be a sub-command named |
|
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
|
Hi @howardjohn new submit to remove proto annotations of name based on comment here , I will fetch the necessary information related to name as |
|
Hi @howardjohn, after some thinking and discussion, I think it's an agree on dropping the IstioFeature field name, and just 2 fields left as below: Could you please help to check and approve it? Thanks! ^_^ |
| // the destination rule is declared in. Similarly, the value "*" is reserved and | ||
| // defines an export to all namespaces. | ||
| repeated string export_to = 4; | ||
| repeated string export_to = 4 [(istio.extensions.feature) = {status: STABLE, id: "traffic.control"}]; |
There was a problem hiding this comment.
what happens when we have a field that is associated with multiple features?
There was a problem hiding this comment.
Generally speaking, multiple features should have the same feature status if they are included in the same field, even if feature status is not the same, it's okay to provide more information in https://github.com/istio/enhancements/blob/master/features.yaml or append additional feature id to field id as well. Moreover, this situation is uncommon.
| optional FeatureStatus status = 1; | ||
| // id means the feature id which can be mapped here: https://github.com/istio/enhancements/blob/master/features.yaml | ||
| // it should be contained in id section of features under this yaml file. | ||
| optional string id = 2; |
There was a problem hiding this comment.
Given John's comment below I think this would be best suited as repeated string id = 2;. A repeated item that's empty is essentially optional.
There was a problem hiding this comment.
@jacob-delgado okay, I will add repeated for field id. BTW, I think field status should be necessary to add repeated as well.
|
@zhlsunshine: PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
jacob-delgado
left a comment
There was a problem hiding this comment.
LGTM. You should bring this to the APAC meeting next week to get the RFC approved.
great idea! |
According to proposal design doc,
FieldOptionsof proto3 can be used to implement this feature label, and I just change the code forExport Tofeature as PoC work.Thank you for your time for reviewing this PR! ^_^