Skip to content

feat(Feature Lifecycle): Update API with feature lifecycle info#7789

Merged
emyller merged 25 commits into
mainfrom
feat/feature-lifecycle-api-endpoints
Jun 24, 2026
Merged

feat(Feature Lifecycle): Update API with feature lifecycle info#7789
emyller merged 25 commits into
mainfrom
feat/feature-lifecycle-api-endpoints

Conversation

@emyller

@emyller emyller commented Jun 16, 2026

Copy link
Copy Markdown
Contributor
  • 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 #7433

  1. Introduces a new endpoint (also to MCP) /api/v1/environments/{environment}/feature-lifecycle-counts/
    {
      "NEW": 475,
      "LIVE": 734,
      "PERMANENT": 190,
      "STALE": 374,
      "NEEDS_MONITORING": 30,
      "TO_REMOVE": 197
    }
  2. Adds new query params to the existing GET /api/v1/projects/{project_pk}/features/ (list):
    • lifecycle_stage: one of stages below; requires environment.
  3. Adds a new attribute lifecycle_stage to the above list endpoint, and also to .../{feature_id} (retrieve), also carrying one of stages below.

Stages logical propositions are as follows:

State Condition
PERMANENT has_permanent_tag
LIVE ~has_permanent_tag AND ~has_stale_tag AND has_code_references
NEW ~has_permanent_tag AND ~has_stale_tag AND ~has_code_references
STALE ~has_permanent_tag AND has_stale_tag AND has_code_references
NEEDS_MONITORING ~has_permanent_tag AND has_stale_tag AND ~has_code_references AND evaluated_recently
TO_REMOVE ~has_permanent_tag AND has_stale_tag AND ~has_code_references AND ~evaluated_recently

How did you test this code?

  • New tests
  • Will gradually roll out in production and collect perf data
  • LLM-assisted benchmarking (does not represent production):
method: synthetic data, InfluxDB analytics backend, local Docker (indicative)
baseline: main's list/detail query path (already annotates code-refs), no lifecycle

small_project:        # 1K flags, 200 in use
  influxdb_query: ~80ms
  feature_list:
    baseline_main: ~2ms
    pr_no_stage_filter: ~40ms
    pr_filtered_by_stage: ~85ms
  feature_detail:
    baseline_main: ~1ms
    pr_with_lifecycle: ~35ms
  stage_counts_endpoint: ~55ms   # new in PR, no baseline

stress_test:          # 30K flags, 600 in use — deliberate worst-case
  influxdb_query: ~120ms
  feature_list:
    baseline_main: ~8ms
    pr_no_stage_filter: ~0.12s
    pr_filtered_by_stage: ~0.45s
  feature_detail:
    baseline_main: ~1ms
    pr_with_lifecycle: ~70ms
  stage_counts_endpoint: ~0.35s

How to review

Reviewing is easier if you split:

  • Part 1: InfluxDB API refactor (to enable tests) — it revealed we need to rewrite it, or maybe invest in something else.
  • Part 2: Feature Lifecycle stage counts API (to feed the count badges in the sidebar.
  • Part 3: Extend the feature list and retrieve endpoints with lifecycle stage information.
  • Part 4: Add filter by lifecycle stage capability to the feature list endpoint.

@emyller emyller self-assigned this Jun 16, 2026
@vercel

vercel Bot commented Jun 16, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Jun 24, 2026 8:07pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
flagsmith-frontend-preview Ignored Ignored Preview Jun 24, 2026 8:07pm
flagsmith-frontend-staging Ignored Ignored Preview Jun 24, 2026 8:07pm

Request Review

@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 Jun 16, 2026
@kyle-ssg kyle-ssg mentioned this pull request Jun 16, 2026
4 tasks
@emyller emyller force-pushed the feat/feature-lifecycle-api-endpoints branch from 613356f to 69b78cd Compare June 17, 2026 03:34
@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 Jun 17, 2026
@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.61%. Comparing base (d991940) to head (019b529).
⚠️ Report is 12 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7789      +/-   ##
==========================================
+ Coverage   98.59%   98.61%   +0.01%     
==========================================
  Files        1472     1481       +9     
  Lines       57370    58068     +698     
==========================================
+ Hits        56564    57262     +698     
  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.

@emyller emyller force-pushed the feat/feature-lifecycle-api-endpoints branch from 3bbd50f to e75211b Compare June 17, 2026 03:49
@github-actions github-actions Bot added the docs Documentation updates label Jun 17, 2026
@github-actions github-actions Bot added feature New feature or request and removed feature New feature or request docs Documentation updates labels Jun 17, 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 Jun 24, 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 Jun 24, 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 Jun 24, 2026
@emyller emyller requested a review from khvn26 June 24, 2026 15:16
@github-actions github-actions Bot added the docs Documentation updates label Jun 24, 2026
@github-actions github-actions Bot added feature New feature or request and removed feature New feature or request docs Documentation updates labels Jun 24, 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 Jun 24, 2026
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.

Improve API support for feature lifecycle dashboard

4 participants