provision to add custom attribute in fields
Provision to provide custom attributes to artifact type field
- Why we want to add this feature? The drive to make the change:
Currently only few predefined attributes can be configured as part of field definition. these are :
nullable, default, mutable, required_
But if we need any other custom attributes to be predefined as part of field definition it is not possible as of now.
- Solution: providing custom attribtue option as part of field definition
- how: <More technical details than the high level overview of `solution` if needed.>
there are currently 2 options to provide this feature :
1. add a attribute named "custom_
Ex : 'source_url': Field(fields.
2. Add all attributes in linear way. without defining it inside a map. But there is a limitation that all custom field attributes has to be defined after all glare defined attribtues.
Ex : 'source_url': Field(fields.
DB prespective: As these are static field changes, There are no database changes required.
APIs prespective: It does not affect any API.
- impacts:
Schema API: It will update field schema definition.
- How to use this feature from client prespective: <Cli usage example/story> :
Based on the option we choose, we can define custom attribtues in same way as provided example above.
Blueprint information
- Status:
- Complete
- Approver:
- Moshe Elisha
- Priority:
- Undefined
- Drafter:
- Kushal Agrawal
- Direction:
- Needs approval
- Assignee:
- Kushal Agrawal
- Definition:
- Approved
- Series goal:
- Proposed for trunk
- Implementation:
- Implemented
- Milestone target:
- None
- Started by
- Kushal Agrawal
- Completed by
- Kushal Agrawal
Related branches
Related bugs
Sprints
Whiteboard
I like the first option better. I would suggest to rename "custom_attributes" to "metadata"
(Idan):
1. What's the motivation for this blueprint - Did we encounter such need somewhere?
2. So the first option suggest to add "metadata" field for every artifact?
3. Why can't we let the user create new artifact type by his needs?
(kushal)
1. Yes, while providing the help text for image_reference artifact we needed it as part of "/schema" response.
2. No, this will always be optional.
3. Yes, we will not be changing anything in BaseArtifact but it will provide an option to other artifactType writers.
Gerrit topic: https:/
Addressed by: https:/
field custom metadata