You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hop.apache.org by "dsanderbi (via GitHub)" <gi...@apache.org> on 2026/10/02 12:53:56 UTC

Re: [I] [Feature Request]: Add Support for Sharing lifecycleEnvironments Directly in Project Configuration Files (hop)

dsanderbi commented on issue #4193:
URL: https://github.com/apache/hop/issues/4193#issuecomment-5952787550

   A `lifecycleEnvironment` is:
   `name, purpose, projectName, canvasText, configurationFiles, attributesMap`
   
   `projectName` means it belongs to exactly one project, and `configurationFiles` are
   `${PROJECT_HOME}/...` paths in practice. So the record holds nothing user- or
   machine-specific — unlike `projectConfigurations.projectHome`, which is an absolute local
   path. Environments are the only project-bound block in `projectsConfig` that is already
   portable, and they sit in the one file that can never be shared: hop-config.json also
   holds `guiProperties` (DarkMode, fonts, icon size), `azure`, `googleCloud`, `dropbox`,
   `gitConfig` and 60+ variables.
   
   @mattcasters — credentials don't live in the environment, they live in the config files
   it points to. Sharing an environment shares *which files to load*, not *what is in them*.
   
   ## Proposal: two layers, not a move
   
   The environment list currently exists exactly once. Moving it to the project would make it
   fully shared and remove per-developer settings. Instead, merge two sources when a project
   is opened.
   
   **project-config.json** (committed, same for everyone):
   
   ```json
   {
     "metadataBaseFolder" : "${PROJECT_HOME}/metadata",
     "unitTestsBasePath" : "${PROJECT_HOME}",
     "dataSetsCsvFolder" : "${PROJECT_HOME}/datasets",
     "enforcingExecutionInHome" : true,
     "autoExportMetadataFilename" : "metadata.json",
     "parentProjectName" : "default",
     "config" : {
       "variables" : [ ]
     },
     "lifecycleEnvironments" : [ {
       "name" : "development",
       "purpose" : "Development",
       "configurationFiles" : [ "${PROJECT_HOME}/config/dev.json" ]
     }, {
       "name" : "production",
       "purpose" : "Production",
       "configurationFiles" : [ "${PROJECT_HOME}/config/prod.json" ]
     } ]
   }
   ```
   `projectName` is deliberately absent here: a project's name only exists in hop-config.json,
   paired with the local `projectHome`, and everyone is free to register the same repository
   under a different name.
   
   **hop-config.json** (local to one developer):
   
   ```json
   "lifecycleEnvironments": [
     { "name": "production", "projectName": "myproject",
       "configurationFiles": ["${PROJECT_HOME}/.hop/myproject-prod-credentials.json"] },
     { "name": "my-sandbox", "projectName": "myproject",
       "configurationFiles": ["${PROJECT_HOME}/.hop/sandbox.json"] }
   ]
   ```
   (`.hop/` is in `.gitignore`)
   
   **Result on open:**
   
   | Environment   | files loaded                              | source         |
   |---------------|-------------------------------------------|----------------|
   | `development` | `dev.json`                                | shared only    |
   | `production`  | `prod.json`, then `prod-credentials.json` | shared + local |
   | `my-sandbox`  | `sandbox.json`                            | local only     |
   
   ## UI
   
   The environment dialog needs an explicit scope choice on save — *Project (shared)* vs
   *Local (this machine only)* — covering two cases:
   
   - creating a new environment: where is it stored
   - adding a config file to a shared environment: must be storable locally and never written
     back into the project file
   
   The dialog should also show which entries come from the project and which are local.
   
   ## Practical impact
   
   A fresh checkout of a project with ~1000 environments means re-creating every environment
   entry by hand, per developer, per machine. Not the file contents — those come from the
   repo — but the wiring: pointing `production` at the dev config file doesn't error out, it
   just runs against the wrong target.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org