Skip to content

feat: Group experimentation commands under experimentation#1575

Merged
developerkunal merged 1 commit into
betafrom
feat/experimentation-command-group
Jul 2, 2026
Merged

feat: Group experimentation commands under experimentation#1575
developerkunal merged 1 commit into
betafrom
feat/experimentation-command-group

Conversation

@developerkunal

Copy link
Copy Markdown
Contributor

🔧 Changes

Groups the experimentation commands under a single experimentation parent command, mirroring the Management API's experimentation grouping.

Command grouping

  • Adds auth0 experimentation (alias exp) as the parent for experiments, feature-flags, and segments. Variations remain nested under feature-flags (auth0 experimentation feature-flags variations ...), matching the API where variations belong to a feature flag.
  • Removes the three top-level commands (auth0 experiments, auth0 feature-flags, auth0 segments) in favour of the grouped paths.

Allocation flow (experiments)

  • Interactive create/update now presents a variation multi-select (choose 1 to 20) with paging for feature flags that have many variations.
  • Enforces the 20-allocation maximum and the whole-number 1–100 weight bounds on the non-interactive --allocations flag, so the flag and interactive picker validate identically.

Update behaviour

  • update reads the current resource first, pre-fills interactive prompts with the existing values, and sends only the fields that actually changed. Allocations are PUT-like and replaced wholesale when edited.
  • Interactive update opens editors pre-filled with current values for feature-flag parameters, variation overrides, and segment rules, matching the create experience. It also offers to edit the experiment's assignment config and allocations behind a confirmation, including the percentage/segment strategy selection.
  • The update output now renders the full API response (feature flag, auth flow, allocation strategy, allocations, created, etc.) instead of only a subset of fields.

📚 References

Follow-up to #1562.

🔬 Testing

  • Unit tests updated across experiments, feature-flags, and segments update commands to mock the new Get call and assert diff behaviour, full-response rendering, and allocation validation (empty, over-limit, out-of-range weight).
  • Added a segments update test suite (previously none).
  • Integration test cases and helper scripts updated to the new experimentation command paths, plus new cases covering allocation validation on both create and update.
  • Docs regenerated via make docs.

📝 Checklist

  • All new/changed/fixed functionality is covered by tests (or N/A)
  • I have added documentation for all new/changed functionality (or N/A)

Move experiments, feature-flags, and segments under a single `auth0 experimentation` parent command, mirroring the Management API's experimentation grouping. Variations remain nested under feature-flags.

Also improves the experiment allocation flow: interactive variation multi-select (choose 1 to 20) with paging; enforce the 20-allocation maximum and weight bounds on the non-interactive --allocations flag; diff-based updates that send only changed fields (allocations replaced wholesale when edited); interactive update opens editors for feature-flag parameters, variation overrides, and segment rules pre-filled with current values; render the full API response on update output.

Regenerates docs and updates integration tests and helper scripts.
@developerkunal developerkunal requested a review from a team as a code owner July 2, 2026 16:58
@developerkunal developerkunal merged commit adb61ad into beta Jul 2, 2026
6 checks passed
@developerkunal developerkunal deleted the feat/experimentation-command-group branch July 2, 2026 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants