-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
Merge complex institutions with overlapping users #3331
Conversation
…mplex_institutions
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.
Right now, we already offer an institution merge on the website but this sometimes fails due to overlapping users. Since this PR provides a way to merge these institutions semi-automatically, it would be nice if the command that is needed for this is printed along with the error message that is shown when the automatic merge fails.
I'm thinking about a way on how to test this with actual data without risking data loss. The only way I can think of is copying some problematic data from the production environment to naos but this might be a lot of work (this is why #2866 would be nice).
The code itself looks ok.
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.
Looking forward to merge some problematic institutions :)
This pull request builds upon #3327 but is split off to keep the individual pull request manageable.
It introduces an interactive script to merge two institution who potentially have overlapping users. It uses the merge_users interactive script to merge the overlapping users first.
This all happens in a single transaction, as both the merge of users and that of institutions depend on each other.
Because of this transactional nature I had to introduce a new gem after_commit_everywhere
This gem makes sure certain side effects are only applied after the full transaction is successfully committed.
See the test
The script should also rollback filesystem changes
for a test case that was broken without this gem.The relevant command is printed in the error message when merging institutions using the web interface has failed