Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
13 tasks done
Coverage Report for CI Build 40710379612Coverage remained the same at 55.922%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
10 tasks done
AmanGIT07
force-pushed
the
feat/user-delete-check
branch
from
October 27, 2026 12:12
1d4bf3c to
56bcc6a
Compare
AmanGIT07
force-pushed
the
test/user-delete-check
branch
from
October 27, 2026 12:12
e75f617 to
bf85b84
Compare
rohilsurana
reviewed
Oct 28, 2026
The admin user delete is refused with one violation per blocker across the user's orgs, including a negative token balance and a paid subscription, and nothing changes until the blockers are cleared. Orgs where the user is the only member are deleted with the user, including a disabled org and one whose only other member is a service user. A failure injected at the org delete, the removal from another org and the user row stops the delete, and each retry continues from where the last one stopped.
AmanGIT07
force-pushed
the
test/user-delete-check
branch
from
October 28, 2026 14:53
bf85b84 to
16df0ba
Compare
rohilsurana
approved these changes
Oct 29, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #2027. Merge #2027 first.
Summary
End-to-end tests for the user delete check in #2027. The admin user delete is refused while anything blocks it, and nothing changes. It deletes the orgs where the user is the only member. After a failed step, the next try continues from where the last one stopped.
Changes
test/e2e/regression/api_test.go:TestUserDeleteWithOrgs, six cases:SOLE_OWNER_WITH_MEMBERSandNEGATIVE_TOKEN_BALANCE. The user, the orgs, the balance and the user's membership stay as they were. Once that org has a second owner and the usage is refunded, the delete goes through: the orgs where the user was alone are deleted, and the shared org stays without the user.RESOURCES_EXIST, and the message names the org:user cannot be deleted yet: organization[user-delete-check-disk]: RESOURCES_EXIST. The user's other, empty org is not deleted. Once the disk is gone, the delete goes through.test/e2e/regression/billing_test.go:TestUserDeleteRefusedWhileAnOrgHasAPaidSubscription. A paid subscription in an org where the user is the only member refuses the delete withACTIVE_SUBSCRIPTION. The user, the org and the subscription stay.signUpUserandrequireDeleteRefusedare shared by both suites.Technical Details
orgHasUserlooks at both lists ofListOrganizationUsers.usershides deleted users, whilerole_pairscomes from the org's live policies, so onlyrole_pairswould still show a policy left behind after the delete.ListOrganizationUsersrefuses a disabled org, so the disabled org case counts the user's live policies on it in the database.TestUserDeleteLeavesNoAccessAndNoLivePolicy, from fix(deleter): user delete removes every policy the user holds #2022.UNPAID_INVOICE. The test only checks thatACTIVE_SUBSCRIPTIONis among the violations. An unpaid invoice cannot be set up locally for the delete.TestConsentInsertFailureRollsBackTheUser: fixed names and emails in the function bodies, no SQL built from strings, and a deferred cleanup that drops them even when the test fails. The trigger onusersmatches both a delete and a soft delete, so it keeps working after feat(store): user delete keeps the row #2023.project.Service.DeleteModelremoves a project's relations before its row. After the injected failure on the row, the API answers permission denied for that project, even to an admin, until a retry finishes the delete. The test checks the project row in the database instead.Test Plan
role_pairs; theuserslist alone misses it), the removal from a disabled org failing, and an injected failure moved one step earlier (the project's policies, or the sessions).go test ./test/e2e/...passes.make lintreports no issues.