-
Notifications
You must be signed in to change notification settings - Fork 14
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
Refactor getAllExperimentConditions function for proper readability #2171
base: dev
Are you sure you want to change the base?
Conversation
backend/packages/Upgrade/src/api/services/ExperimentAssignmentService.ts
Outdated
Show resolved
Hide resolved
backend/packages/Upgrade/src/api/services/ExperimentAssignmentService.ts
Outdated
Show resolved
Hide resolved
backend/packages/Upgrade/src/api/services/ExperimentAssignmentService.ts
Outdated
Show resolved
Hide resolved
backend/packages/Upgrade/src/api/services/ExperimentAssignmentService.ts
Outdated
Show resolved
Hide resolved
backend/packages/Upgrade/src/api/services/ExperimentAssignmentService.ts
Show resolved
Hide resolved
// Create new filtered experiment list | ||
const alreadyAssignedExperiments = experimentPools.map((pool) => { | ||
return pool.filter((experiment) => { | ||
const individualEnrollment = mergedIndividualAssignment.find((enrollment) => { |
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.
Same as above
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.
This is not fixed
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.
Already updated the alreadyAssignedExperiments
to priorSelectedExperiments
. Did you mean to update something else?
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.
If we click the file from this conversation, it will take us to an outdated file, so changes wont be seen. We need to review it from the File Changes
tab.
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.
No the change I was asking for was to change find
-> some
hasIndividualEnrollment
and hasGroupEnrollment
backend/packages/Upgrade/src/api/services/ExperimentAssignmentService.ts
Outdated
Show resolved
Hide resolved
backend/packages/Upgrade/src/api/services/ExperimentAssignmentService.ts
Show resolved
Hide resolved
backend/packages/Upgrade/src/api/services/ExperimentAssignmentService.ts
Show resolved
Hide resolved
backend/packages/Upgrade/src/api/services/ExperimentAssignmentService.ts
Outdated
Show resolved
Hide resolved
@ppratikcr7 can you add test cases for the new functions added in the PR? |
…into optimize-getAllExperimentConditions
This PR focus on adding helper functions for getAllExperimentConditions and reduce the complexity of the code. I have also added comments for better understanding.