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.

Unexpected behaviour when handling default values with Environments

See original GitHub issue

What is the current bug behavior?

Meltano does not take Environment inheritance into account when setting a value to its default in an Environment.

What is the expected correct behavior?

Currently, when setting a setting value to it’s default, Meltano will unset all values (“to fall back to default”) rather than adding a new entry with the default value to meltano.yml. This behaviour was correct pre-environments, but does not take into account inheritance now that environments exist. The behaviour I would expect is that a new setting value would be added to the specific Environment with the default value, rather than the current behaviour that unsets values elsewhere in the inheritance chain.

Steps to reproduce

# add example tap
meltano add extractor tap-gitlab

# configure example setting with non-default value in base
meltano --no-environment config tap-gitlab set fetch_merge_request_commits true

# configure same setting with default value in an Environment
meltano environment=dev config tap-gitlab set fetch_merge_request_commits false

The above results in the removal of the True setting in base, rather than the addition of a False setting value in the environment dev.

Relevant logs and/or screenshots

Screenshot 2022-06-13 at 15 02 48

Bug behaviour - removed True setting in plugin base configuration and no additional False setting in Environment dev. Expected behaviour:

Screenshot 2022-06-13 at 15 03 54

true retained in base and false added to Environment dev (even though it happens to be the default value).

Possible fixes

Further regression test

Ensure we automatically catch similar issues in the future

  • Write additional adequate test cases and submit test results
  • Test results should be reviewed by a person from the team

/label ~bug /label ~“To Do”

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
aaronsteerscommented, Aug 5, 2022

Agreed I think the simple path is best, to simply remove the equivalence check and always do a set when a set operation is requested.

If the user wants a clear, they should run meltano config ... unset.

I commented something similar in #6116.

Sidebar: when we have proper secrets support, equivalence checks may be impossible anyway. The behavior of “set when set is requested” should not require access to the prior/existing value.

1reaction
DouweMcommented, Jun 13, 2022

@tayloramurphy I’ve put this one into the current milestone assuming you agree that fixing config/environments related bugs is a good use of our time right now!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unexpected behaviour with argument defaults
Basically, when a function has an argument whose default value is the argument's name, strange things happen (well, strange to me anyway).
Read more >
Unexpected behavior of default environment (region/account)
Hiya friends! AWS IS SO SECURE Tl;dr I have some creds in my env > env | grep AWS AWS_ACCESS_KEY_ID=nope AWS_SECRET_ACCESS_KEY=nope ...
Read more >
Environment Variable - Default vs Current Value
My understanding is the Default Value is best suited to be used as the Prod environment information AND that if there is no...
Read more >
Unexpected behavior in Bash - environment variables
A simple command is a sequence of optional variable assignments followed by blank-separated words and redirections, and terminated by a control ...
Read more >
Case Manager 5.3.3 - Unexpected behavior when you use ...
Users can experience unpredictable behavior when you configure different default values for separate instances of the same property.
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