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

Teams and Team Roles #169

Merged
merged 108 commits into from
Apr 5, 2024
Merged

Teams and Team Roles #169

merged 108 commits into from
Apr 5, 2024

Conversation

timalces
Copy link
Contributor

@timalces timalces commented Feb 1, 2024

Adds new Team and TeamRole objects, allowing users assigned to the same team to have access to the same clusters.

This can be tested with the work in progress openstack service branch exp/teams-2

  • Users no longer have a project or billing account
  • Instead projects and billing accounts are part of new Team records
  • Racks now belong to a team rather than a user
  • Non root users can be added to a team by creating a TeamRole. They can be assigned either as a member or admin of the team
  • Currently the only difference between team members and admins is that admins can manage the team's team roles
  • All users assigned to a team can see and interact with all of their racks

team_rack_view

  • Users can be assigned to any number of teams
  • The interactive rack view for a user will automatically update if they gain/lose a team role

adding_to_team

  • Root users are now 'super admins' and can view all racks and manage all team roles
  • All users can access a teams page, which shows all teams they can view (if any)

Screenshot from 2024-02-01 13-05-17

  • This page allows for searching by team, and by the name of any of the team's users
  • Admin users can similarly view the team roles for a team

Screenshot from 2024-02-01 13-07-12

  • On the users page (only accessible by super admins), you can now search by team names (e.g. searching for 'Biochemistry' will show all users that are part of that team)
  • API endpoints added/ updated and example scripts included
  • Tests have been added, but many for other aspects of concertim fail due to breaking changes (see below)

Further updates/fixes needed

This must not be merged to main until the below is completed:

  • Update/fix updating and deleting users
  • Update/fix cluster creation. Users will need to choose which team the cluster should be part of
  • Update/fix key pair management. This may need some thought/investigation, as keypairs are user specific, but may be used in cluster creation (with the cluster shared with others in the team)
  • Update/fix view invoices, which now belong to a team rather than user
  • Update/fix making credit deposits
  • Update/fix device/rack status change requests

The openstack service will similarly need updating, e.g. to create racks against teams rather than users

@timalces timalces requested a review from benarmston February 1, 2024 15:36
Copy link
Collaborator

@benarmston benarmston left a comment

Choose a reason for hiding this comment

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

I'm still part way through reviewing this, but I have some comments so far. In addition to the below I can't see a data migration for moving existing racks from users to teams. Is this intentional? If we're relying on deleting everything and recreating it, has any thought on how to migrate the metrics been given?

app/models/ability.rb Outdated Show resolved Hide resolved
app/models/team.rb Outdated Show resolved Hide resolved
app/models/team.rb Show resolved Hide resolved
app/presenters/team_role_presenter.rb Show resolved Hide resolved
app/views/api/v1/teams/index.rabl Outdated Show resolved Hide resolved
config/routes.rb Outdated Show resolved Hide resolved
app/controllers/users_controller.rb Show resolved Hide resolved
Copy link
Collaborator

@benarmston benarmston left a comment

Choose a reason for hiding this comment

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

I think I've finished my review though I may have further feedback when I can see the who thing together. In addition to my earlier comments, I also have the following feedback.

  • The validation check for the uniqueness of team names should strip whitespace.
  • There is currently no mechanism to add credits to a team. I presume that this is intended for a future PR.
  • I wonder if showing the Project ID and Billing Account ID in the team page for non-super-admin users is useful.
  • When removing a user from a team, "Delete" sounds scary. It should probably be renamed to "Remove from group" or something similar.

@benarmston
Copy link
Collaborator

Should have added this to an earlier comment, but I'll add it now. This is looking good. There is obviously more work to be done, but what you have looks nice.

@timalces timalces force-pushed the exp/teams branch 2 times, most recently from 6f737e5 to 42df008 Compare February 9, 2024 14:01
@benarmston
Copy link
Collaborator

@timalces I haven't seen anything requesting me to re-review this, so I assume that its not yet ready. If I've missed anything let me know.

Copy link
Collaborator

@benarmston benarmston left a comment

Choose a reason for hiding this comment

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

Thanks for making those changes. I have a question about the delete racks migration, but other than this it looks good as far as it goes.

app/presenters/team_role_presenter.rb Show resolved Hide resolved
db/migrate/20240205140356_destroy_racks.rb Outdated Show resolved Hide resolved
@timalces timalces changed the title WIP - Teams and Team Roles Teams and Team Roles Apr 5, 2024
@timalces timalces merged commit e332c92 into main Apr 5, 2024
3 checks passed
@timalces timalces deleted the exp/teams branch April 5, 2024 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants