bug: env inheritance global env -> plugin env
See original GitHub issuePrereq:
Meltano Version
2.9.0
Python Version
3.8
Bug scope
Configuration (settings parsing, validation, etc.)
Operating System
Ubuntu
Description
- Copy meltano.yml
- meltano install
- export MELTY=melty
- `meltano invoke --print-var GLOBALMELTY–print-var DEVMELTY target-jsonl
visch@visch-ubuntu:~/git/meltano-projects/env_multiple_values_inheritance$ meltano invoke --print-var DEVMELTY --print-var GLOBALMELTY target-jsonl
2022-11-16T02:46:06.088209Z [info ] Environment 'dev' is active
DEVMELTY=MELTY
GLOBALMELTY=$MELTY
Code
version: 1
default_environment: dev
project_id: bea6b7f5-2f98-416a-9a6b-b602b56efff6
environments:
- name: dev
env:
DEVMELTY: $MELTY
- name: staging
- name: prod
plugins:
loaders:
- name: target-jsonl
variant: andyh1203
pip_url: target-jsonl
env:
GLOBALMELTY: $MELTY
Issue Analytics
- State:
- Created 10 months ago
- Reactions:2
- Comments:6 (1 by maintainers)
Top Results From Across the Web
env variables set in main process are not inherited by ... - GitHub
Describe the bug first i make sure there is no process.env.LD_LIBRARY_PATH in os env variables. i wanna set env variables programmatically.
Read more >Environment Injector - Jenkins Plugins
This plugin makes it possible to setup a custom environment for your jobs. Features: Removes inherited environment variables by the Jenkins ...
Read more >GOLAND Environment Vars in .env file - Stack Overflow
You can go to Tools | Create command line launcher... and then start GoLand from the command line, which will then inherit those...
Read more >Jenkins Pipeline Environment Variables - The Definitive Guide
Jenkins Environment Variable is a global variable exposed through the env variable and used anywhere in the Jenkinsfile .
Read more >How can environment variables inherited to sub scripts in a ...
my $perl_var=$ENV{bamboo_var}; print "Bamboo global var script 2: $perl_var";; Created a global variable called var with the value hello ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@tayloramurphy – yes we have these tests for inheritance.
The logic itself is consolidated in plugin_invoker.py and is well-commented there.
I was able to replicate this locally. I think the fix itself is fairly straightforward – it looks like we’re expanding the top-level env vars in the plugin invoker, but then the plugin itself is still getting the unexpanded top-level values in its env and those take precedence over top-level env vars when we pass the full environment into the plugin at invocation. So scope here would be to update that precedence order and/or potentially expand env vars with plugin settings directly and then figure out why this behavior isn’t cropping up in unit tests and update the test suite to catch it (probably also add an integration test for this as well)
@cjohnhanson thanks for the details! Can you give this a prelim weight on the Product Roadmap project and I’ll work with AJ to get it prioritized?