-
Notifications
You must be signed in to change notification settings - Fork 204
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
Config
: add the hidden warnings.rabbitmq_version
option
#5415
Config
: add the hidden warnings.rabbitmq_version
option
#5415
Conversation
7f0387f
to
a7ef8c2
Compare
aiida/manage/manager.py
Outdated
@@ -445,12 +445,18 @@ def check_rabbitmq_version(communicator: 'RmqThreadCommunicator'): | |||
from packaging.version import parse | |||
|
|||
from aiida.cmdline.utils import echo | |||
from aiida.manage.configuration import get_config_option | |||
|
|||
show_warning = get_config_option('warnings.rabbitmq_version') |
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.
show_warning = get_config_option('warnings.rabbitmq_version') | |
show_warning = self.get_option('warnings.rabbitmq_version') |
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.
(FYI this is the code of get_config_option
: return get_manager().get_option(option_name)
, i.e. it is just a shortcut)
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.
Done
Eurgh, this feels like unnecessary extra complexity, just for the sake of hiding one config option, without much testing. IMHO, I would trust users to know what they are doing, if they set this to false. |
I implemented this as a quick proof-of-concept because when I suggested adding this option @giovannipizzi requested it be hidden. I would personally also be fine with just having this as a normal option and leave it up to the user's discretion whether to ignore it. |
a7ef8c2
to
a6080e5
Compare
a6080e5
to
08a4f3f
Compare
@chrisjsewell removed the first commit that added concept of hidden options. Also addressed your other comment and fixed the conditional of the correct RabbitMQ version that we missed in the other PR. |
Well, its a pre-approval, for when the tests are fixed |
08a4f3f
to
4d5ef06
Compare
This option can be used to suppress the warning that is emitted when a profile storage is loaded that is configured with a version of RabbitMQ that is known to be able to cause problems. The option is hidden because the warning is very important and should not easily be ignorable by normal users, but it is mostly intended for developers. The `check_rabbitmq_version` and `check_version` free functions are moved to `Manager` as methods which allows to use `get_option` instead of the `get_config_option` free function which is just an indirect way of calling `Manager.get_option`. The `is_rabbitmq_version_supported` function is also corrected. It was still using `< parse('3.8')` as a condition whereas it should be `< parse('3.8.15')` which was recently already changed for the `check_rabbitmq_version` function.
4d5ef06
to
f4fda1f
Compare
This option can be used to suppress the warning that is emitted when a profile storage is loaded that is configured with a version of RabbitMQ that is known to be able to cause problems. The `check_rabbitmq_version` and `check_version` free functions are moved to `Manager`. The `is_rabbitmq_version_supported` function is removed as it is no longer used. Cherry-pick: 9dd216f
This option can be used to suppress the warning that is emitted when a profile storage is loaded that is configured with a version of RabbitMQ that is known to be able to cause problems. The `check_rabbitmq_version` and `check_version` free functions are moved to `Manager`. The `is_rabbitmq_version_supported` function is removed as it is no longer used. Cherry-pick: 9dd216f
Fixes #5414
This option can be used to suppress the warning that is emitted when a
profile storage is loaded that is configured with a version of RabbitMQ
that is known to be able to cause problems. The option is hidden because
the warning is very important and should not easily be ignorable by
normal users, but it is mostly intended for developers.
The
check_rabbitmq_version
andcheck_version
free functions aremoved to
Manager
as methods which allows to useget_option
insteadof the
get_config_option
free function which is just an indirect wayof calling
Manager.get_option
.The
is_rabbitmq_version_supported
function is also corrected. It wasstill using
< parse('3.8')
as a condition whereas it should be< parse('3.8.15')
which was recently already changed for thecheck_rabbitmq_version
function.