-
Notifications
You must be signed in to change notification settings - Fork 20
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(graph): add edge to map relationship between declarations and decorators on fields #148
Conversation
d06098b
to
69e31b1
Compare
d1326ca
to
4967376
Compare
Signed-off-by: muhammed-abdulkadir <[email protected]>
Signed-off-by: muhammed-abdulkadir <[email protected]>
Signed-off-by: muhammed-abdulkadir <[email protected]>
I think we can divide this into a couple of sub-tasks:
Create the edges from the elements that can have decorators applied:
We don't currently represent properties as nodes in the graph, so I think that decorators applied on Enum Values, Concept Properties, Map Keys and Values will need to be "hoisted" onto their parent declaration (taking care to remove duplicates!). This can be a second function, to get the node name for a model element (which could be based on the FQN of the element, or the FQN of the parent of the element). I.e. if I have something like:
We will create a graph with 2 nodes, one for the If we have this, however:
I would expect a graph with 2 nodes, one for With this:
I would expect a graph with 3 nodes, one for I would start by creating some test model files for these scenarios and making sure that the tests fail given the current code. I'd then start to refine the code until the tests pass. We will want to create test files for all the model elements that can have decorators applied. |
Signed-off-by: muhammed-abdulkadir <[email protected]>
Signed-off-by: muhammed-abdulkadir <[email protected]>
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.
This is looking very nice. One comment on the snap...
More generally.
I don't understand how the functionality is split between ConcertoGraphVisitor
and its base class DiagramVisitor
. If I've understood this correctly the DiagramVisitor
is writing PlantUML output to the FileWriter and then we specialise that to build a graph.
Those two operations don't appear to be related, or at least graph building is not a specialisation of PlantUML output. Why don't we just have two separate visitors, one for building a graph, one for PlantUML output?
I'm also not convinced that we need parameters.stack
in ConcertoGraphVisitor
- where we read the stack it seems to be to determine the parent ClassDeclaration of a field, relationship etc. We can get that by calling getParent
on the field, relationship.
I take responsibility for this one. ...
|
Signed-off-by: muhammed-abdulkadir <[email protected]>
Signed-off-by: muhammed-abdulkadir <[email protected]>
Signed-off-by: Matt Roberts <[email protected]>
Signed-off-by: muhammed-abdulkadir <[email protected]>
… its supertype Signed-off-by: muhammed-abdulkadir <[email protected]>
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.
Looking great. Just doc updates...
Signed-off-by: muhammed-abdulkadir <[email protected]>
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.
Awesome!
Closes #
Changes
In creating a connected graph, we observe that the relationship between declarations and fields are not reflected as expected. Specifically, when a field has a decorator, the associated decorator is not included in the filtered model manager, leading to an error due to failed decorator validation.
This change add the edge to reflect the relationship between the parent declaration and it's fields.
Author Checklist
--signoff
option of git commit.main
fromfork:branchname