question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`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:closed
  • Created a year ago
  • Reactions:2
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
aaronsteerscommented, Jun 28, 2022

@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 in meltano.yml.

1reaction
DouweMcommented, Jun 8, 2022

@edgarrmondragon Yeah, if default_environment is currently dev, meltano config meltano set default_environment prod would store that under environments: - dev, which would be confusing and may not actually stick, because the next time default_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 of meltano.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 or ui.bind_port.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Change default `meltano config` behavior to `--no-environment`
I keep running into this and I think it's worth reconsidering the defaults here. In CI - my CLI commands looked fine and...
Read more >
Allow users to name a default Environment in `meltano.yml`
Summary. Let users set the name of the default environment in meltano.yml . ... means commands will use dev if --environment is not...
Read more >
Environments
Note that the default environment does not apply to the meltano config command. Default environments are intended for execution related work and not ......
Read more >
Manage Configuration
Meltano is responsible for managing the configuration of all of a project's plugins. It knows what settings are supported by each plugin, and...
Read more >
Command Line - Meltano Documentation
The add command does not run relative to a Meltano Environment. The --environment flag and default_environment setting in your meltano.yml file will be...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found