Repository navigation
feat(feature-toggles): persist per-guild toggles in db - #614
Conversation
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 35 minutes and 1 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (9)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Size Change: +20 B (+0.01%) Total Size: 326 kB 📦 View Changed
ℹ️ View Unchanged
|
c0b948f to
edf02d5
Compare
|
* feat(feature-toggles): persist per-guild toggles in db with prisma * test(feature-toggles): update toggle route tests for db persistence * test: cover toast handlers in use-features and feature-toggle-service
…pec (#902) ## Summary The `autoMessagesExecutor.spec.ts` landed in #901 relied on ambient jest types. It passed in isolated `npx jest` runs (looser typing path) but fails under `npm run test:ci --workspace=packages/shared` (the workspace invocation, which is `jest --ci --silent` and enforces the shared package's strict tsconfig — which does not include `@types/jest` in `types`). ## What changed - Adds `import { describe, expect, it, jest } from '@jest/globals'` — matches the shared convention used by `PremiumService.spec.ts`, `LastFmLinkService/index.spec.ts`, and `SpotifyLinkService/index.spec.ts`. - Updates mock typing from the legacy `jest.fn<R, [Args]>()` two-arg form to `@jest/globals`'s required single-type-arg `jest.fn<Fn>()` form. ## Verification - `npx jest --config packages/shared/jest.config.cjs --ci --silent packages/shared/src/services/guildAutomation/autoMessagesExecutor.spec.ts` — 4/4 passing - `npm run test:ci --workspace=packages/shared` — failing test-suite count drops from 3 to 2 (this spec is no longer one of them). The remaining 2 failures (`FeatureToggleService.spec.ts`, `__tests__/utils/spotify/artistApi.test.ts`) are pre-existing tech debt last touched in #762/#614/#648 respectively, out of scope for this fix. ## Why this slipped through #901 PR #901 was merged on `UNSTABLE` while `Quality Gates` (the workspace test:ci runner) was still in flight. The check that would have caught this never reported before merge. Going forward, prefer waiting for `Quality Gates` on PRs touching `packages/shared`. ## Test plan - [x] `npm run test:ci --workspace=packages/shared` locally — autoMessagesExecutor spec green - [ ] Quality Gates check on this PR (the one we should have waited for) Refs: #901 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes * **Tests** * Improved test infrastructure with enhanced type safety for mock functions. --- **Note:** This release contains internal test improvements with no changes to user-facing functionality. <!-- review_stack_entry_start --> [](https://app.coderabbit.ai/change-stack/LucasSantana-Dev/Lucky/pull/902?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) <!-- review_stack_entry_end --> <!-- end of auto-generated comment: release notes by coderabbit.ai -->



Summary
GuildFeatureTogglePrisma model withguildId + nameunique constraintPOST /api/guilds/:id/features/:nameto upsert toggle state in DBFeatureToggleService.isEnabledForGuildchecks DB override before Unleash/fallbackfeaturesStoreupdate actions — errors now surface to UIuseFeaturesfor failed toggle updatesTest plan
setGuildFeatureTogglemock added, POST response asserts new format{success, guildId, name, enabled}guild_feature_togglestable with FK toguildsnpx prisma migrate deploy🤖 Generated with Claude Code