Repository navigation
Conversation
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.
|
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 40364592779Coverage remained the same at 55.877%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
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 #2022 and #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, five 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.RESOURCES_EXIST, and 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
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
go test ./test/e2e/...passes.make lintreports no issues.