Simplify configuration #165
Replies: 5 comments 31 replies
-
Beta Was this translation helpful? Give feedback.
-
I really like the idea of having references explicitly declared in the config. There are still some open question though. Now to some question:
All in all I guess by simplifying what is allowed in the config we can ease the use |
Beta Was this translation helpful? Give feedback.
-
I actually started working on a PoC for this. Note: There is currently no documentation for it and one needs to build it themself (simply checkout the code The PoC breaks the config syntax as we know it right now.
It is no longer possible to have a deeper folder structure than this. The next big change is the config file structure. Instead of defining all the templates files Here is an example dashboard-a:
config:
template: "dashboard.json"
name: "Dashboard A"
parameters:
owner: han.solo
managementZoneId: ["infrastructure", "management-zone", "zone", "id"]
managementZoneName:
type: "reference"
project: "infrastructure"
api: "management-zone"
config: "zone"
property: "name"
groupOverrides:
development:
parameters:
managementZoneName: "dev"
production:
parameters:
owner: "philip.fry"
environmentOverrides:
environment1:
parameters:
owner: "bender.rodriguez"
managementZoneId: ["management-zone", "specialZone", "id"]
managementZoneName:
type: "reference"
api: "management-zone"
config: "specialZone"
property: "name"
dashboard-b:
config:
template: "dashboard-b.json"
name: "Dashboard B" As you can see, we define two dashboards here. All configurations under E.g. test:
type: reference
config: dashboard-b
property: name Here we will reference to a different dashboard config in the same project. This is equivalent to test: ["dashboard-b", "name"] Overrides also work different than before. They are now all defined in the config object. The priority What also has changed is the environment definition yaml file. It now looks like this: groups:
development:
environment-1:
url: "https://my-fancy-environment"
token:
type: "environment"
name: "DEV_TOKEN"
environment-2:
url: "https://my-fancy-environment2"
token:
type: "environment"
name: "DEV_TOKEN"
production:
environment-3:
url: "https://my-fancy-environment3"
token:
type: "environment"
name: "PROD_TOKEN"
standalone:
environment-4:
url: "https://my-fancy-environment4"
token:
type: "environment"
name: "SPECIAL"
Here we define four environments. Under |
Beta Was this translation helpful? Give feedback.
-
One popular use case - mainly around automated app onboarding - is to use compound parameters in combination with environment variables.
Two important parts are present here:
As discussed during the roadmap session, it would be great to see these capabilities with the new 2.0 config. |
Beta Was this translation helpful? Give feedback.
-
As of right now, it is possible to directly access environment variables via golang templates in the email:
- name: "{{ .Env.EMAIL_NAME }}" or {
"name": "{{ .Env.GROUP }} - {{ .Env.MAIL }}"
} are no longer possible. Instead one would need to create explicit So the yaml example above becomes: - id: email
name:
type: environment
name: "EMAIL_NAME" The json example could either be solved by using an compound parameter (as described in this comment), The main benefit I personally see with this approach is, to make every dependency of the |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently configuration definition is done in 2 sections:
Wouldn't it be easier and also more readable to have something like this:
We already have name and skipDeployment as reserved params but this is not visible in configuration, you need to take a look in documentation for this. IMO it would help us to adapt YAML structure and have these params on the first level and define all custom params within e.g. "params". This would simplify our parsing logic.
Then we could also think about defining references in more flexible way which should simplify resolving dependencies:
In case there is a reference we map all parameters including name and id and then we can use this object within json template:
Please also notice changes in YAML data types.
Beta Was this translation helpful? Give feedback.
All reactions