UI5 / UI5/cli

Support for environment variables

Open
#935 8 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
511
Forks
83
Avg merge
1d 5h
Merged PRs (30d)
55

Description

Is your feature request related to a problem? Please describe.

I would like to have an out of the box supported standard approach to use environment variables to configure my middlewares and tasks.

Why? As one of the maintainers of the middleware in the open-ux-tools, I have noticed a repetitive pattern: usage of environment variables. In nearly all our middlewares/tasks we support some kind of usage of environment variables as input. A quick search through other middlewares also shows that we are not the only ones but many others also have their way of allowing to provide parts of the configuration as env variables.
The problem is that everybody does their own thing leading to inconsistencies of how to use env variables.

Describe the solution you'd like

I'd prefer a very simple solution allowing me to define environment variable placeholders in my yaml e.g.

server:
  customMiddleware:
  - name: preview-middleware
    afterMiddleware: compression
    configuration:
      debug: ${DEBUG}

The UI5 CLI should resolve the environment variable before calling my middleware so that the middleware implementation does not have to bother.
Please also support dotenv out of the box as part of the same feature.

Describe alternatives you've considered

No.

Additional context

No.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files or tests are named. Start by tracing how the UI5 CLI reads YAML configuration and passes middleware and task configuration, then determine where environment-variable and dotenv resolution belongs; done means placeholders are resolved before middleware or task execution with dotenv supported out of the box.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cli, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.