-
Notifications
You must be signed in to change notification settings - Fork 125
Make DEFAULT_OS_SEARCH_QUERY configurable #18697
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
base: master
Are you sure you want to change the base?
Conversation
c27668c
to
9397a9d
Compare
Can one of the admins verify this patch? |
I think this is OK but somewhat inconsistent with a lot of other constants that also should be a setting but are constants. And is |
robottelo/config/validators.py
Outdated
Validator( | ||
'server.default_os_search_query', | ||
is_type_of=str, | ||
must_exist=False, |
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 means that the parameter is forbidden from existing and the run will fail in any case (because if it isn't in the config file, we also provide default value):
dynaconf.validator.ValidationError: server.default_os_search_query cannot exists in env main
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.
My comment for must_exist
is a blocker.
9397a9d
to
45ae89a
Compare
@dosas , now you require that parameter in config. I think what you originally wanted to do was to make it optional with default value (and I think that's a good approach). If I understand Dynaconf correctly, you can achieve that by not specifying any value to |
45ae89a
to
a28a552
Compare
Thanks. |
@lhellebr Is there anything left for approval? |
@dosas I have started a PRT job for you. |
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.
Actually, adding one comment where I don't like hardcoded versions so ACK pending PRT and that comment.
@@ -65,3 +65,4 @@ SERVER: | |||
COMMAND_TIMEOUT: 300000 | |||
# Time to wait for establishing the ssh connection, in seconds | |||
CONNECTION_TIMEOUT: 60 | |||
DEFAULT_OS_SEARCH_QUERY: 'name="RedHat" AND (major="6" OR major="7" OR major="8" OR major="9")' |
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.
Why major="6" OR major="7" OR major="8" OR major="9"
? What about 10? What about potential future versions? Why for 6..9?
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.
Are we sure we want to open this can of worms? #10481
@dosas is simply moving the search string from constants to config.
If I understand what all those fixtures are trying to do, it is that they're trying to retrieve an operatingsystem
entity from the API - the same type, family, and version that the server is installed on. Correct?
If I were to suggest a solution, I'd say that sat_object.os_version.major
could help us identify the major version of the OS, and we could base the search string on that.
Or could we use the default_os
fixture instead of these custom fixtures that are being modified as a part of this PR?
Validator( | ||
'server.default_os_search_query', | ||
is_type_of=str, | ||
default='name="RedHat" AND (major="6" OR major="7" OR major="8" OR major="9")', |
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.
And here
Problem Statement
DEFAULT_OS_SEARCH_QUERY is not configurable via settings
Solution
Make it configurable via settings
Tests to run