`default_environment` can only be set in `meltano.yml`, not using `meltano config meltano set`
See original GitHub issue@tayloramurphy pointed out that meltano config meltano set default_environment prod
or meltano config meltano unset default_environment
doesn’t do anything.
This is because default_environment
is not actually a setting, but a core property of meltano.yml
: https://github.com/meltano/meltano/blob/dfd9650170ff97fd69fdff7ac8dc7dc0841bf663/src/meltano/core/meltano_file.py#L21
https://docs.meltano.com/concepts/environments#default-environments doesn’t suggest that meltano config meltano
would work here, only setting it directly in meltano.yml
. But https://docs.meltano.com/getting-started#view-and-activate-your-environments does call it a setting, and someone seeing it in meltano.yml
could reasonably expect it to work just like the other keys in there like send_anonymous_usage_stats
and project_id
.
If we want to make it a proper setting, we should be able to define it in settings.yml
and replace https://github.com/meltano/meltano/blob/main/src/meltano/cli/cli.py#L70 with ProjectSettingsService(project).get("default_environment")
.
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:5 (2 by maintainers)
Top GitHub Comments
@DouweM and @tayloramurphy - This should be blocked by
If we have that in place, and if we categorized this as a Meltano setting, this becomes doable as a top-level only setting that can be modified via
.env
, terminal env vars, and a top-level entry inmeltano.yml
.@edgarrmondragon Yeah, if
default_environment
is currentlydev
,meltano config meltano set default_environment prod
would store that underenvironments: - dev
, which would be confusing and may not actually stick, because the next timedefault_environment
is read, it won’t know where to read from yet and would read from the root which wouldn’t have the key. In this case, it really doesn’t make any sense to store this anywhere other than the top-level ofmeltano.yml
.That’s another point in favor of not allowing top-level settings in envs, although I said in https://github.com/meltano/meltano/issues/3419#issuecomment-1150239801 that there are situations where that does make sense like with
send_anonymous_usage_stats
orui.bind_port
.