-
Notifications
You must be signed in to change notification settings - Fork 183
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
Moved the model context from the TM class into the TM object #175
Conversation
@nineinchnick you're WAY better at this stuff than I am, do you mind taking a look? |
f0f1922
to
6afea2d
Compare
I'll try tomorrow, I just rebased #75, and that took like 2 hours so I'm spent. |
6afea2d
to
9d34ad6
Compare
CodeSee Review Map:Review in an interactive map View more CodeSee Maps Legend |
9d34ad6
to
4ec286b
Compare
@nineinchnick I wanted to ask what the opinion is about this PR? |
Sorry, it's rather big and I'm struggling to find time to review it as a whole, not just nitpicking. In the description you mentioned something about UUIDs being different and having to do manual tests. Can you try using |
Yes I do set the seed to zero with Maybe you can just ignore the commit with my test cases 623d1f5 |
I added some unit tests which are similar to the original tests. But still as soon as the creation order differs the uuids will change, which is rather annoying when comparing two threat models that are the same except for the import. See |
Hi, should I close the PR? |
Sorry, it looks like we are all busy with life I am looking for @nineinchnick 's review, but he seems to be unable at this time. Let's wait a bit more for his chiming in before we decide where this goes. |
…late and updated documentation
…ar to existing logic for json.
To make it possible to import other models into the current model without adding all elements the elements of the model are now stored in the TM object and not the class.
To add the imported elements and data objects it is necessary to figure out which elements an attributes are not part of the current TM. For this `TM._add_imported_elements(self)` collects all elements and data objects which are used by all `Dataflows` and then gets the difference between the set of elements found in the flows and the set of elements defined in the TM. The result of `TM._add_imported_elements(self)` is merged by just adding the imported elements to the lists * `tm._actors` * `tm._assets` * `tm._boundaries` * `tm._data` * `tm._elements` The behavior of `TM._add_imported_elements(self)` is very similar to `_get_elements_and_boundaries(flows)`, only that `_add_imported_elements` also needs to check if there are instances of Data, Actor and Asset to add them to the specific list.
I hopes this would return more comparable results, but the oder of the elements and there given uuid is affect by the creation time. So the diffs need to be checked manually. My make skills are a bit rusty so the make files might not be very portable.
While keeping uptodaate with master some changes needed to be adjusted to use the TM objects instead of the class
Added unit tests with models which import a test module
32256bb
to
6429930
Compare
Hi @raphaelahrens - I think this got superseded by #190 - please let me know if that's not the case.. |
Hi, the problem is the commit is all over the place and keeping it in sync with upstream requires to much time. It will be easier to start fresh. |
Got it.
…On Fri, Apr 29, 2022, 01:23 Raphael Ahrens ***@***.***> wrote:
Hi,
the problem is the commit is all over the place an keeping it in sync with
upstream requires to much time.
It will be easier to start fresh.
—
Reply to this email directly, view it on GitHub
<#175 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAC2BAO45RXZZUOGPGGK6LDVHNW4DANCNFSM5ETFVLZA>
.
You are receiving this because your review was requested.Message ID:
***@***.***>
|
To make it possible to import other models into the current model
without adding all elements the elements of the model are now stored in
the TM object and not the class.
I addition I added some test models to check how they differ between each other and between the current master branch.
But the result of the models have to be compared manual, because the UUID and the order often differ even though the resulting report and the diagrams are similar. Maybe it is possible to automate this process more.
Since I can only do manual checking it would be good if someone else checked if this PR is not changing the original behavior.