-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move all defaults from config yaml to defaults.py #218
Conversation
bc0475a
to
114b0e7
Compare
I will have to run the deployment test to ensure ENV Data is not messed up. |
114b0e7
to
b49a7cf
Compare
@@ -16,4 +16,3 @@ def test_defaults(self): | |||
config_sections = ocsci.config.to_dict().keys() | |||
for section_name in config_sections: | |||
section = getattr(ocsci.config, section_name) | |||
assert section == getattr(ocs.defaults, section_name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes the test do nothing at all. Why does it need to be changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that was old change, just updated it now after separating out defaults.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm really confused - your new commits are removing defaults from defaults.py now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some where duplicated in defaults and ENV_DATA, I only removed those duplicates.
7b58e93
to
956f7eb
Compare
Deployment test is passing but have the final oc wait thats causing issue
|
'cli_params': {}, | ||
'client_version': DEPLOYMENT['installer_version'], | ||
'bin_dir': './bin', | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what I meant - these changes are the opposite of what we agreed on
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you read the comments on the top of the ENV_DATA, it was never supposed to be here in the first place. I am still not clear what specific changes you are talking about, I am removing the data that is not used by any file but exists in defaults.py and removing default values that just exists and used by ENV_DATA
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zmc once this will be merged I will submit other PR or you can finish in your to remove completely the defaut_config.yaml and we can have those vales here and feed the default config.
So not sure now if it's worth to remove them from here if we will return those values here again very soon. But we can just copy paste from old commit so I don't mind. But yep those values are not used anywhere now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vasukulkarni specifically, I disagree with removing ENV_DATA
, DEPLOYMENT
, REPORTING
and RUN
here.
If the idea is to eventually have all these values in defaults.py
, I don't see the point in removing them here. It seems counter-productive. I'd rather see them removed from default_config.yaml
, as the goal is to remove that file entirely.
e81bd1d
to
5ea445b
Compare
Signed-off-by: Vasu Kulkarni <[email protected]>
5ea445b
to
de659e0
Compare
Test logs:
|
module, plese put your defaults rather to mentioned default_config.yaml file! | ||
See the documentation in conf/README.md file to understand this config file. | ||
Defaults module. All the defaults used by OSCCI framework should | ||
reside in this module. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should mention that all defaults values are suppose to be unchanged during whole execution as we consider them as defaults. We are also having some discussion on #259 about defaults.py contains a lot of variables which probably should live in different place, this we can discuss on today's call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah this we can take as a different topic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@petr-balogh could you explain why you think the values in defaults.py shouldn't be changed? It's my impression that a defaults.py sort of module should contain every configurable option and is expected to be overridden by the end-user if they need it to be.
Signed-off-by: Vasu Kulkarni <[email protected]>
'cli_params': {}, | ||
'client_version': DEPLOYMENT['installer_version'], | ||
'bin_dir': './bin', | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vasukulkarni specifically, I disagree with removing ENV_DATA
, DEPLOYMENT
, REPORTING
and RUN
here.
If the idea is to eventually have all these values in defaults.py
, I don't see the point in removing them here. It seems counter-productive. I'd rather see them removed from default_config.yaml
, as the goal is to remove that file entirely.
run_data = getattr(ocsci.config, 'RUN') | ||
assert env_data['rook_image'] == 'rook/ceph:master' | ||
assert reporting_data['email']['address'] == '[email protected]' | ||
assert run_data['bin_dir'] == './bin' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the existing test should be left alone, and a new test added if you want to verify specific values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The old assert where it tries to do "assert section == getattr(ocs.defaults, section_name)" is not valid since it would expect you to have values in default_config.yaml as well as define in defaults.py, The purpose of the PR was to remove the duplicates.
@zmc the dropping of default_config.yaml came up recently, I am not clear on the ideas, so it has to be a follow up PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Attempting to summarize a long BlueJeans call briefly:
- The term 'defaults' wasn't meaning quite the same thing to all of us
- Part of what is in
defaults.py
is actual configuration defaults, while part of it is actually CRD files that test cases deepcopy and extend for their use cases - This PR wants to make
default_config.yaml
the canonical location of the configuration defaults, leaving the CRDs (and a little leftover cruft) indefaults.py
defaults.py
should be renamed to something that better reflects its content, or removed entirely in favor of Avoid the pattern of doing a deepcopy of global data in tests #276 - but not in this PR
Based on the above, 👍
Signed-off-by: Vasu Kulkarni [email protected]