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

Clean up member-less teams #6311

Closed
Tracked by #6320
gtsiolis opened this issue Oct 20, 2021 · 12 comments
Closed
Tracked by #6320

Clean up member-less teams #6311

gtsiolis opened this issue Oct 20, 2021 · 12 comments
Labels
component: dashboard meta: never-stale This issue can never become stale team: webapp Issue belongs to the WebApp team type: improvement Improves an existing feature or existing code

Comments

@gtsiolis
Copy link
Contributor

Bug description

While we now delete teams from the database when a user deletes a team (see #6273) we still have not resolved what happens to teams when the last team owner member tries to leave the team (see #4623).

This causes some confusion as users can not reuse a team name after leaving a team as the last team member, see #6273 (comment).

Some of these teams also surface on the team scope selector.

Screenshot 2021-10-20 at 9 24 02 AM

We should probably resolve #4623 first and then clean up the the database and remove member-less teams. 🗺️

Steps to reproduce

  1. Create a team
  2. Go to team members
  3. Leave the team
  4. Try creating a new team with the same name

Workspace affected

No response

Expected behavior

No response

Example repository

No response

Anything else?

No response

@gtsiolis gtsiolis added component: dashboard type: improvement Improves an existing feature or existing code feature: teams and projects [DEPRECATED] Please, use feature: organizations or feature: projects labels instead. team: webapp Issue belongs to the WebApp team labels Oct 20, 2021
@jldec jldec added this to Inbox in [DEPRECATED] Product Engineering Groundwork via automation Oct 20, 2021
@jldec jldec added this to Inbox in [DEPRECATED] Product Engineering Groundwork via automation Dec 21, 2021
@jldec
Copy link
Contributor

jldec commented Dec 21, 2021

/schedule

@roboquat
Copy link
Contributor

@jldec: Issue scheduled in the meta team (WIP: 0)

In response to this:

/schedule

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@laushinka
Copy link
Contributor

laushinka commented Mar 2, 2022

Apparently if an owner is the last one remaining and switches to a member role, then they are able to leave the team. Maybe we should not allow an owner to switch role as a member, when they are the last one remaining. The intention does not make sense either. I am not sure though how often this happens, or if it happens at all. Context[1]

@gtsiolis
Copy link
Contributor Author

gtsiolis commented Mar 2, 2022

Maybe we should not allow an owner to switch role as a member, when they are the last one remaining.

It makes sense to never allow users to change their own role in a team regardless if they are the last remaining member, right?

@laushinka
Copy link
Contributor

It makes sense to never allow users to change their own role in a team regardless if they are the last remaining member, right?

Hmm, I'm trying to think of cases but can't think of any, but maybe there would be some legitimate uses of this. Maybe @jldec has some thoughts wrt customer support.

@jldec
Copy link
Contributor

jldec commented Mar 13, 2022

It's reasonable for an owner to reduce their role to member, after they delegate ownership to someone else.
It's a problem if this leaves the team without any owners.
Since this is unlikely we're not going to work on this a.t.m.

@jldec jldec removed groundwork: scheduled feature: teams and projects [DEPRECATED] Please, use feature: organizations or feature: projects labels instead. labels Mar 13, 2022
@gtsiolis
Copy link
Contributor Author

It's reasonable for an owner to reduce their role to member, after they delegate ownership to someone else.

thought: Not sure if this is a common flow though. In such cases, usually, users are removed from a team following a process or they manually leave a team to clean up non-longer relevant information and teams. 💭

issue: Besides this, the cost of allowing users to lower their permissions keeps two issue around: a) orphaned teams without owners and b) empty teams as the last member can leave a team although we do not allow this for owners, see screenshot below.

issue: Also, this issue was originally created at the early days of teams and projects which has led to having empty and non-accessible teams listed in the team scope selector. Here's what I see on production for my account, see screenshot below. However, this could be individually resolved for users by introducing a way to delete teams from the admin dashboard, see #8523.

Last owner trying to leave a team Member-less teams
Screenshot 2022-03-14 at 5 01 36 PM Screenshot 2022-03-14 at 5 57 41 PM

suggestion: I agree this is an edge case and fixing this would have a low impact as the issue affects a very small fraction of users. Disallowing team owners to change their role to member could help avoid introducing more member-less teams or confusion.

@stale
Copy link

stale bot commented Jun 19, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the meta: stale This issue/PR is stale and will be closed soon label Jun 19, 2022
@gtsiolis
Copy link
Contributor Author

gtsiolis commented Jun 27, 2022

Closing, as this rendering issue in the team scope selector is not reproducible anymore.

However, there's a closely related and follow-up issue in #10166. Cc @jldec

@nidh-eesh
Copy link

@gtsiolis This problem still persists as I have ran into it today. Created a team, demoted myself to member accidentally, left the team hoping it would get deleted(I was the only member). And now locked out of using the team name as error outputs "Team name already in use".

@jldec
Copy link
Contributor

jldec commented Jul 18, 2022

@nidhinmanu - please see discord

The dashboard should have prevented this scenario by preventing self-removal from team of last team owner. Unfortunately you discovered a "loophole" by changing your role from owner to member.

@gtsiolis
Copy link
Contributor Author

gtsiolis commented Jul 18, 2022

Thanks for noticing, @nidhinmanu! Cc @jldec

FWIW, I've opened a new issue in #11452 for this specific bug, as this has been brought up a couple of times in the past.

@geropl geropl added meta: never-stale This issue can never become stale and removed meta: stale This issue/PR is stale and will be closed soon labels Aug 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: dashboard meta: never-stale This issue can never become stale team: webapp Issue belongs to the WebApp team type: improvement Improves an existing feature or existing code
Projects
Status: No status
Development

No branches or pull requests

6 participants