Skip to content

Feature-Flag: org/project feature flags with DB#789

Open
vprashrex wants to merge 7 commits intofeature/assessmentfrom
feature/feature-flag
Open

Feature-Flag: org/project feature flags with DB#789
vprashrex wants to merge 7 commits intofeature/assessmentfrom
feature/feature-flag

Conversation

@vprashrex
Copy link
Copy Markdown
Collaborator

@vprashrex vprashrex commented Apr 27, 2026

Summary

Target issue is #790
Explain the motivation for making this change. What existing problem does the pull request solve?

This PR introduces a persistent feature-flag system scoped by organization_id and optional project_id, and applies it to control access to Feature flagged APIs.

Previously, Assessment functionality was not centrally gated per tenant/project, so rollout control was limited and risky. This change solves that by adding:

  1. A feature_flag model + migration + CRUD operations.
  2. Admin APIs to create/update/delete/list flags (/feature-flags) and a resolved flags endpoint (/features).
  3. A reusable require_feature(...) permission dependency that can be used at the top route level or at independent endpoints.
  4. Assessment route protection behind FeatureFlag.ASSESSMENT.

Checklist

Before submitting a pull request, please ensure that you mark these task.

  • Ran fastapi run --reload app/main.py or docker compose up in the repository root and test.
  • If you've fixed a bug or added code that is tested and has test cases.

Notes

Please add here if any other information is required for the reviewer.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 27, 2026

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

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 988b642a-7d12-4bcb-8d7e-239d61a64612

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/feature-flag

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 and usage tips.

@vprashrex vprashrex changed the base branch from main to feature/assessment April 27, 2026 16:04
@vprashrex vprashrex changed the title Feature/feature flag Flag: Feature Flag Apr 28, 2026
@vprashrex vprashrex self-assigned this Apr 28, 2026
@vprashrex vprashrex added the enhancement New feature or request label Apr 28, 2026
@vprashrex vprashrex changed the title Flag: Feature Flag Feature-Flags: add org/project-level feature flag APIs and gate assessment routes Apr 28, 2026
@vprashrex vprashrex changed the title Feature-Flags: add org/project-level feature flag APIs and gate assessment routes Feature-Flags: add org/project feature flags and gate assessment routes Apr 28, 2026
@vprashrex vprashrex changed the title Feature-Flags: add org/project feature flags and gate assessment routes feature-flag: org/project feature flags with DB Apr 28, 2026
@vprashrex vprashrex changed the title feature-flag: org/project feature flags with DB Feature-Flag: org/project feature flags with DB Apr 28, 2026
@vprashrex vprashrex linked an issue Apr 28, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Feature-Flag: feature toggle system for controlled rollout

1 participant