-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Migrate nested team memberships to direct team memberships #16052
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
Migrate nested team memberships to direct team memberships #16052
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. 🚀 New features to boost your workflow:
|
| """ | ||
|
|
||
| # get object roles for membership on teams | ||
| ObjectRole = apps.get_model('dab_rbac', 'ObjectRole') |
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.
There's another model from the old API, the main.Role model. This is synchronized with thew new models (this model) via signals, but signals don't run in migrations. So the simplest solution might be to mirror your changes in both models.
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.
making sure I understand, by mirror the changes you mean just do the same process with Role?
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.
figuring out the two failing tests and from the wording would this test actually need to be removed since it's testing giving a team read permissions to another team or is that still acceptable? https://github.com/ansible/awx/blob/devel/awx/main/tests/functional/dab_rbac/test_translation_layer.py#L177-L187
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.
second test looks like another case of a team on team
expectation. that should fail I would think though not sure why they're both failing now. maybe because of the setting addition now? https://github.com/ansible/awx/blob/devel/awx/main/tests/functional/test_fixture_factories.py#L47-L59. might be useful to pull out the team on teams part and make that an expected fail test?
|



SUMMARY
Adds a migration to directly place users in any teams that they are indirectly a member of and then remove the nested team relationship.
ISSUE TYPE
COMPONENT NAME
ADDITIONAL INFORMATION