)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"d4e44517f6430212067c6a6d1659527c58f55a34","unresolved":true,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Fix missing oslo.policy options"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This partially reverts 656e71c1020168ddfb049087c1c299ef6521443a ."},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"The set_defaults function should be still called without any overrides"},{"line_number":12,"context_line":"because it registers oslo.policy options."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: Ib53a5ae5e3f2cc34cf1437cfa85a4801c7998e7b"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"ffdab2b1_b86b31dd","line":12,"range":{"start_line":9,"start_character":0,"end_line":12,"end_character":41},"updated":"2024-11-27 18:01:30.000000000","message":"we do not need to register the opts explicitly as it get registered in __init__ mehtod of Enforcer. \n\nhttps://github.com/openstack/oslo.policy/blob/b0473adeae4bb31d0670452f9ba5ad32f2ca82ea/oslo_policy/policy.py#L532\n\nCan you point me to the test failure and I can fix it for tests in right place.","commit_id":"767177b7ac7024dfba8da9eab8cf2f25899c9ad7"},{"author":{"_account_id":9816,"name":"Takashi Kajinami","email":"kajinamit@oss.nttdata.com","username":"kajinamit"},"change_message_id":"18b858eebbf0470d870eed6464329a880efe692d","unresolved":true,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Fix missing oslo.policy options"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This partially reverts 656e71c1020168ddfb049087c1c299ef6521443a ."},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"The set_defaults function should be still called without any overrides"},{"line_number":12,"context_line":"because it registers oslo.policy options."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: Ib53a5ae5e3f2cc34cf1437cfa85a4801c7998e7b"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"65e278e4_cc5238aa","line":12,"range":{"start_line":9,"start_character":0,"end_line":12,"end_character":41},"in_reply_to":"30238821_df8af225","updated":"2024-11-28 09:07:56.000000000","message":"So this is the heat-api log from the change which was merged BEFORE 934567. We see that oslo_policy options are included in the debug log during start up.\n\nhttps://zuul.opendev.org/t/openstack/build/f1a19b7e50834b73bbab20281de95e72/log/controller/logs/screen-h-api.txt#481\n\nOn the other hand when 934567 was merged we no longer see oslo_policy options in start up.\n\nhttps://zuul.opendev.org/t/openstack/build/e98d50d3daae46579adf2ecec4136c8c/log/controller/logs/screen-h-api.txt\n\nI know set_defaults is not for registering options but the fact is that it was actually helping us to register oslo.policy options to dump values in startup debug log. Ideally we may want register_opts method so that projects can register the options early, before they create an enforcer instance if they want ?","commit_id":"767177b7ac7024dfba8da9eab8cf2f25899c9ad7"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"20f9f6b4f3d1a1dea14e25026cb74c1339d98680","unresolved":true,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Fix missing oslo.policy options"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This partially reverts 656e71c1020168ddfb049087c1c299ef6521443a ."},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"The set_defaults function should be still called without any overrides"},{"line_number":12,"context_line":"because it registers oslo.policy options."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: Ib53a5ae5e3f2cc34cf1437cfa85a4801c7998e7b"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"30238821_df8af225","line":12,"range":{"start_line":9,"start_character":0,"end_line":12,"end_character":41},"in_reply_to":"90a7d0a0_5f59fcab","updated":"2024-11-28 02:45:18.000000000","message":"Well, set_defaults() method it not the way to register the config option, it is a way to override the default value. Any lib should register their config option as part of their start-up/initialization/setup, and that is what oslo.policy does during enforcer __init__ method.\n\nWe need to call set_defaults() mainly for tests or where policy is actually not initialized for enforcement of rules but other purpose.\n\nFor the heat tests it is done here https://github.com/openstack/heat/blob/eeaf67d56fd3687c7ab870868558182ed43a28ab/heat/tests/test_common_context.py#L397C21-L397C33\n\nIf you can point me the difference of logging after 934567 merged then I will be able to find the root cause of the issue.","commit_id":"767177b7ac7024dfba8da9eab8cf2f25899c9ad7"},{"author":{"_account_id":9816,"name":"Takashi Kajinami","email":"kajinamit@oss.nttdata.com","username":"kajinamit"},"change_message_id":"193f28711a4434000f42417d3135d1c7723b3faa","unresolved":true,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Fix missing oslo.policy options"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This partially reverts 656e71c1020168ddfb049087c1c299ef6521443a ."},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"The set_defaults function should be still called without any overrides"},{"line_number":12,"context_line":"because it registers oslo.policy options."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: Ib53a5ae5e3f2cc34cf1437cfa85a4801c7998e7b"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"90a7d0a0_5f59fcab","line":12,"range":{"start_line":9,"start_character":0,"end_line":12,"end_character":41},"in_reply_to":"ffdab2b1_b86b31dd","updated":"2024-11-27 18:31:26.000000000","message":"I initially found a few strange failures in https://review.opendev.org/c/openstack/cloudkitty/+/936317 which indicates that oslo.policy options are not registered properly, and noticed that oslo.policy options no longer appear in logs during startup.\n\nWhile we can fix the unit tests failure by additionally registering oslo.policy options explicitly, I\u0027m wondering if current lazy registration is really ideal. One downside is that operators no longer able to check loaded values in debug logs which might make the debugging more difficult.","commit_id":"767177b7ac7024dfba8da9eab8cf2f25899c9ad7"}]}
