-
Notifications
You must be signed in to change notification settings - Fork 15
duplicate experiment modal and functionality #2788
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: experiment-design-refresh
Are you sure you want to change the base?
duplicate experiment modal and functionality #2788
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements the duplicate experiment modal and functionality, allowing users to create a copy of an existing experiment with all its configurations including conditions, partitions, factors, condition payloads, and other metadata.
Key changes:
- Added
openDuplicateExperimentModal()method in the dialog service to handle duplicate action - Implemented
createDuplicateRequest()method to build the experiment request with source experiment data - Updated backend to properly handle ID mapping for conditions, decision points, and condition payloads during duplication
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
frontend/projects/upgrade/src/app/shared/services/common-dialog.service.ts |
Added new method to open duplicate experiment modal with appropriate configuration |
frontend/projects/upgrade/src/app/features/dashboard/experiments/pages/experiment-details-page/experiment-details-page-content/experiment-overview-details-section-card/experiment-overview-details-section-card.component.ts |
Replaced TODO comment with call to duplicate experiment modal |
frontend/projects/upgrade/src/app/features/dashboard/experiments/modals/upsert-experiment-modal/upsert-experiment-modal.component.ts |
Added duplicate action support including new createDuplicateRequest() method and updated form initialization logic |
frontend/projects/upgrade/src/app/features/dashboard/experiments/modals/upsert-experiment-modal/upsert-experiment-modal.component.html |
Updated template conditions to include duplicate action when showing context change warnings |
frontend/projects/upgrade/src/app/core/experiments/store/experiments.effects.ts |
Refined navigation logic to check for exact experiment detail URL match |
backend/packages/Upgrade/src/api/services/ExperimentService.ts |
Refactored ID mapping to use local maps, moved condition payload creation after conditions/decision points are created, and added null-safety check for condition payloads |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...es/dashboard/experiments/modals/upsert-experiment-modal/upsert-experiment-modal.component.ts
Show resolved
Hide resolved
...es/dashboard/experiments/modals/upsert-experiment-modal/upsert-experiment-modal.component.ts
Outdated
Show resolved
Hide resolved
...es/dashboard/experiments/modals/upsert-experiment-modal/upsert-experiment-modal.component.ts
Outdated
Show resolved
Hide resolved
…ts/modals/upsert-experiment-modal/upsert-experiment-modal.component.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
...es/dashboard/experiments/modals/upsert-experiment-modal/upsert-experiment-modal.component.ts
Outdated
Show resolved
Hide resolved
|
The submit button is greyed out initially, even though technically we ought to be able to duplicate an experiment with all the exact same form values, as the experiment name doesn't have to be unique. The constraint on changing from initial-values in the upsert-exp modal shouldn't apply to the DUPLICATE mode. btw we're doing something slightly different for the name and submit behavior each entity when duplicating...
so the secondary thing is if we want some consistency here. probably not terribly important but food for thought. cc: @zackcl |
...es/dashboard/experiments/modals/upsert-experiment-modal/upsert-experiment-modal.component.ts
Outdated
Show resolved
Hide resolved
...es/dashboard/experiments/modals/upsert-experiment-modal/upsert-experiment-modal.component.ts
Outdated
Show resolved
Hide resolved
...es/dashboard/experiments/modals/upsert-experiment-modal/upsert-experiment-modal.component.ts
Outdated
Show resolved
Hide resolved
...es/dashboard/experiments/modals/upsert-experiment-modal/upsert-experiment-modal.component.ts
Outdated
Show resolved
Hide resolved
backend/packages/Upgrade/test/integration/Experiment/factorial/FactorialEnrollment.ts
Outdated
Show resolved
Hide resolved
|
Yeah, I think we should make the duplicate modal behavior consistent across feature flags, segments, and experiments. The segment approach of auto-tacking on “(COPY)” feels the most intuitive since it allows immediate submit while still letting users rename if they want.
|
|
@bcb37 It seems like the duplicated experiment’s include/exclude list description is being filled with a UUID when the original list’s description is empty. The duplicated experiment’s include/exclude list description should remain empty if the original list’s description is empty. |


No description provided.