Skip to content

feat: freeze flag editing when flag is in a running experiment#7888

Open
Zaimwa9 wants to merge 4 commits into
mainfrom
feat/experiment-flag-freeze
Open

feat: freeze flag editing when flag is in a running experiment#7888
Zaimwa9 wants to merge 4 commits into
mainfrom
feat/experiment-flag-freeze

Conversation

@Zaimwa9

@Zaimwa9 Zaimwa9 commented Jun 26, 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

When a flag belongs to a running experiment, the flag editing modal freezes controls to prevent skewing experiment data. Paused experiments allow editing. Frontend-only gate.

What's frozen:

  • Feature value toggle, remote value, and variation weights
  • Segment overrides (read-only, action buttons hidden)
  • Server-side only and archive toggles

What stays editable:

  • Description, tags, owners
  • Identity overrides

Implementation details:

  • useFeatureExperimentFreeze hook queries running experiments filtered by status, matches by feature ID
  • Controls are disabled during loading to prevent a brief unlocked flash
  • Shared ExperimentFreezeNotice component with link to the experiment detail page
  • Single freeze prop object passed to each tab

How did you test this code?

  • 6 unit tests covering: running freeze, no experiments, different feature, loading state, query skipping, status filter verification
  • Manual test: opened flag modal for a flag with a running experiment, confirmed value/segment/settings tabs show the freeze banner and controls are disabled
  • Verified zero new TypeScript errors (npm run typecheck)
  • Lint clean across all modified files

Zaimwa9 added 3 commits June 26, 2026 10:39
…consolidated props

Use two status-filtered queries (running/paused) instead of one
unfiltered page_size=100 query. Consolidate three freeze props into a
single FeatureExperimentFreeze object. Extract shared
ExperimentFreezeNotice component with link to experiment. Disable
controls during loading to prevent unlocked flash.
@Zaimwa9 Zaimwa9 requested a review from a team as a code owner June 26, 2026 12:11
@Zaimwa9 Zaimwa9 requested review from talissoncosta and removed request for a team June 26, 2026 12:11
@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
flagsmith-frontend-preview Ready Ready Preview, Comment Jun 26, 2026 1:38pm
flagsmith-frontend-staging Ready Ready Preview, Comment Jun 26, 2026 1:38pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Ignored Ignored Preview Jun 26, 2026 1:38pm

Request Review

@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Docker builds report

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

@github-actions github-actions Bot added the feature New feature or request label Jun 26, 2026
@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  35.4 seconds
commit  d3da974
info  🔄 Run: #17864 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  45.4 seconds
commit  d3da974
info  🔄 Run: #17864 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  39.1 seconds
commit  d3da974
info  🔄 Run: #17864 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  3 passed

Details

stats  3 tests across 3 suites
duration  1 minute, 17 seconds
commit  d3da974
info  🔄 Run: #17864 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  38.6 seconds
commit  c23d3ee
info  🔄 Run: #17876 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  42.1 seconds
commit  c23d3ee
info  🔄 Run: #17876 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  45.1 seconds
commit  c23d3ee
info  🔄 Run: #17876 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  3 passed

Details

stats  3 tests across 3 suites
duration  40 seconds
commit  c23d3ee
info  🔄 Run: #17876 (attempt 1)

@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Visual Regression

17 screenshots compared. See report for details.
View full report

@Zaimwa9

Zaimwa9 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

@gemini-code-assist review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a feature freeze mechanism that restricts editing of feature flags when they are part of an active experiment. It adds the useFeatureExperimentFreeze hook, an ExperimentFreezeNotice warning component, and integrates the freeze state across the feature settings, values, and segment overrides tabs. The reviewer feedback recommends skipping the experiment query if environmentId is missing to prevent unnecessary API requests, and keeping the footers visible during loading (while disabling save/schedule buttons) to avoid layout shifts and prevent premature submissions.

Comment thread frontend/common/hooks/useFeatureExperimentFreeze.ts Outdated
Comment thread frontend/web/components/modals/create-feature/tabs/FeatureValueTab.tsx Outdated
Comment thread frontend/web/components/modals/create-feature/tabs/SegmentOverridesTab.tsx Outdated
Comment thread frontend/web/components/modals/create-feature/tabs/SegmentOverridesTab.tsx Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

2 participants