Add Relationship Base Type - #4892
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8a6e07d6-3bd4-4373-b9a2-88ad69127fcf
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: bd00581e-a610-4edb-8426-dfc6dd89cedb
|
All changed packages have been documented.
Show changes
|
commit: |
|
You can try these changes here
|
markcowl
left a comment
There was a problem hiding this comment.
I also wonder if we want a resource type for this, especially if it is required to be an extension.
| } | ||
|
|
||
| const missing = [ | ||
| "sourceId", |
There was a problem hiding this comment.
I think we should either create templates for these types, or we should have a type that defines the required properties and a decorator that indicates what is required (property exists, optionality, etc.) and use this to drive the linting rule
There was a problem hiding this comment.
Essentially, if we have a `@baseTypeProperty decorator, which took a base type kind and version, we could have an internal-only type (or a set of them) that defined the required properties.
@markcowl, can you please explain what you mean by this? |
| sourceTenant: string; | ||
|
|
||
| /** The relationship target identifier. */ | ||
| targetId: string; |
There was a problem hiding this comment.
In the Agent types, we split these into Appliance and UserDefined templates, with the appliance type having readOnly properties. If we are considering making some of these readOnly, it is easiest to make this part of the Appliance template
There was a problem hiding this comment.
Some relationship types should mark targetId and targetTenant as readonly while other relationship types mark sourceId and sourceTenant as readonly. For this reason, I didn't specify either set of properties as readonly in this single base class.
Do you think it's better to have a split like agent into a base relationship with readonly source id/tenant and another with readonly target id/tenant?
This PR introduces a base type for namespace Microsoft.Relationships. Relationships are extension resources used to establish a connection between a source ARM resource and target ARM resource.
Notably, two relationship types exist in a public preview state in ARM today: serviceGroupMember and dependencyOf.
The implementation of the Microsoft.Relationships base type is heavily inspired by the only other existing base type current: agent.
The relationship type is meant to be a lightweight ARM resources (meaning the resource payload has minimal properties and only really carries references to other ARM resources), however implementations of the relationship base type can new metadata about a relationship through extending the RelationshipMetadata model
Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com
Copilot-Session: 8a6e07d6-3bd4-4373-b9a2-88ad69127fcf