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

Migrates the OSUser associated with a facility user when migrating users. #11348

Merged
merged 2 commits into from
Oct 4, 2023

Conversation

rtibbles
Copy link
Member

@rtibbles rtibbles commented Oct 3, 2023

Summary

  • Migrates the OSUser associated with a local user when migrating them to a user imported from remote
  • Should maintain os user based login for apps using the get_os_user capability

References

Reviewer guidance

  • Run using the app integration testing script in a fresh KOLIBRI_HOME
  • Open Kolibri using the special URL printed by the app integration script
  • Use the 'on my own' workflow
  • Go the user profile page
  • Join a facility
  • Logout
  • Reopen Kolibri using the special URL
  • Confirm that you are now logged in as the migrated user in the facility (and that it hasn't created a new user)

Testing checklist

  • Contributor has fully tested the PR manually
  • If there are any front-end changes, before/after screenshots are included
  • Critical user journeys are covered by Gherkin stories
  • Critical and brittle code paths are covered by unit tests

PR process

  • PR has the correct target branch and milestone
  • PR has 'needs review' or 'work-in-progress' label
  • If PR is ready for review, a reviewer has been added. (Don't use 'Assignees')
  • If this is an important user-facing change, PR or related issue has a 'changelog' label
  • If this includes an internal dependency change, a link to the diff is provided

Reviewer checklist

  • Automated test coverage is satisfactory
  • PR is fully functional
  • PR has been tested for accessibility regressions
  • External dependency files were updated if necessary (yarn and pip)
  • Documentation is updated
  • Contributor is in AUTHORS.md

@rtibbles rtibbles added the TODO: needs review Waiting for review label Oct 3, 2023
@github-actions github-actions bot added DEV: backend Python, databases, networking, filesystem... APP: User Re: User app (sign-in, sign-up, user profile, etc.) SIZE: small labels Oct 3, 2023
Copy link
Member

@nucleogenesis nucleogenesis left a comment

Choose a reason for hiding this comment

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

How would I go about testing this? Code makes sense and sounds like a good idea anyway 😄

@rtibbles
Copy link
Member Author

rtibbles commented Oct 4, 2023

Probably the best way would be for me to rebase this on release, so you can test the 'on my own' setup wizard flow in the app context, then have you join a facility, and confirm that it still properly logs you in to your migrated user when accessing via the special URL.

Copy link
Member

@jredrejo jredrejo left a comment

Choose a reason for hiding this comment

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

It makes sense to me. Being inside the try block I don't see any problem having this code. Worst case scenario would be not having the os_user created.

@rtibbles
Copy link
Member Author

rtibbles commented Oct 4, 2023

The only problem is that I managed to encode a non-existent import... Thanks Copilot!

@rtibbles rtibbles marked this pull request as draft October 4, 2023 18:46
Copy link
Member

@nucleogenesis nucleogenesis left a comment

Choose a reason for hiding this comment

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

Tested and works as expected 👍🏻

@rtibbles rtibbles marked this pull request as ready for review October 4, 2023 19:15
@rtibbles
Copy link
Member Author

rtibbles commented Oct 4, 2023

Test failure is a known flaky test.

@rtibbles rtibbles merged commit 0001015 into learningequality:release-v0.16.x Oct 4, 2023
@rtibbles rtibbles deleted the migrate_os_user branch October 4, 2023 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
APP: User Re: User app (sign-in, sign-up, user profile, etc.) DEV: backend Python, databases, networking, filesystem... SIZE: small SIZE: very small TODO: needs review Waiting for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants