Skip to content

test(e2e): org delete hides the kyc row - #1995

Merged
rohilsurana merged 1 commit into
mainfrom
test/org-delete-hides-kyc
Oct 16, 2026
Merged

rohilsurana merged 1 commit into
mainfrom
test/org-delete-hides-kyc

Conversation

@rohilsurana

Copy link
Copy Markdown
Member

Summary

Deleting an org should also delete its KYC record. No end to end test checked this. This PR adds one.

Changes

  • New e2e test TestOrganizationDeleteHidesItsKyc.
  • The API regression suite now opens a database connection, so a test can look at rows the API does not show.

Technical Details

The test sets KYC on an org and deletes the org. It then checks four things.

  • The deleted org is not in the KYC list.
  • Reading the KYC of the deleted org gives an error, or an empty record.
  • The organizations_kyc row is still in the database, with deleted_at set and no live row left.
  • Setting KYC on the deleted org is refused, and a new org with the same name starts with no KYC.

The database check is the one that matters. The org is soft deleted too, so the API alone cannot tell whether the cascade deleted the KYC row. I made the org delete skip the KYC step for a moment. Only the database check failed, which shows it works. I then removed that change.

This test passes on main already. It documents current behaviour and guards it.

Test Plan

  • go test ./test/e2e/regression -run TestEndToEndAPIRegressionTestSuite -testify.m TestOrganizationDeleteHidesItsKyc passes
  • Same test fails when the org delete skips the KYC delete (change reverted)
  • go vet ./test/e2e/...
  • golangci-lint run ./test/e2e/... reports 0 issues
  • gofmt -l test/e2e reports nothing

@vercel

vercel Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
frontier Ready Ready Preview Oct 16, 2026 10:09am UTC

@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: raystack/frontier/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c023c987-9733-4c67-8a47-a510342e6389
📥 Commits

Reviewing files that changed from the base of the PR and between 22db2fd and ea0b626.

📒 Files selected for processing: 1
  • test/e2e/regression/api_test.go

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

📝 Summary

Summary by CodeRabbit

  • Tests
    • Added regression coverage verifying that deleting an organization hides its KYC information and prevents access to it.
    • Verified KYC updates are rejected for deleted organizations, and that recreating an organization under the same name does not restore its prior KYC information. These checks confirm the expected behavior across organization deletion and recreation.

The regression suite now owns a database client. A new test checks KYC behavior when an organization is deleted and recreated with the same name.

Changes: Organization KYC deletion

Layer / File(s) Summary
Database-backed deletion regression
test/e2e/regression/api_test.go
The suite opens and closes a database client. The new test checks that organization deletion hides KYC, leaves a soft-deleted database row, rejects KYC updates to the deleted organization, and does not restore KYC when the organization is recreated.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Suggested reviewers: amangit07, whoabhisheksah

Merge Risk: ⚪ Minimal · up to ea0b6

No actionable issue is established that should delay merging this regression test after normal checks.

Pre-merge checks: Passed 2
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coveralls

coveralls commented Oct 13, 2026 •

Copy link
Copy Markdown

Coverage Report for CI Build 38885275238

Coverage remained the same at 55.248%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 41723
Covered Lines: 23051
Line Coverage: 55.25%
Coverage Strength: 19.16 hits per line

💛 - Coveralls

@rohilsurana
rohilsurana marked this pull request as ready for review October 15, 2026 07:46
Comment thread test/e2e/regression/api_test.go
AmanGIT07
AmanGIT07 approved these changes Oct 16, 2026 •
@rohilsurana
rohilsurana force-pushed the test/org-delete-hides-kyc branch from 22db2fd to ea0b626 Compare October 16, 2026 10:08
@rohilsurana
rohilsurana merged commit 4098c75 into main Oct 16, 2026
8 checks passed
@rohilsurana
rohilsurana deleted the test/org-delete-hides-kyc branch October 16, 2026 10:14

This branch was successfully deployed

1 active deployment
Preview — ea0b626f Deployed Oct 16, 2026 by vercel[bot]
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.

3 participants