Skip to content
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

Boundaries with same name are grouping together #45

Closed
mikicho opened this issue Sep 22, 2019 · 2 comments · Fixed by #56
Closed

Boundaries with same name are grouping together #45

mikicho opened this issue Sep 22, 2019 · 2 comments · Fixed by #56

Comments

@mikicho
Copy link
Contributor

mikicho commented Sep 22, 2019

I'm not sure if it's by intent or not, but if I have two boundaries with the same name the components rendered into one boundary.
i.e:

dbVpc = Boundary("VPC")
serviceVpc = Boundary("VPC")

...

db = Datastore("Postgres Aurora")
db.inBoundary = dbVpc
server = Server("Server")
server.inBoundary = serviceVpc

Generates the following:

image

@lfservin
Copy link

lfservin commented Oct 1, 2019

That might be more of a graphviz problem. Have you looked at the dfd output? does the dot command complain about something?

redshiftzero added a commit to redshiftzero/pytm that referenced this issue Nov 8, 2019
adds a UUID when each element is initialized such that we can
ensure the unique name is unique even when the name attribute differs
@redshiftzero
Copy link
Contributor

hmm I just ran into this too, it looks like what is happening is that the truncated hashes used as the node ID for graphviz (e.g. fedfcbcecdeaaeefcdaefdb) are derived only from the name (see the _uniq_name() function). As such, if the names are equal, the hashes will collide, and graphviz will then only render a single instance of the node.

Here's a self-contained reproducer:

#!/usr/bin/env python3
from pytm.pytm import Actor, Boundary, TM, Server

tm = TM("test")
tm.description = "test"

server_rack = Boundary("bar")

app_server = Server("foo")
app_server.inBoundary = server_rack

mon_server = Server("foo")
mon_server.inBoundary = server_rack

admin = Actor("beep")
admin.inBoundary = server_rack

tm.process()

Even though there are two Server objects called foo, only one renders:

dfd

redshiftzero added a commit to redshiftzero/pytm that referenced this issue Nov 8, 2019
adds a UUID when each element is initialized such that we can
ensure the unique name is unique even when the name attribute differs
@izar izar closed this as completed in #56 Nov 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants