Skip to content

feat: Adopt the flagsmith entrypoint#7901

Draft
khvn26 wants to merge 1 commit into
mainfrom
feat/adopt-flagsmith-entrypoint
Draft

feat: Adopt the flagsmith entrypoint#7901
khvn26 wants to merge 1 commit into
mainfrom
feat/adopt-flagsmith-entrypoint

Conversation

@khvn26

@khvn26 khvn26 commented Jun 29, 2026

Copy link
Copy Markdown
Member

Thanks for submitting a PR! Please check the boxes below:

  • I have read the Contributing Guide.
  • I have added information to docs/ if required so people know about the feature.
  • I have filled in the "Changes" section below.
  • I have filled in the "How did you test this code" section below.

Changes

Closes #7891.

Adopts the flagsmith CLI entrypoint (from flagsmith-common) for container startup, replacing the bespoke sequencing in api/scripts/run-docker.sh.

  • run-docker.sh is reduced to a backwards-compatible shim (exec flagsmith "$@"), so anything invoking the script path or its verbs keeps working.
  • The image ENTRYPOINT is now flagsmith; APPLICATION_LOGGERS (previously defaulted in the shell script) moves to a Dockerfile ENV so logging is unchanged.
  • The startup verbs are driven by settings, set in app/settings/common.py from the databases actually configured.
  • The task processor in SaaS no longer migrates on every task start. Its task definition command becomes start task-processor.
  • The temporary startPeriod raised to 120s in fix(infra): Task processor tasks killed during startup by health check #7887 is lowered to 30s in both the prod and staging task-processor definitions, which comfortably covers the new single-boot startup.

How did you test this code?

End-to-end against a local environment, exercising each verb via the flagsmith entrypoint:

  • flagsmith migrate — waits for the DB, migrates the configured databases, creates the cache table.
  • flagsmith serve — waits for the DB, starts the API; /health/liveness served on :8000.
  • flagsmith start task-processor — the new task-definition command; binds :8000 and starts the worker threads.
  • flagsmith migrate-and-serve — runs migrate, then bootstrap (via FLAGSMITH_STARTUP_COMMANDS), then serves.

Replace the bespoke startup sequencing in run-docker.sh with the composite
verbs provided by the flagsmith-common `flagsmith` entrypoint:

- run-docker.sh becomes a thin `exec flagsmith "$@"` shim, kept for callers
  that reference the script path or its verbs directly.
- The image ENTRYPOINT is now `flagsmith`; the APPLICATION_LOGGERS default the
  shell script used to set moves to a Dockerfile ENV.
- Startup verbs are driven by new settings built from the configured databases
  (FLAGSMITH_MIGRATE_DATABASES, FLAGSMITH_WAIT_FOR_MIGRATIONS_DATABASES,
  FLAGSMITH_STARTUP_COMMANDS).
- The task processor task definition starts via `start task-processor` and no
  longer migrates on every task; migrations run once per deploy via the
  migration task. startPeriod drops from 120s to 30s for the faster boot.

flagsmith-common is temporarily sourced from its branch until the verbs are
released; revert to the PyPI release before merge (see pyproject TODO).

beep boop
@vercel

vercel Bot commented Jun 29, 2026

Copy link
Copy Markdown

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

3 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs Ignored Ignored Jun 29, 2026 3:30am
flagsmith-frontend-preview Ignored Ignored Jun 29, 2026 3:30am
flagsmith-frontend-staging Ignored Ignored Jun 29, 2026 3:30am

Request Review

@github-actions github-actions Bot added api Issue related to the REST API infrastructure feature New feature or request and removed infrastructure labels Jun 29, 2026
@codecov

codecov Bot commented Jun 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.62%. Comparing base (c153c3f) to head (e34f516).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7901   +/-   ##
=======================================
  Coverage   98.62%   98.62%           
=======================================
  Files        1487     1487           
  Lines       58493    58493           
=======================================
  Hits        57687    57687           
  Misses        806      806           

☔ View full report in Codecov by Harness.
📢 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.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proxy run-docker.sh to flagsmith entrypoint

1 participant