Skip to content

fix: detect multivariate differences between environments#7635

Open
10done wants to merge 3 commits into
Flagsmith:mainfrom
10done:fix/compare-multivariate-environment-diff
Open

fix: detect multivariate differences between environments#7635
10done wants to merge 3 commits into
Flagsmith:mainfrom
10done:fix/compare-multivariate-environment-diff

Conversation

@10done
Copy link
Copy Markdown
Contributor

@10done 10done commented May 28, 2026

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

Fixes #7619

  • Adds hasMultivariateChange() to compare multivariate_feature_option + percentage_allocation per environment
  • Uses it in CompareEnvironments for changed/unchanged classification and row fade behavior
  • Uses it in CompareFeatures so MV-only differences are not shown as identical
  • Adds unit tests in compare-multivariate-utils.test.ts

How did you test this code?

I have tested the code manually and added screenshots below and also added unit tests for the same.

Before

Screenshot 2026-05-28 at 8 12 34 PM Screenshot 2026-05-28 at 8 12 53 PM image

No flag differences / rollout_test in Unchanged (Dev 0% vs Prod 100%).

After

image

rollout_test under Changed Flags.

@10done 10done requested a review from a team as a code owner May 28, 2026 17:54
@10done 10done requested review from kyle-ssg and removed request for a team May 28, 2026 17:54
@vercel
Copy link
Copy Markdown

vercel Bot commented May 28, 2026

@10done is attempting to deploy a commit to the Flagsmith Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added the front-end Issue related to the React Front End Dashboard label May 28, 2026
Copy link
Copy Markdown
Contributor

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

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 utility function hasMultivariateChange to detect differences in multivariate feature allocations when comparing environments and features, along with corresponding unit tests. The feedback suggests defensively converting multivariate_feature_option to a number during normalization to prevent potential NaN values from causing unstable sorting.

Comment thread frontend/web/components/compare-multivariate-utils.ts
@10done 10done changed the title fix : detect multivariate differences between environments fix: detect multivariate differences between environments May 28, 2026
@10done
Copy link
Copy Markdown
Contributor Author

10done commented Jun 6, 2026

@Holmus Can I have review please whenever you have time. happy to make any further changes required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

front-end Issue related to the React Front End Dashboard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect comparison for multivariate flags across environments

1 participant