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
fix: metadata capitalization #3413
Conversation
Signed-off-by: Bernd Verst <github@bernd.dev>
Signed-off-by: Samantha Coyle <sam@diagrid.io>
@@ -97,7 +97,7 @@ metadata: | |||
description: | | |||
Storage container name. | |||
example: '"myeventhubstoragecontainer"' | |||
- name: consumerId | |||
- name: consumerID |
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.
All our fields are case-insensitive. If you want to update the metadata.yaml
and the docs, that's all that needs to change :)
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.
And additionally, keep in mind that metadata.yaml
is not what controls the accepted values - this is just documentation.
Our Kit/Decode Metadata function which is based on mitchellh/mapstructure uses the WeakDecode function which accepts any casing. There are several other convenience features, which is why all metadata should always be specified as struct tags and then decoded using this special function.
Also FYI, consumerID
is a special metadata which actually is NOT defined in components-contrib
. This is hardcoded in Dapr runtime, so you might need to verify in that repo what casing is accepted. Unlike in contrib, they don't use our metadata handling code in runtime.
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.
ahh, okay. Docs do reflect the changes I'm making here, so that works out great and will require no doc updates: https://docs.dapr.io/reference/components-reference/supported-pubsub/setup-azure-eventhubs/
@@ -97,7 +97,7 @@ metadata: | |||
description: | | |||
Storage container name. | |||
example: '"myeventhubstoragecontainer"' | |||
- name: consumerId | |||
- name: consumerID |
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.
And additionally, keep in mind that metadata.yaml
is not what controls the accepted values - this is just documentation.
Our Kit/Decode Metadata function which is based on mitchellh/mapstructure uses the WeakDecode function which accepts any casing. There are several other convenience features, which is why all metadata should always be specified as struct tags and then decoded using this special function.
Also FYI, consumerID
is a special metadata which actually is NOT defined in components-contrib
. This is hardcoded in Dapr runtime, so you might need to verify in that repo what casing is accepted. Unlike in contrib, they don't use our metadata handling code in runtime.
Signed-off-by: Samantha Coyle <sam@diagrid.io>
Signed-off-by: Samantha Coyle <sam@diagrid.io>
Signed-off-by: Samantha Coyle <sam@diagrid.io>
Description
We currently have consumerGroup, consumerID, and consumerId metadata fields on components. I think we should remove the consumerId metadata field as the capitalization difference is confusing, and there are very few components with this capitalization, so I'm wondering if this is an oversight and is fine to be corrected. I know that we do not strive for consistency in naming just for name sake, but I do think we should strive for capitalization consistency on fields with the same name across the board.
Issue reference
We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.
Please reference the issue this PR will close: #[issue number]
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: