Skip to content

chore(resource): remove the unused resource-config cache#1766

Merged
rohilsurana merged 1 commit into
mainfrom
chore/remove-dead-resource-cache
Jul 17, 2026
Merged

chore(resource): remove the unused resource-config cache#1766
rohilsurana merged 1 commit into
mainfrom
chore/remove-dead-resource-cache

Conversation

@rohilsurana

Copy link
Copy Markdown
Member

What

Removes the ResourcesRepository blob cache, which is dead code.

  • InitCache loaded the resource config into memory and refreshed it every 2 minutes, but
    nothing ever read it: GetAll and GetRelationsForNamespace have no callers, and
    resource.Service held the ConfigRepository but never called it.
  • Deleted internal/store/blob/resources_repository.go, the ConfigRepository interface,
    the YAML type, and the generated mock; dropped the configRepository field/param from
    resource.Service; removed the InitCache/refresh wiring from StartServer.

What is NOT changed

The boot-time resource config flow is untouched. MigrateSchema still seeds the SpiceDB
schema from the config, and the permission delete-guard still reads it — both go through
SchemaConfigRepository, which reads the blob bucket directly and never used this cache.
StartServer now passes that bucket straight to NewSchemaConfigRepository.

No behavior change; pure dead-code removal. Build, go test ./core/resource/... ./cmd/... ./internal/store/blob/..., and lint all pass.

@vercel

vercel Bot commented Jul 17, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
frontier Ready Ready Preview, Comment Jul 17, 2026 7:58am

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 3a8fc133-13f3-419c-b13b-2779327c36bf

📥 Commits

Reviewing files that changed from the base of the PR and between ef977a5 and 3e933eb.

📒 Files selected for processing (6)
  • cmd/serve.go
  • core/resource/mocks/config_repository.go
  • core/resource/resource.go
  • core/resource/service.go
  • core/resource/service_test.go
  • internal/store/blob/resources_repository.go
💤 Files with no reviewable changes (3)
  • core/resource/mocks/config_repository.go
  • internal/store/blob/resources_repository.go
  • core/resource/resource.go

📝 Walkthrough

Summary by CodeRabbit

  • Refactor
    • Simplified resource configuration loading by using blob storage directly.
    • Removed legacy resource caching and periodic refresh behavior.
    • Streamlined resource service setup and dependency wiring.
    • Updated internal test support to reflect the simplified configuration flow.

Walkthrough

The PR removes the resource configuration repository and YAML model, simplifies resource.Service construction, updates related tests, and replaces cached resource repository startup wiring with direct blob bucket usage. It also adds a Stripe client factory override hook.

Changes

Resource dependency cleanup

Layer / File(s) Summary
Resource service contract and tests
core/resource/resource.go, core/resource/service.go, core/resource/service_test.go, core/resource/mocks/config_repository.go
Removes ConfigRepository, YAML, and the config repository mock; simplifies NewService and updates test setup and destructuring.
Server blob and dependency wiring
cmd/serve.go, internal/store/blob/resources_repository.go
Removes cached resource repository startup and lifecycle handling, passes the blob bucket directly, updates schema repository construction, and adds GetStripeClientFunc.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: amangit07

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
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.

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

Copy link
Copy Markdown

Coverage Report for CI Build 29564793022

Coverage increased (+0.1%) to 46.11%

Details

  • Coverage increased (+0.1%) from the base build.
  • Patch coverage: 3 uncovered changes across 1 file (0 of 3 lines covered, 0.0%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
cmd/serve.go 3 0 0.0%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 38321
Covered Lines: 17670
Line Coverage: 46.11%
Coverage Strength: 13.32 hits per line

💛 - Coveralls

@rohilsurana
rohilsurana merged commit cfe2cf3 into main Jul 17, 2026
8 checks passed
@rohilsurana
rohilsurana deleted the chore/remove-dead-resource-cache branch July 17, 2026 08:10
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.

2 participants