-
Notifications
You must be signed in to change notification settings - Fork 37
Factory reset from fixtures #812
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
Open
dennisvang
wants to merge
43
commits into
feature/634-boostrapping-fdp
Choose a base branch
from
proposal/634-reset
base: feature/634-boostrapping-fdp
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 8 commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
627fb84
remove unnecessary annotations from FixtureHistoryRepositoryTests
dennisvang b4c43e5
add FixtureHistoryRepository.deleteByFilenameIn() with test
dennisvang e0b3202
rename repositoryPopulator to repositoryPopulatorFactoryBean
dennisvang c7bb0f4
move resource logic into separate BootstrapConfig.getNewResources method
dennisvang 8b133f7
implement restoreDefaultUsers and restoreDefaultMemberships using pop…
dennisvang ae816d1
fix type definitions
dennisvang 6cca79a
implement generic restoreDefaultFixtures method
dennisvang f00c6d7
fix indentation
dennisvang 6f7fad1
rename fixture files according to <order>_<package>_<description>.jso…
dennisvang b935b16
add BootstrapConfig.checkFixtureFilename with tests
dennisvang 223c130
rename to BootstrapConfig.validateFixtureFilename and throw if invalid
dennisvang c6f5201
validate fixture names before populating
dennisvang ca112b1
replace deleteByFilenameIn by deleteByFilenameContains (wip)
dennisvang da4ed88
specify allowed package names in fixture filename pattern
dennisvang 7503290
use generic arg name for deleteByFilenameContains and fix test
dennisvang e27cc72
add FixtureHistoryRepository.deleteByFilename with test
dennisvang c253a56
move fixture related methods into new BootstrapService
dennisvang 3169903
todo move to BootstrapService
dennisvang 75b843f
add a rudimentary test for the ResetService
dennisvang 3ebee9c
add license headers
dennisvang ae89ffb
reorder ResetService class attributes
dennisvang 1a95957
Merge branch 'proposal/634-remove-sql-test-data-migrations' into prop…
dennisvang 36300bd
split up and rename test-fixtures to match required filename pattern
dennisvang e52a675
run testResetToFactoryDefaultsAll as admin
dennisvang 921fde3
check entity creation time in testResetToFactoryDefaultsAll
dennisvang f90a2de
Merge branch 'feature/634-boostrapping-fdp' into proposal/634-reset
dennisvang 88f0f55
make testResetToFactoryDefaultsAll transactional
dennisvang c0d2c41
fix RescourceDefinition cascade delete problem
dennisvang ed8a5a1
move logic from BootstrapConfig and ResetService into BootstrapService
dennisvang ad25788
replace bootstrap.enabled property by a bootstrap-disabled profile
dennisvang 5a981fc
implement BootstrapService.repopulate()
dennisvang 106a035
Revert "replace bootstrap.enabled property by a bootstrap-disabled pr…
dennisvang d4e5f3a
consistent log messages in resetservice
dennisvang 5ec480b
update fixture history based on populator resources
dennisvang f8ab3fa
consistent usage of cascade for ResourceDefinition.metadataSchemaUsages
dennisvang 9dd5cda
Rely on cascading deletes in ResourceDefinitionService.deleteByUuid
dennisvang b267109
move repopulate() back from BootstrapService to ResetService
dennisvang 4617593
remove redundant flush call from ResourceDefinitionService.deleteDepe…
dennisvang cc8cb53
deserialize to ResourceDefinitionDTO in List_POST test
dennisvang 02264f5
check ResourceDefinition relations in List_POST test
dennisvang d47ae5e
initialize ResourceDefinition relations to empty list
dennisvang b5aed47
refresh the in-memory definition after calling createDependents()
dennisvang efe925e
Revert "remove redundant flush call from ResourceDefinitionService.de…
dennisvang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Are these added to make sure nothing is left out? Otherwise, cascading delete should work I believe...
Uh oh!
There was an error while loading. Please reload this page.
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.
Hi @MarekSuchanek thanks for the review! :)
You're right, the
deleteAll()calls formetadataSchemaUsageRepository,resourceDefinitionChildMetadataRepository, andresourceDefinitionLinkRepositoryare redundant.However, line 188 (
resourceDefinitionChildRepository.deleteAll()) does seem to be required, for some reason.Still, I like to be explicit here, and not rely on cascades.
Note
In my experience cascade deletes, in general, can lead to very nasty surprises.
One example of cascade deletes causing confusion is in #802, where it turned out that overriding the default Einstein user account in a test fixture caused the related objects to be deleted as well.