mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-01 00:08:27 +01:00
bda5eda224
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. |
||
---|---|---|
.. | ||
__snapshots__ | ||
addons | ||
db | ||
domain/project-health | ||
error | ||
features | ||
middleware | ||
openapi | ||
routes | ||
schema | ||
services | ||
types | ||
users | ||
util | ||
app.test.ts | ||
app.ts | ||
create-config.test.ts | ||
create-config.ts | ||
default-custom-auth-deny-all.ts | ||
internals.ts | ||
logger.test.ts | ||
logger.ts | ||
metric-events.ts | ||
metrics.test.ts | ||
metrics.ts | ||
server-impl.test.ts | ||
server-impl.ts |