You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add a type-safe API for environment definitions #5908
Environment definitions are used to configure the generation of package manager config files like a Maven settings.xml or .npmrc. Currently, the available definition types are defined by strong constants and hard-coding the implementations of EnvironmentServiceDefinition in EnvironmentDefinitionFactory. Also, the options available (and which of them are required) for each definition type are just defined by code that parses plain key value maps.
As a result, there is no way to query the available definition types and their respective options. This has negative consequences for the UX, for example, the endpoint to create new runs just takes a Map<String, Map<String, String>> as input for the environment definitions and users have to look up allowed values from external documentation (which is also incomplete, so users actually have to find the corresponding source code to get the full picture). This external documentation also has to be manually kept in sync with the actual implementation.
To fix this, introduce a clearly defined API for environment definitions that would allow to:
Use it in the API, so that it is self-documented.
Read the config into type-safe data classes.
Simplify the custom parsing logic by using a library like Hoplite.
Avoid the need for manually keeping the documentation in sync.
Activity