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

Add a unique identifier to each feature #88

Merged
merged 4 commits into from
Jul 28, 2021

Conversation

brian-avery
Copy link
Member

This adds a unique, machine readable identifier to features. This can be used, among other things, for linking features to annotations.

@zhlsunshine @therealmitchconnors PTAL

@google-cla google-cla bot added the cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA. label Jun 22, 2021
@istio-testing istio-testing added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jun 22, 2021
@brian-avery
Copy link
Member Author

brian-avery commented Jun 22, 2021

Currently, this is just numeric, however, if area is necessary, we could also support an identifier of the format areaID.featureID.

One con with doing this as an object property is I don't believe jsonschema supports verifying uniqueness. I.e. it will verify uniqueness for:

1: {},
2: {},
2: {}, 

But not for:

{
  id: 1,
  name: foo
}, {
 id: 1
 name:bar
}

If we were to change it to be a key id:object, then we could verify using the schema. Without it, we can verify the uniqueness with either an additional check outside of the schema or updating all of the features as mentioned, but there are quite a few PRs in flight that I think we should get reviewed first.

@therealmitchconnors
Copy link

therealmitchconnors commented Jun 23, 2021 via email

@esnible esnible changed the title Add a unique identifier to each fature Add a unique identifier to each feature Jun 24, 2021
@zhlsunshine
Copy link
Contributor

Hi @brian-avery , LGTM, I have approved it. Let's see the other's, thank you for your effort on this PR! ^_^

features.yaml Outdated
level:
checklist: ""
maturity: Stable
nextExpectedPromotion: ""
area: Traffic Management
- name: "Locality load balancing"
id: "traffic.localityloadbalancing"
Copy link
Member

Choose a reason for hiding this comment

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

We now have two mappings of "features" - the other one being here https://github.com/istio/istio/blob/809c761526f43e05853d1b8f389449a41e7c4d27/pkg/test/framework/features/features.yaml#L36 and doesn't have the same identifiers. it seems like we should have one

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, the IDs should probably be the same.

Copy link
Member Author

Choose a reason for hiding this comment

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

Talking to @therealmitchconnors, it sounds like either the other feature IDs will go away, or they will be updated to match the ones here so I think that using the ones here is fine.

There's also not a one-to-one mapping with what's in the other features.yaml and what's here.

@istio-testing istio-testing added the needs-rebase Indicates a PR needs to be rebased before being merged label Jul 13, 2021
@brian-avery brian-avery requested a review from a team as a code owner July 27, 2021 18:02
@istio-testing istio-testing removed the needs-rebase Indicates a PR needs to be rebased before being merged label Jul 27, 2021
@istio-testing istio-testing merged commit ee4a3ee into istio:master Jul 28, 2021
bianpengyuan pushed a commit to bianpengyuan/enhancements that referenced this pull request Jul 29, 2021
* Add a unique identifier to each fature

* Change IDs to strings

* Update feature IDs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants