Repository navigation
Issue #4193 : Define lifecycle environments in the project configuration - #8780
mattcasters wants to merge 4 commits into
Conversation
…iguration Store environment names, descriptions, and placeholder variable defaults in project-config.json, and edit them from the project dialog.
… definitions Link a lifecycle environment to an embedded definition by name. Enabling it applies the placeholder defaults, then the configuration file, and a project variable still wins. Adding a project that already defines environments can create those environments on this computer. Only mandatory variables and secrets are written, and an existing environment or configuration file is left as it is.
…figuration files
The directory dialog returns a folder such as ${HOP_CONFIG_FOLDER}/environments/<project>/.
Resolve that folder before building the configuration filename so the file is
not written under the Hop installation directory, and keep the variable in the
lifecycle environment reference.
The Environments tab can implement those environments on this computer and
copy a definition. Mandatory and secret variables come from the single
variable list. Parent-folder copy and project load or restore log a caught
error on one line.
|
Hi @mattcasters , thanks for this PR. I tested it locally and there are a few things I'd like to point out / discuss. My setup
1. Mandatory/secret defaults end up in the repository and in the local fileWhen I set the variables with their defaults under Project → Environments, the values are stored in { "name": "DB_PASS", "defaultValue": "password", "mandatory": true, "secret": true }This doesn't match the message Hop shows when the environments are created:
I read "Mandatory variables and secrets are written to a configuration file … Other variables stay in the project" as: mandatory variables and secrets move to the local file, and only the other variables stay in the project. Right now the Suggestion: for secret variables, keep only the name and description in 2. hop-run doesn't use the defaults from project-config.jsonChanges to the defaults under Project → Environments are not copied to an existing local file. I assume that's intended. What I didn't expect: when I run the project from the command line, the defaults from Repro with a fresh client (fresh ./hop-run.sh \
--project-locations test-project=/path/to/test-project \
--environments 'prod=test-project:${PROJECT_HOME}/config/prod/test-project-prod.json' \
-e prod \
-f '${PROJECT_HOME}/main.hwf' \
-r local
With hop-run:
The values from the configuration file are applied, but none of the defaults from As far as I can see, Question: Is this intentional? If so, what's the idea behind it? Maybe the intention is that in production every value is set explicitly, through the environment's configuration files or through environment variables, and the embedded definition is only a template for creating environments in the GUI? In that case it would help to mention this in the documentation, because I expected the defaults to be applied everywhere. If it's not intentional, I'd prefer an option on 3. Minor: the name "Mandatory"The dialog explains what happens to mandatory variables (they are written to the local configuration file). Still, when I first looked at the flag, the name was misleading for me. I read Mandatory as "the project needs this variable", not as "has to be set on each computer". A name like Local or Per computer would describe the behavior more directly. Alternatively, 4. Question: development and deployment workflowMore generally, I'd like to understand how you see the workflow from development to deployment. Do you expect the environments to be registered in I attached the test-project.zip. Like after a deployment, it doesn't contain the |
|
I know it's possible to create a lot of text with LLMs, but please understand I have to read all this. I disagree with a number of points raised so all you're doing is stalling this project. |
|
We already went through this. Yes you need to do manual steps to enter passwords, configure things. That's the general consensus. Most environments have every data engineer in a team authenticate with their own username and password, for example. Surely that can't be too much of an issue?
How can it be otherwise? Should the project be changed after an environment is implemented? That doesn't seem to make sense. Obviously it's clear to never store actual secrets in the project configuration nor in git. The notable exception there are passwords stored in a key-vault. I assume that will more and more become the standard.
I considered it useful to have things like I'll look at the other comments when I find the time. |
|
Hi Matt, thank you for your input, you are right, maybe I want too much in this PR. However, to keep things short: I'm wondering if hop-run could get an option like --embedded-environment=project-environment. |
|
I'm sorry if I came across a bit direct. I really like the direction this is going in. It will be quite useful. I will give this the time it deserves. It's just that I have a number of other priorities right now and time often feels limited. |



Lifecycle environment definitions can be stored in
project-config.jsonand checked in with the project. Each definition has a name, a description, and three lists of variables (optional, mandatory, and secret). The default value is a placeholder, not a live value or a secret.Adding a project from a folder or from Git asks whether to create those environments on this computer when the project already defines them. Only mandatory variables and secrets are written to one configuration file per environment. The folder comes from
${ENVIRONMENTS_FOLDER}when that project variable is set, and otherwise Hop asks for a folder outside the project. An environment that already exists is left unchanged, and an existing configuration file is not overwritten.The environment dialog links to an embedded definition by name. Enabling that environment applies the placeholders, then the configuration file. A project variable with the same name still wins.
fixes #4193
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
mvn clean install apache-rat:checkto make sure basic checks pass. A more thorough check will be performed on your pull request automatically.git rebase -i.addresses #123), if applicable.To make clear that you license your contribution under the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.