Skip to content

Conversation

@jessicamack
Copy link
Member

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
  • Bug, Docs Fix or other nominal change
COMPONENT NAME
  • Other
ADDITIONAL INFORMATION
awx: 24.6.2

@codecov
Copy link

codecov bot commented Jul 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.49%. Comparing base (1330a1b) to head (ca209ad).
Report is 3 commits behind head on devel.

✅ All tests successful. No failed tests found.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

"""

# get object roles for membership on teams
ObjectRole = apps.get_model('dab_rbac', 'ObjectRole')
Copy link
Member

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.

Copy link
Member Author

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?

Copy link
Member Author

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

Copy link
Member Author

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?

@jessicamack jessicamack requested a review from AlanCoding July 9, 2025 10:28
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jul 9, 2025

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.

3 participants