-
-
Notifications
You must be signed in to change notification settings - Fork 657
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: select enabled environments on project creation (#6869)
This PR adds functionality to the `createProject` function to choose which environments should be enabled when you create a new project. The new `environments` property is optional and omitting it will make it work exactly as it does today. The current implementation is fairly strict. We have some potential ideas to make it easier to work with, but we haven't agreed on any yet. Making it this strict means that we can always relax the rules later. The rules are (codified in tests): - If `environments` is not provided, all non-deprecated environments are enabled - If `environments` is provided, only the environments listed are enabled, regardless of whether they're deprecated or not - If `environments` is provided and is an empty array, the service throws an error. The API should dilsallow that via the schema anyway, but this catches it in case it sneaks in some other way. - If `environments` is provided and contains one or more environments that don't exist, the service throws an error. While we could ignore them, that would lead to more complexity because we'd have to also check that the at least one of the environments is valid. It also leads to silent ignoring of errors, which may or may not be good for the user experience. The API endpoint for this sits in enterprise, so no customer-facing changes are part of this.
- Loading branch information
1 parent
6b5cdc2
commit bda5eda
Showing
3 changed files
with
144 additions
and
10 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
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