-
Notifications
You must be signed in to change notification settings - Fork 300
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
Enhance FreezingArchRule #252
Conversation
DeepCode Report (#e946a3)DeepCode analyzed this pull request. |
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.
Cool, thanks! I could only come up with a few suggestions, mostly to the tests.
archunit/src/main/java/com/tngtech/archunit/library/freeze/ViolationStoreFactory.java
Outdated
Show resolved
Hide resolved
archunit/src/test/java/com/tngtech/archunit/library/freeze/FreezingArchRuleTest.java
Show resolved
Hide resolved
archunit/src/test/java/com/tngtech/archunit/library/freeze/FreezingArchRuleTest.java
Outdated
Show resolved
Hide resolved
archunit/src/test/java/com/tngtech/archunit/library/freeze/FreezingArchRuleTest.java
Outdated
Show resolved
Hide resolved
archunit/src/test/java/com/tngtech/archunit/library/freeze/FreezingArchRuleTest.java
Outdated
Show resolved
Hide resolved
archunit/src/test/java/com/tngtech/archunit/ArchConfigurationTest.java
Outdated
Show resolved
Hide resolved
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.
I've added my suggestions to branch PR#252
of my fork. Feel free to merge them, if you like. 😉
8b8a3a5
to
f8cc111
Compare
… by passing the key prefixed with "archunit." as system property "-Darchunit.key.in.props=overwritten" Signed-off-by: Peter Gafert <peter.gafert@tngtech.com>
… and update Signed-off-by: Peter Gafert <peter.gafert@tngtech.com>
…d the possibility to override ArchUnit configuration by system properties. Signed-off-by: Peter Gafert <peter.gafert@tngtech.com>
f8cc111
to
e946a3f
Compare
Kewl, thank you so much for your support 😃 Do you wanna quickly go over your points and check out, that I've covered everything? |
I'll be curious to have a look, but you don't have to wait for me if you're already in the flow of merging. All of my comments were anyways all just cosmetics. |
Sure, I'll merge it then 😉 Due to my busy schedule over the last months, I really have some reviewing and merging to do now 😓 |
As mentioned in #211,
FreezingArchRule
needs some more configuration options to prevent misuse. Furthermore there are different scenarios howFreezingArchRule
is used. In some scenarios, developers are required to update the violation store and check the current state into the repository. In some scenarios the CI job is more sophisticated and clones, updates and pushes a violation store automatically. In any case, within a CI environment it will normally not be necessary to ever create a new violation store, but on the contrary, this will easily be a sign of misconfiguration (the violation store being mounted / checked out to a different folder than configured forFreezingArchRule
).This PR will make it configurable, if
FreezingArchRule
may create a new default store, or if updates to the store are allowed in the specific environment.Note that the default for allowing to create a violation store is now
false
, i.e. without further configuration running aFreezingArchRule
without any existing violation store will cause an exception and explicitly demand to configureallowStoreCreation=true
.To make it easier to configure these capabilities per environment (e.g. one job or a developer might be allowed to update the violation store, another job may not), ArchUnit configuration may now be overwritten by system properties. This will in particular make it easier to configure the violation store folder based on the specific environment.
Resolves: #211