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

Classes missing from PlantUML diagram should not cause exception #960

Closed
codecholeric opened this issue Sep 20, 2022 · 0 comments · Fixed by #964
Closed

Classes missing from PlantUML diagram should not cause exception #960

codecholeric opened this issue Sep 20, 2022 · 0 comments · Fixed by #964

Comments

@codecholeric
Copy link
Collaborator

At the moment, when using the PlantUML feature to create ArchRules from PlantUML component diagrams every class must be contained in the diagram or an IllegalStateException is thrown. The reason behind this is that we want to prevent users from missing classes or creating tests that in fact only cover a little part of the code base while getting a false sense of security.

This has one severe problem though: In legacy code bases there might be many classes that should be contained by the diagram, but are not at the moment. Getting an IllegalStateException thrown prevents the use of FreezingArchRule to freeze this legacy code state and improve it piece by piece. The only way would be to either create a legacy bucket in the diagram, which is tedious, or to exclude all the classes from the rule creating a big black hole where classes are uncovered by the rule and can further degenerate.

We should change classes not contained in the diagram from an IllegalStateException to a regular rule violation to improve this.

codecholeric added a commit that referenced this issue Sep 26, 2022
So far, when using `PlantUmlArchCondition`, if a class is contained in
no component or multiple components an exception is thrown. This makes
it impossible to freeze the current state with `FreezingArchRule`,
because the test will simply crash hard.
We now replace these exceptions by regular rule violations. That way
they can be treated like any other architecture violation and can also
be frozen with `FreezingArchRule`.

Resolves: #960
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant