-
Notifications
You must be signed in to change notification settings - Fork 16
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
j1-integration document: dedup relationships by sourceType, _class, and targetType #309
Comments
I don't think it's an anti-pattern to have a relationship type where instances have different entity types. The AWS integration produces I'd recommend taking a look at the docs for the AWS integration. The format there is a good example of how complex integrations may need a different output. |
Thanks for the input @aiwilliams! I agree that it's not an anti-pattern. I do feel like deduping Perhaps there is some implication for |
AWS integration produces these relationships: interface RuleProperties extends NetworkAclRuleProperties {
_class: 'ALLOWS' | 'DENIES';
_type: 'aws_network_acl_rule';
region: AWSRegion;
displayName: string;
} That is, we'll need to support Something to keep in mind: take a look at the way the AWS integration processes these rules today. The source entity depends on whether the rule is ingress or egress. When creating direct relationships, the Are there implications of this for our metadata/documentation? |
That seems to encounter essentially the same issue as the example. I think it's solvable by simply defining both relationships explicitly. {
_type: 'azure_security_group_rule',
sourceType: 'azure_security_group',
_class: RelationshipClass.ALLOWS,
targetType: 'azure_subnet'
},
{
_type: 'azure_security_group_rule',
sourceType: 'azure_security_group',
_class: RelationshipClass.DENIES,
targetType: 'azure_subnet'
}
Great question @aiwilliams. Again, I feel it's easiest to just explicitly define two instances of {
_type: 'azure_security_group_rule',
sourceType: 'azure_security_group',
_class: RelationshipClass.ALLOWS,
targetType: 'azure_subnet'
},
{
_type: 'azure_security_group_rule',
sourceType: 'azure_subnet',
_class: RelationshipClass.ALLOWS,
targetType: 'azure_security_group'
} |
Yup, those "two instances of metadata" examples make sense 👍 To clarify, I wanted to address this:
I don't think we can throw (an error, right?) if a |
@aiwilliams that comment is specifically about entities and not relationships. I'm not sure if we should throw or what, but I do believe it should be handled. I opened a separate issue to discuss: #316 |
In the azure integration, two relationships with the same type are defined:
Seems like this should create two rows in documentation. Current deduplication for relationships is based on
_type
, so only one of these relationships will be documented. If we instead dedup bysourceType
,_class
, andtargetType
, we would be able to capture both of these relationships.On the other hand, this may be an anti-pattern that we want to avoid (multiple relationships defined by a single
_type
).The text was updated successfully, but these errors were encountered: