Skip to content

Conversation

@emyller
Copy link
Contributor

@emyller emyller commented Jan 2, 2026

Make it easier to run Flagsmith locally.

Changes

  • Add make reset command that resets the database to a known state.
  • Fix local server default settings.

make reset example

$ make reset
Flushing database...
Running migrations...
Creating cache table...
Seeding database with test data...

Database seeded successfully

Created entities:
  Organisation: Acme, Inc.
    Project: AI Booster
      Environments (3):
        Development
        Staging
        Production
      Features (6):
        dark_mode (FLAG, enabled)
        ai_assistant (FLAG, disabled)
        api_rate_limit (CONFIG)
        welcome_message (CONFIG)
        feature_config (CONFIG)
        beta_features (FLAG, enabled)
      Segments (3):
        Premium Users (with overrides)
        Beta Testers (with overrides)
        50% Rollout
      Identities (2):
        alice@example.com (with overrides)
        bob@example.com (with overrides)

Login credentials:
  Email: local@flagsmith.com
  Password: testpass1

Review effort: 2/5

@emyller emyller requested review from a team as code owners January 2, 2026 23:51
@emyller emyller requested review from adamvialpando and khvn26 and removed request for a team January 2, 2026 23:51
@vercel
Copy link

vercel bot commented Jan 2, 2026

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

3 Skipped Deployments
Project Deployment Review Updated (UTC)
docs Ignored Ignored Preview Jan 6, 2026 1:46am
flagsmith-frontend-preview Ignored Ignored Preview Jan 6, 2026 1:46am
flagsmith-frontend-staging Ignored Ignored Preview Jan 6, 2026 1:46am

@github-actions github-actions bot added api Issue related to the REST API docs Documentation updates feature New feature or request and removed docs Documentation updates labels Jan 2, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 2, 2026

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-e2e:pr-6459 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-api-test:pr-6459 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-api:pr-6459 Finished ✅ Results
ghcr.io/flagsmith/flagsmith:pr-6459 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-6459 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-frontend:pr-6459 Finished ✅ Results

@github-actions github-actions bot added the docs Documentation updates label Jan 2, 2026
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request docs Documentation updates labels Jan 2, 2026
@codecov
Copy link

codecov bot commented Jan 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.09%. Comparing base (38ac162) to head (a45b8b8).
⚠️ Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6459      +/-   ##
==========================================
+ Coverage   98.07%   98.09%   +0.02%     
==========================================
  Files        1294     1295       +1     
  Lines       46535    46751     +216     
==========================================
+ Hits        45637    45862     +225     
+ Misses        898      889       -9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions bot added the docs Documentation updates label Jan 3, 2026
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request docs Documentation updates labels Jan 3, 2026
@github-actions github-actions bot added the docs Documentation updates label Jan 3, 2026
@github-actions github-actions bot removed feature New feature or request docs Documentation updates labels Jan 3, 2026
@github-actions github-actions bot added the docs Documentation updates label Jan 6, 2026
@emyller
Copy link
Contributor Author

emyller commented Jan 6, 2026

One thing I'd like to see before I approve it: the command hidden behind a Django setting toggle, off by default, overridden in settings/local.py.

Addressed in c05a9c5.

@github-actions github-actions bot added feature New feature or request docs Documentation updates and removed feature New feature or request docs Documentation updates labels Jan 6, 2026
@github-actions github-actions bot added feature New feature or request docs Documentation updates and removed feature New feature or request docs Documentation updates labels Jan 6, 2026
@github-actions github-actions bot added docs Documentation updates feature New feature or request and removed feature New feature or request docs Documentation updates labels Jan 6, 2026
@emyller emyller marked this pull request as ready for review January 6, 2026 01:51
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Jan 6, 2026
ENABLE_ADMIN_ACCESS_USER_PASS = True

SKIP_MIGRATION_TESTS = True

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing testserver in ALLOWED_HOSTS for local settings

The reset_local_database command uses Django REST Framework's APIClient which makes requests with Host: testserver (Django's default for test clients). However, local.py only adds ".ngrok.io", "127.0.0.1", and "localhost" to ALLOWED_HOSTS, not "testserver". Since DEBUG defaults to False in common.py and isn't overridden in .env-local or local.py, Django will validate the Host header and reject all APIClient requests with a DisallowedHost exception. The tests pass because test.py both sets DEBUG = True and adds "testserver" to ALLOWED_HOSTS, but running make reset with local settings will fail.

Fix in Cursor Fix in Web

@emyller emyller marked this pull request as draft January 6, 2026 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api Issue related to the REST API feature New feature or request front-end Issue related to the React Front End Dashboard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants