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

fix(Groups): take over members during migration #863

Merged
merged 6 commits into from
Jul 18, 2024

Conversation

blizzz
Copy link
Member

@blizzz blizzz commented Jul 4, 2024

fixes #862

  • integration test for this scenario (should fail at first)
  • the actual fix
  • add an occ command to manually trigger migration of a group (e.g. in case of only partial user migrations)
  • maybe add an occ command to see pending migrations have a repair step instead
  • possibly also add a test to clean up old members from already migrated groups

Also contains a drive-by fix. I noticed that the list of groups is set newly on every repair step run. Commit 541cfdd fixes this.

failing test proof

Screenshot_20240704_205417

@blizzz blizzz self-assigned this Jul 4, 2024
@blizzz blizzz force-pushed the fix/862/migrate-members-also branch 2 times, most recently from 53effdd to 7762d3b Compare July 4, 2024 18:43
@blizzz blizzz force-pushed the fix/862/migrate-members-also branch from 7762d3b to 6063847 Compare July 4, 2024 18:49
@blizzz blizzz force-pushed the fix/862/migrate-members-also branch from dba2f40 to e2604db Compare July 9, 2024 10:43
@blizzz

This comment was marked as resolved.

@blizzz blizzz marked this pull request as ready for review July 11, 2024 11:39
@blizzz blizzz force-pushed the fix/862/migrate-members-also branch 2 times, most recently from 4de43a1 to f5513a5 Compare July 17, 2024 11:43
Comment on lines +285 to +289
And I "disable" the app "user_saml"
And the local group "Astrophysics" is created
And I hack "student2" into existence
And the user "student2" is added to the group "Astrophysics"
And I "enable" the app "user_saml"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is plain awful, but I did not come up with any other way to resemble this situation. Easier would be issuing direct SQL queries, however this would be written again and support all DB flavours, and detect what is running on which port.

aka "occ saml:group-migration:copy-incomplete-members"

Signed-off-by: Arthur Schiwon <[email protected]>
@blizzz blizzz force-pushed the fix/862/migrate-members-also branch from f5513a5 to 244abb4 Compare July 17, 2024 15:34
$this->groupMigration->cleanUpOldGroupUsers($gid);
} catch (Exception $e) {
$this->logger->warning('Error while cleaning up group members in (oc_)group_user of group (gid) {gid}', [
'app' => 'user_saml',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't the app already set when getting the LoggerInterface through DI?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't the app already set when getting the LoggerInterface through DI?

I am never sure of that 🙈 Sometimes you see logs without an app set.

@blizzz blizzz merged commit 12304d9 into master Jul 18, 2024
45 checks passed
@blizzz blizzz deleted the fix/862/migrate-members-also branch July 18, 2024 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Group migration does not take over memberships
2 participants