Skip to content

feat(deleter): project delete publishes the app.project.deleted event - #2014

Open
AmanGIT07 wants to merge 1 commit into
feat/project-delete-soft-resourcesfrom
feat/project-deleted-event
Open

AmanGIT07 wants to merge 1 commit into
feat/project-delete-soft-resourcesfrom
feat/project-deleted-event

Conversation

@AmanGIT07

Copy link
Copy Markdown
Contributor

Summary

The project delete now publishes the app.project.deleted event. The event name already existed and is offered as a webhook event, but nothing published it; project created, updated, and member events were already published. It goes out once the project row is deleted, for the DeleteProject RPC and for each project an organization delete removes, the same way the organization delete publishes app.organization.deleted. Stacked on #2013.

Changes

  • core/deleter/service.go: after DeleteModel, deleteProject publishes app.project.deleted with the project as the target and the project's organization. A project that was already gone returns without an event. A failure to publish is logged and does not fail the delete.

Test Plan

  • core/deleter/service_test.go TestDeleteProject: a delete publishes one app.project.deleted event with the project's organization and the project as the target; a project that was already gone publishes nothing.
  • e2e TestProjectDeleteKeepsTheRowAndRemovesAccess: one app.project.deleted event for the project after the delete.
  • e2e TestOrganizationDeleteAlsoDeletesDisabledProjectsAndGroups: one app.project.deleted event for each project of the deleted organization, the disabled one included.
  • Without the publish, the unit case and both e2e checks fail.
  • go test ./core/... ./internal/api/... ./pkg/server/... passes.
  • e2e TestEndToEndAPIRegressionTestSuite, TestEndToEndServiceUsersRegressionTestSuite and TestEndToEndPATRegressionTestSuite pass.
  • golangci-lint run ./core/deleter/... ./test/e2e/regression/... reports no issues.

@vercel

vercel Bot commented Oct 21, 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 22, 2026 10:56am UTC

@coderabbitai

coderabbitai Bot commented Oct 21, 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

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
  • 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 21, 2026 •

Copy link
Copy Markdown

Coverage Report for CI Build 39763881720

Coverage remained the same at 55.652%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: 2 uncovered changes across 1 file (5 of 7 lines covered, 71.43%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
core/deleter/service.go 7 5 71.43%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 41867
Covered Lines: 23300
Line Coverage: 55.65%
Coverage Strength: 19.32 hits per line

💛 - Coveralls

@AmanGIT07

Copy link
Copy Markdown
Contributor Author

Sandbox run: a local Frontier server with Postgres and SpiceDB in Docker, called over the Connect protocol. The binary was built from #2014 with #2011 applied, so it has main plus #2008, #2011, #2013 and #2014.

Deletion config used (for the projects with resources):

app:
  deletion:
    enabled: true
    resources:
      resource/aoi: { project: block, organization: allow }
      resource/workflow: { project: block, organization: allow }
      resource/orderitem: { project: block_unless_deletable, organization: block_unless_deletable }
      resource/insight: { project: allow, organization: allow }

resource/report has no rule.

app.project.deleted events

Counted in the auditlogs table (log.audit_events: db).

Check Expected Observed
Delete an empty project 1 1
Delete a project after its blocking resources were deleted 1 1
Delete a disabled project holding an insight 1 1
Delete an org with two projects, one disabled: events per project 1, 1 1, 1

The project.deleted audit records for the same deletes were written as before:

Check Expected Observed
Delete an empty project: project.deleted audit records 1 1
Delete an org with two projects: audit records per project 1, 1 1, 1

The project delete now publishes app.project.deleted once the project row
is deleted, for the DeleteProject RPC and for each project an org delete
removes. A project that was already gone publishes nothing.

This branch was successfully deployed

1 active deployment
Preview — 1cdfbdc6 Deployed Oct 22, 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