Skip to content

test(e2e): cover disabled org enforcement across resource RPCs - #1861

Open
AmanGIT07 wants to merge 2 commits into
feat/disabled-org-gatefrom
test/disabled-org-e2e
Open

test(e2e): cover disabled org enforcement across resource RPCs#1861
AmanGIT07 wants to merge 2 commits into
feat/disabled-org-gatefrom
test/disabled-org-e2e

Conversation

@AmanGIT07

@AmanGIT07AmanGIT07 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

End-to-end coverage for the disabled-org gate across project, group, resource, billing, and invitation RPCs.

Changes

  • Add a regression scenario: member works, org disabled, member gets FailedPrecondition on eight RPCs, non-member still gets PermissionDenied, superuser can list, export, read, and re-enable, member access is restored with no re-grants, and a disabled org can still be deleted
  • The non-member probe covers both the project id and the org name, so name references reveal nothing an id reference would not
  • Testbench header interceptor applies context headers to streaming client calls too (this suite's first streaming RPC)

Test Plan

  • make e2e-test passes locally
  • Build and type checking passes

@vercel

vercelBot commented Aug 7, 2026

Copy link
Copy Markdown

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

ProjectDeploymentActionsUpdated (UTC)
frontierReadyReadyPreviewAug 7, 2026 11:08am

@coderabbitai

coderabbitaiBot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 24645eb4-54a2-440e-b85d-af28decef6f0

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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 Aug 7, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 31172836601

Coverage decreased (-0.3%) to 47.867%

Details

  • Coverage decreased (-0.3%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 456 coverage regressions across 13 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

456 previously-covered lines in 13 files lost coverage.

Top 10 Files by Coverage LossLines Losing CoverageCoverage
billing/checkout/service.go1672.8%
billing/subscription/service.go10242.16%
internal/store/postgres/billing_plan_repository.go660.0%
billing/plan/service.go530.0%
core/event/service.go2056.18%
internal/api/v1beta1connect/billing_plan.go1493.0%
pkg/server/connect_interceptors/authorization.go140.0%
billing/plan/plan.go662.5%
billing/entitlement/service.go588.14%
cmd/reconcile.go444.32%

Coverage Stats

Coverage Status
Relevant Lines:39568
Covered Lines:18940
Line Coverage:47.87%
Coverage Strength:15.43 hits per line

💛 - Coveralls

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
test/e2e/regression/disabled_org_test.go (2)

148-156: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Assert that the export contains the disabled org.

exported > 0 passes even if the disabled org is absent, because other orgs exist in the suite. Collect the exported rows and check for orgID.


186-194: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Verify the deletion with a direct read.

The loop only checks the disabled listing. A GetOrganization call that returns CodeNotFound proves the delete cascade removed the org.

♻️ Proposed additional assertion
 _, err = s.testBench.Client.DeleteOrganization(ctxAdmin, connect.NewRequest(&frontierv1beta1.DeleteOrganizationRequest{Id: deleteOrgID}))
s.Assert().NoError(err)
+	_, err = s.testBench.Client.GetOrganization(ctxAdmin, connect.NewRequest(&frontierv1beta1.GetOrganizationRequest{Id: deleteOrgID}))+	s.Assert().Equal(connect.CodeNotFound, connect.CodeOf(err))+
// after the delete cascade the org must be gone from the admin listing

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: bb8aa701-105f-46a7-af78-bd67f91ef11f

📥 Commits

Reviewing files that changed from the base of the PR and between dd838bd and f8af5e4.

📒 Files selected for processing (2)
  • test/e2e/regression/disabled_org_test.go
  • test/e2e/testbench/helper.go

@AmanGIT07
AmanGIT07force-pushed the feat/disabled-org-gate branch 2 times, most recently from a6afcc2 to c06d96aCompareAugust 7, 2026 10:37
AmanGIT07and others added 2 commits August 7, 2026 16:08
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for freeto 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.

2 participants

@AmanGIT07@coveralls