Skip to content

feat(__future__): Experimental update-flag - #8102

Draft
emyller wants to merge 10 commits into
mainfrom
feat/update-flag-option-c
Draft

feat(__future__): Experimental update-flag#8102
emyller wants to merge 10 commits into
mainfrom
feat/update-flag-option-c

Conversation

@emyller

@emyller emyller commented Jul 25, 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

Contributes to #7642

Stabilises experimental update-flag endpoints to one option, still experimental.

  • Avoids touching Options A + B — cleanup + interface migration PR will follow.
  • Foundation of the code is in an experimental namespace.
  • Includes multivariate flag support.
  • Improves API design.

Updated documentation: https://docs-git-feat-update-flag-option-c-flagsmith.vercel.app/managing-flags/updating-flags

How did you test this code?

Integration tests included.

@emyller emyller self-assigned this Jul 25, 2026
@vercel

vercel Bot commented Jul 25, 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 Aug 7, 2026 3:16pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
flagsmith-frontend-preview Ignored Ignored Preview Aug 7, 2026 3:16pm
flagsmith-frontend-staging Ignored Ignored Preview Aug 7, 2026 3:16pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 182a6163-fa2e-43a4-afb3-ede6b6264395

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@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 Jul 25, 2026

@khvn26 khvn26 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good overall. My main gripe is combining full-replace and delete: true semantics for lists of different entities in a single API.

Comment thread docs/docs/managing-flags/updating-flags.md Outdated
Comment thread docs/docs/managing-flags/updating-flags.md Outdated
Comment thread docs/docs/managing-flags/updating-flags.md Outdated
Comment thread docs/docs/managing-flags/updating-flags.md Outdated
Comment thread docs/docs/managing-flags/updating-flags.md Outdated
Comment thread docs/docs/managing-flags/updating-flags.md Outdated

Set up features with weighted variants and customise weights per segment.

The `variants` list in `environment_default` defines the available variants for the feature, and their default weights

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.

I'm not sure I agree that modifying the variants themselves should be part of this endpoint at all. variants (or MultivariateFeatureOptions) are project level concepts. This endpoint should be concerned only with environment level entities.

IMO we should raise an error if a variant key is provided that doesn't already exist.

@khvn26 khvn26 Jul 31, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I actually thought this was implied by

The variants list in segment_overrides can only re-weight existing variants.

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.

That's not how I understood it - I understood that there was a difference in behaviour between the environment_default section of the payload, and the segment_overrides on this matter. TBC by @emyller .

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

My honest understanding of adding MVs support to update-flag was that it could be used to configure a multivariate experiment. If it's not, I think I need to learn more about the use case.

@emyller emyller Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Leaning towards knowledge I'm yet to learn: e111394

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Current experiments UI does not allow to add, delete or modify variants — unless I'm missing something, it consumes existing ones.

Comment thread docs/docs/managing-flags/updating-flags.md Outdated
Comment thread docs/docs/managing-flags/updating-flags.md Outdated
@emyller
emyller force-pushed the feat/update-flag-option-c branch from 2b9f91b to 4593ce3 Compare August 3, 2026 22:43
@github-actions github-actions Bot added the docs Documentation updates label Aug 3, 2026
@github-actions github-actions Bot added feature New feature or request and removed feature New feature or request docs Documentation updates labels Aug 3, 2026
@emyller
emyller force-pushed the feat/update-flag-option-c branch from 4593ce3 to ff05fcf Compare August 4, 2026 00:17
@github-actions github-actions Bot added the docs Documentation updates label Aug 4, 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 Aug 4, 2026
@emyller
emyller force-pushed the feat/update-flag-option-c branch from c17e1a8 to 468a299 Compare August 4, 2026 00:22
@github-actions github-actions Bot removed feature New feature or request docs Documentation updates labels Aug 4, 2026
@github-actions github-actions Bot added feature New feature or request and removed docs Documentation updates labels Aug 5, 2026
@emyller
emyller force-pushed the feat/update-flag-option-c branch from 3749d64 to ae8274e Compare August 5, 2026 22:25
@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 Aug 5, 2026
@emyller
emyller force-pushed the feat/update-flag-option-c branch from ae8274e to 81077d9 Compare August 5, 2026 22:36
@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 Aug 5, 2026
@emyller

emyller commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

This should be ready for a new review: since 81077d9, I've updated the proposed documentation to make it consistent to our [offline] discussion. Will update tests and move right on to implementing it once this looks good.

I've opted to let go of a separate DELETE endpoint, as it seemingly has no use in the UI, which is satisfied with a PUT path. Overall I think all the PATCH path isn't much useful to our dashboard, but it definitely helps ergonomics if we need it, e.g. in the CLI.

Comment thread docs/docs/managing-flags/updating-flags.md Outdated
Comment thread docs/docs/managing-flags/updating-flags.md Outdated
@khvn26

khvn26 commented Aug 7, 2026

Copy link
Copy Markdown
Member

I guess my only question at this point is whether we stick with feature_id/feature_name addressing on the API side, or only accept feature ids — this is not apparent from the docs currently.

Co-authored-by: Matthew Elwell <matthew.elwell@flagsmith.com>
Co-authored-by: Matthew Elwell <matthew.elwell@flagsmith.com>
@github-actions github-actions Bot removed feature New feature or request docs Documentation updates labels Aug 7, 2026
@emyller

emyller commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

I guess my only question at this point is whether we stick with feature_id/feature_name addressing on the API side, or only accept feature ids — this is not apparent from the docs currently.

I decided not to support feature names in this endpoint, for now, because we know no consumer that would benefit from it yet. The proposed docs assumes this discussion never existed, and includes {feature_id} in the example URLs. Let me know if you think anything should be improved towards that.

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.

4 participants