-
-
Notifications
You must be signed in to change notification settings - Fork 736
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR removes the workaround introduced in #6931. After ivarconr/unleash-enterprise#1268 has been merged, this should be safe to apply. Notably, this PR: - tightens up the type for the enable change request function, so we can use that to inform the code - skips trying to do anything with an empty array The last point is less important than it might seem because both the env validation and the current implementation of the callback is essentially a no-op when there are no envs. However, that's hard to enforce. If we just exit out early, then at least we know nothing happens. Optionally, we could do something like this instead, but I'm not sure it's better or worse. Happy to take input. ```ts const crEnvs = newProject.changeRequestEnvironments ?? [] await this.validateEnvironmentsExist(crEnvs.map((env) => env.name)); const changeRequestEnvironments = await enableChangeRequestsForSpecifiedEnvironments(crEnvs,); data.changeRequestEnvironments = changeRequestEnvironments; ```
- Loading branch information
1 parent
c048156
commit 491cd58
Showing
2 changed files
with
20 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters