-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Remove team when sole owner and remove projects #6721
Conversation
0ba0bf9
to
c4e44d6
Compare
Super cool, many thanks! Taking a look now 👀 |
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.
Thanks for implementing this clean-up! I think this is going to be really helpful. ✨
I've left a few thoughts and comments in-line. Please have a look, and decide whether to accept or decline my suggestions. 🙂
Also, I tried running through your test protocol, but faced a few problems:
Test 1:
- Create a team
I logged in with GitHub and created a new team, and copied the invite URL.
- Add a member to that team
I copied the invite URL, then opened a private browser tab, logged in with GitLab (created a new Gitpod account, which I needed to unblock), then visited the invite URL to join as a member.
- Add a project to that team
I (perhaps sneakily) decided to add the projects as the new GitLab member (and not the original GitHub team owner). Doing this, I ran into #6743 (probably unrelated to this PR, but maybe this is where things went wrong)
- Set one team as owner, one as member
This was already the case (the original GitHub team creator was already the owner, and the new GitLab invited member was already a member) so no action needed.
- Have the owner delete their user account. Expectation: team and project should be deleted.
When I deleted the original GitHub user account, I found in my private window (where the GitLab member was still logged in) that the team still existed, now without any owner, and that also the projects still existed:
Maybe I did something wrong? Or maybe it's the problem I noticed in the SQL query (see below)
Happy to discuss and/or clarify and/or help! 😇
@jankeromnes Thank you for all the insights and for taking the time! I will go through them one by one 🤗 |
7d0484a
to
a00cf38
Compare
/hold |
a00cf38
to
4f49b77
Compare
Codecov Report
@@ Coverage Diff @@
## main #6721 +/- ##
========================================
- Coverage 7.89% 6.16% -1.73%
========================================
Files 14 12 -2
Lines 1254 1086 -168
========================================
- Hits 99 67 -32
+ Misses 1152 1018 -134
+ Partials 3 1 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@jankeromnes I've applied the changes and have tested different cases manually as well, including the one you mentioned above. Ready for another review 🙏🏽 |
/unhold |
Many thanks Laurie! 🙏 Re-flagging myself for review so that I don't forget about this(!) |
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.
Perfection! 🎯 ✨ Works as advertised!
Many thanks for teaching Teams & Projects to clean up after them 🧹 🙏
LGTM label has been added. Git tree hash: 23629167ff47fd2535253cd2a7b2e8589de0d7c4
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jankeromnes Associated issue: #6655 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Description
Related Issue(s)
Fixes #6655
How to test
The testing is quite extensive.
Test 1:
Test 2:
Test 3:
Test 4:
Release Notes
Documentation