feat(feature-flags): AppConfig-backed gated feature flags#5059
feat(feature-flags): AppConfig-backed gated feature flags#5059TheodoreSpeaks wants to merge 3 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryMedium Risk Overview The previous Reviewed by Cursor Bugbot for commit d13b230. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d0e0660. Configure here.
…ked-feature-flag # Conflicts: # apps/sim/app/(auth)/components/oauth-provider-checker.tsx # apps/sim/app/(auth)/signup/page.tsx # apps/sim/app/api/webhooks/agentmail/route.ts # apps/sim/ee/access-control/utils/permission-check.ts # apps/sim/lib/copilot/tools/handlers/function-execute.ts # apps/sim/lib/copilot/tools/server/files/touch-plan.test.ts # apps/sim/lib/copilot/tools/server/files/touch-plan.ts # apps/sim/lib/copilot/tools/server/router.ts # apps/sim/lib/core/config/feature-flags.ts # apps/sim/lib/core/security/input-validation.server.ts # apps/sim/lib/table/service.ts # apps/sim/lib/webhooks/processor.ts

Summary
lib/core/config/feature-flags.ts: runtime feature flags gated by org id, user id, or admin — AppConfig-backed on prod (reusesfetchAppConfigProfile), with an in-fileDEFAULT_FEATURE_FLAGSfallback off-prod (no env var)feature-flags.ts→env-flags.ts(it was never gated flags); rewrote all importers + the shared test mock (featureFlagsMock→envFlagsMock)isPlatformAdmin(userId)reading the DB replica (dbReplica); only queries whenadminsis the deciding clauseadd-feature-flagskill for Claude + Cursorfeature-flagsAppConfig ConfigurationProfile alongsideaccess-controlType of Change
Testing
Tested manually. New
feature-flags.test.ts(13 tests) + renamed-mock consumers pass.bun run lint,check:api-validation:strict,tsc --noEmit, andcdk synthall clean.Checklist