• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

raystack / frontier / 27183912904
43%
main: 43%

Build:
Build:
LAST BUILD BRANCH: fix/resource-update-reconcile
DEFAULT BRANCH: main
Ran 09 Jun 2026 04:34AM UTC
Jobs 1
Files 276
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

09 Jun 2026 04:29AM UTC coverage: 43.454% (-0.03%) from 43.481%
27183912904

Pull #1683

github

whoAbhishekSah
fix(role): cascade policy + rolebinding cleanup on role delete

Deleting a role removed its app/role:<id>#<perm> tuples and the role row,
but never touched the policies bound to it. Because policies.role_id has a
foreign key to roles(id) with no ON DELETE rule, deleting an in-use role
actually failed with a foreign-key violation -- after the role's permission
tuples had already been stripped from SpiceDB, leaving a half-deleted role
that still existed in the DB but granted nothing.

role.Delete now cascades first: it deletes every policy bound to the role
(which also removes each policy's app/rolebinding:<id> tuples), then the
role's permission tuples, then the role row.

Wiring: policy.Service gains DeleteAllByRole; role.Service gains a narrow
PolicyService interface injected via SetPolicyService after construction
(policy depends on role, so the back-reference can't be set at construction).

The org-delete cascade in core/deleter already deletes policies before
roles, so this introduces no double-delete there.

Adds an e2e regression test: create role + policy, delete the role, assert
no policy, rolebinding tuple, or role->permission tuple remains.

Refs #1661

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Pull Request #1683: fix(role): cascade policy + rolebinding cleanup on role delete

0 of 25 new or added lines in 3 files covered. (0.0%)

1 existing line in 1 file now uncovered.

16562 of 38114 relevant lines covered (43.45%)

12.18 hits per line

Uncovered Changes

Lines Coverage ∆ File
13
46.85
-2.68% core/role/service.go
10
74.38
-4.96% core/policy/service.go
2
0.0
0.0% cmd/serve.go

Coverage Regressions

Lines Coverage ∆ File
1
46.85
-2.68% core/role/service.go
Jobs
ID Job ID Ran Files Coverage
1 27183912904.1 09 Jun 2026 04:34AM UTC 276
43.45
GitHub Action Run
Source Files on build 27183912904
  • Tree
  • List 276
  • Changed 3
  • Source Changed 0
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Pull Request #1683
  • PR Base - main (#27183829692)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc