)]}'
{".gitignore":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"4175c0fe17d2c4b909c00a8a8fc0b3dc4ad25f59","unresolved":true,"context_lines":[{"line_number":35,"context_line":"RELEASENOTES.rst"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"# ide"},{"line_number":38,"context_line":".idea/*"}],"source_content_type":"application/octet-stream","patch_set":7,"id":"932a432f_bc065f71","line":38,"updated":"2021-10-07 10:13:53.000000000","message":"You don\u0027t need to do this. You can configure it globally, which is what we recommend for editor-specific configuration.\n\n[1] https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files#configuring-ignored-files-for-all-repositories-on-your-computer","commit_id":"695ba0d963dd0cb994d8cc5d19b234c5e5ee2e52"},{"author":{"_account_id":32927,"name":"mitya-eremeev-2","display_name":"Mitya Eremeev","email":"mitossvyaz@mail.ru","username":"mitya-eremeev-2"},"change_message_id":"a6331e2ac2524c5a04def47a103651d185708f49","unresolved":true,"context_lines":[{"line_number":35,"context_line":"RELEASENOTES.rst"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"# ide"},{"line_number":38,"context_line":".idea/*"}],"source_content_type":"application/octet-stream","patch_set":7,"id":"9d845bdb_cbd384b7","line":38,"in_reply_to":"932a432f_bc065f71","updated":"2021-10-11 08:57:00.000000000","message":"done","commit_id":"695ba0d963dd0cb994d8cc5d19b234c5e5ee2e52"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"fe5be449ad0195d2dcfc6eff722cc62c659ef884","unresolved":false,"context_lines":[{"line_number":35,"context_line":"RELEASENOTES.rst"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"# ide"},{"line_number":38,"context_line":".idea/*"}],"source_content_type":"application/octet-stream","patch_set":7,"id":"92551833_0c60a6fe","line":38,"in_reply_to":"9d845bdb_cbd384b7","updated":"2021-10-21 10:00:33.000000000","message":"Ack","commit_id":"695ba0d963dd0cb994d8cc5d19b234c5e5ee2e52"}],"/COMMIT_MSG":[{"author":{"_account_id":2218,"name":"Adam Young","email":"adam@younglogic.com","username":"ayoung"},"change_message_id":"8aea43169383507e8d937c9e4dcfaad1875b2e18","unresolved":true,"context_lines":[{"line_number":4,"context_line":"Commit:     Mitya_Eremeev \u003cmitossvyaz@mail.ru\u003e"},{"line_number":5,"context_line":"CommitDate: 2021-09-20 17:51:18 +0300"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Policy directory files cannot reset rules."},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Policy directory rules only can add new rules or"},{"line_number":10,"context_line":"update existing rules in cache, but cannot reset rules"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"c6780c3e_dd1522b4","line":7,"updated":"2021-09-27 16:49:23.000000000","message":"Is this the problem, or is this the fix?  I assume the fix( have not read forward yet) and so this should read about what it is enabling.","commit_id":"a21d2cb1b721f61e017362172e33980f9dd19ee8"},{"author":{"_account_id":32927,"name":"mitya-eremeev-2","display_name":"Mitya Eremeev","email":"mitossvyaz@mail.ru","username":"mitya-eremeev-2"},"change_message_id":"9006f45bec462f7e754bc4d592c74997bca39f7f","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Mitya_Eremeev \u003cmitossvyaz@mail.ru\u003e"},{"line_number":5,"context_line":"CommitDate: 2021-09-20 17:51:18 +0300"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Policy directory files cannot reset rules."},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Policy directory rules only can add new rules or"},{"line_number":10,"context_line":"update existing rules in cache, but cannot reset rules"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"18599242_79f95876","line":7,"in_reply_to":"c6780c3e_dd1522b4","updated":"2021-09-27 17:15:25.000000000","message":"Done","commit_id":"a21d2cb1b721f61e017362172e33980f9dd19ee8"},{"author":{"_account_id":2218,"name":"Adam Young","email":"adam@younglogic.com","username":"ayoung"},"change_message_id":"8aea43169383507e8d937c9e4dcfaad1875b2e18","unresolved":true,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Policy directory files cannot reset rules."},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Policy directory rules only can add new rules or"},{"line_number":10,"context_line":"update existing rules in cache, but cannot reset rules"},{"line_number":11,"context_line":"that were set in previous file editions."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"611aa362_3403f57c","line":9,"updated":"2021-09-27 16:49:23.000000000","message":"This is the \"before state?\"","commit_id":"a21d2cb1b721f61e017362172e33980f9dd19ee8"},{"author":{"_account_id":32927,"name":"mitya-eremeev-2","display_name":"Mitya Eremeev","email":"mitossvyaz@mail.ru","username":"mitya-eremeev-2"},"change_message_id":"9006f45bec462f7e754bc4d592c74997bca39f7f","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Policy directory files cannot reset rules."},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Policy directory rules only can add new rules or"},{"line_number":10,"context_line":"update existing rules in cache, but cannot reset rules"},{"line_number":11,"context_line":"that were set in previous file editions."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"a5a11f5d_7d08e124","line":9,"in_reply_to":"611aa362_3403f57c","updated":"2021-09-27 17:15:25.000000000","message":"Done","commit_id":"a21d2cb1b721f61e017362172e33980f9dd19ee8"},{"author":{"_account_id":2218,"name":"Adam Young","email":"adam@younglogic.com","username":"ayoung"},"change_message_id":"8aea43169383507e8d937c9e4dcfaad1875b2e18","unresolved":true,"context_lines":[{"line_number":13,"context_line":"Also Member \"_loaded_files\" of class Enforcer should keep"},{"line_number":14,"context_line":"list of loaded policy config files pathes."},{"line_number":15,"context_line":"In fact if the same file is changed many times"},{"line_number":16,"context_line":"then the same file path is added many times."},{"line_number":17,"context_line":"If a file is deleted it\u0027s path not deleted from \"_loaded_files\"."},{"line_number":18,"context_line":"The member is very misleading and is not used in code."},{"line_number":19,"context_line":"So this member was deleted in code."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"eace40f7_0d070dc2","line":16,"updated":"2021-09-27 16:49:23.000000000","message":"Is this what it should do ( does after this patch) or what it is currently doing incorrectly.","commit_id":"a21d2cb1b721f61e017362172e33980f9dd19ee8"},{"author":{"_account_id":32927,"name":"mitya-eremeev-2","display_name":"Mitya Eremeev","email":"mitossvyaz@mail.ru","username":"mitya-eremeev-2"},"change_message_id":"9006f45bec462f7e754bc4d592c74997bca39f7f","unresolved":false,"context_lines":[{"line_number":13,"context_line":"Also Member \"_loaded_files\" of class Enforcer should keep"},{"line_number":14,"context_line":"list of loaded policy config files pathes."},{"line_number":15,"context_line":"In fact if the same file is changed many times"},{"line_number":16,"context_line":"then the same file path is added many times."},{"line_number":17,"context_line":"If a file is deleted it\u0027s path not deleted from \"_loaded_files\"."},{"line_number":18,"context_line":"The member is very misleading and is not used in code."},{"line_number":19,"context_line":"So this member was deleted in code."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"4bfe7cc2_d38ba2d7","line":16,"in_reply_to":"eace40f7_0d070dc2","updated":"2021-09-27 17:15:25.000000000","message":"Done","commit_id":"a21d2cb1b721f61e017362172e33980f9dd19ee8"},{"author":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"change_message_id":"deef55f154af061b6757c5ac229d664300153688","unresolved":true,"context_lines":[{"line_number":12,"context_line":"This incorrect behavior was fixed in the patch."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Member \"_loaded_files\" of class Enforcer should keep"},{"line_number":15,"context_line":"list of loaded policy config files pathes."},{"line_number":16,"context_line":"In fact if the same file is changed many times"},{"line_number":17,"context_line":"then the same file path is added many times."},{"line_number":18,"context_line":"If a file is deleted it\u0027s path not deleted from \"_loaded_files\"."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"08664e5e_1c10cf3c","line":15,"range":{"start_line":15,"start_character":35,"end_line":15,"end_character":41},"updated":"2021-10-14 12:26:05.000000000","message":"paths","commit_id":"0c16116a0e06f22e5bf03477af4ea977e8006006"},{"author":{"_account_id":32927,"name":"mitya-eremeev-2","display_name":"Mitya Eremeev","email":"mitossvyaz@mail.ru","username":"mitya-eremeev-2"},"change_message_id":"080f1ed19e528a1353d2e9a68e0be4b0ed2ce11b","unresolved":false,"context_lines":[{"line_number":12,"context_line":"This incorrect behavior was fixed in the patch."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Member \"_loaded_files\" of class Enforcer should keep"},{"line_number":15,"context_line":"list of loaded policy config files pathes."},{"line_number":16,"context_line":"In fact if the same file is changed many times"},{"line_number":17,"context_line":"then the same file path is added many times."},{"line_number":18,"context_line":"If a file is deleted it\u0027s path not deleted from \"_loaded_files\"."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"c0fd31de_ce3d409f","line":15,"range":{"start_line":15,"start_character":35,"end_line":15,"end_character":41},"in_reply_to":"08664e5e_1c10cf3c","updated":"2021-10-14 17:18:21.000000000","message":"Done","commit_id":"0c16116a0e06f22e5bf03477af4ea977e8006006"},{"author":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"change_message_id":"deef55f154af061b6757c5ac229d664300153688","unresolved":true,"context_lines":[{"line_number":18,"context_line":"If a file is deleted it\u0027s path not deleted from \"_loaded_files\"."},{"line_number":19,"context_line":"The member is very misleading and is not used in code."},{"line_number":20,"context_line":"So this member was deleted in the patch because of"},{"line_number":21,"context_line":"abovementioned resons."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"Change-Id: I9ede38d8cf2ae968d3d8c0b1240bd6a51e6aa931"},{"line_number":24,"context_line":"Closes-Bug: 1943584"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"8e5184bb_5788e28e","line":21,"range":{"start_line":21,"start_character":0,"end_line":21,"end_character":14},"updated":"2021-10-14 12:26:05.000000000","message":"above mentioned","commit_id":"0c16116a0e06f22e5bf03477af4ea977e8006006"},{"author":{"_account_id":32927,"name":"mitya-eremeev-2","display_name":"Mitya Eremeev","email":"mitossvyaz@mail.ru","username":"mitya-eremeev-2"},"change_message_id":"080f1ed19e528a1353d2e9a68e0be4b0ed2ce11b","unresolved":false,"context_lines":[{"line_number":18,"context_line":"If a file is deleted it\u0027s path not deleted from \"_loaded_files\"."},{"line_number":19,"context_line":"The member is very misleading and is not used in code."},{"line_number":20,"context_line":"So this member was deleted in the patch because of"},{"line_number":21,"context_line":"abovementioned resons."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"Change-Id: I9ede38d8cf2ae968d3d8c0b1240bd6a51e6aa931"},{"line_number":24,"context_line":"Closes-Bug: 1943584"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"f5a89bfd_782e3bc9","line":21,"range":{"start_line":21,"start_character":0,"end_line":21,"end_character":14},"in_reply_to":"8e5184bb_5788e28e","updated":"2021-10-14 17:18:21.000000000","message":"Done","commit_id":"0c16116a0e06f22e5bf03477af4ea977e8006006"}],"/PATCHSET_LEVEL":[{"author":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"change_message_id":"deef55f154af061b6757c5ac229d664300153688","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":8,"id":"06d7d6d1_711d58e7","updated":"2021-10-14 12:26:05.000000000","message":"Hello,\n\nI\u0027d suggest to add a release note too to highlight this bug fix.\n\nConcerning Stephen\u0027s comment they seems more or less addressed however I think you wait some reply from Stephen concerning one or two points. \n\nAlso Stephen asked you to add unit tests, I think the one you provided with PS8 is ok.","commit_id":"0c16116a0e06f22e5bf03477af4ea977e8006006"},{"author":{"_account_id":32927,"name":"mitya-eremeev-2","display_name":"Mitya Eremeev","email":"mitossvyaz@mail.ru","username":"mitya-eremeev-2"},"change_message_id":"a6331e2ac2524c5a04def47a103651d185708f49","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":8,"id":"e34cdf53_ecd4bf17","updated":"2021-10-11 08:57:00.000000000","message":"I fixed what you asked.\nPlease review.","commit_id":"0c16116a0e06f22e5bf03477af4ea977e8006006"},{"author":{"_account_id":32927,"name":"mitya-eremeev-2","display_name":"Mitya Eremeev","email":"mitossvyaz@mail.ru","username":"mitya-eremeev-2"},"change_message_id":"080f1ed19e528a1353d2e9a68e0be4b0ed2ce11b","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":8,"id":"2016972f_156b0ce4","in_reply_to":"06d7d6d1_711d58e7","updated":"2021-10-14 17:18:21.000000000","message":"done","commit_id":"0c16116a0e06f22e5bf03477af4ea977e8006006"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"35fb1df60886e5a7f1a48afda85ee9973ac01452","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"fbcdddcc_ce1e766e","updated":"2021-10-21 10:00:53.000000000","message":"Also, the -1 is a soft -1 to catch your attention. I\u0027m still not sure whether anything is actually wrong here.","commit_id":"949289e094090757576f9251019e10d53af7a663"},{"author":{"_account_id":32927,"name":"mitya-eremeev-2","display_name":"Mitya Eremeev","email":"mitossvyaz@mail.ru","username":"mitya-eremeev-2"},"change_message_id":"75c2c3537be2165665ac0759286d07e001845416","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"abb058a8_13e7a3c4","updated":"2021-10-21 10:44:03.000000000","message":"Hello, Stephen !\n\nI replied all your questions.\nI see your doubts.\nThe code is not readable because of initial structure of the function.\nI tried to change code as little as possible, not to refactor it.\nThank you.","commit_id":"949289e094090757576f9251019e10d53af7a663"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"fe5be449ad0195d2dcfc6eff722cc62c659ef884","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"abd5b757_06c09f00","updated":"2021-10-21 10:00:33.000000000","message":"I\u0027m sorry for being so dense here. I\u0027m just trying to understand this solution before I agree to it. Please let me know if anything I said doesn\u0027t make sense!","commit_id":"949289e094090757576f9251019e10d53af7a663"},{"author":{"_account_id":32927,"name":"mitya-eremeev-2","display_name":"Mitya Eremeev","email":"mitossvyaz@mail.ru","username":"mitya-eremeev-2"},"change_message_id":"c42db919d411e9b7f5785464960509ad7112b544","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"4427ae58_15bde644","updated":"2021-10-21 13:06:53.000000000","message":"Thank you very much for code review.","commit_id":"949289e094090757576f9251019e10d53af7a663"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"2d407ceeae6cf42dd181e66197972c22ae27664a","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"eca0a408_46f99828","updated":"2021-10-21 12:56:51.000000000","message":"Thanks for walking me through this!","commit_id":"949289e094090757576f9251019e10d53af7a663"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"3b32c8f7f8048fb0ab03077a832788060fa5047b","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"1cbbb5dc_5906eb48","updated":"2021-10-21 11:04:52.000000000","message":"Think I\u0027m almost there. One final question about whether we need to explicitly set overwrite\u003dTrue","commit_id":"949289e094090757576f9251019e10d53af7a663"}],"oslo_policy/policy.py":[{"author":{"_account_id":21813,"name":"Andrey Volkov","email":"m@amadev.ru","username":"avolkov"},"change_message_id":"ecd421f53320db15c9389c557fa236ac02766d50","unresolved":true,"context_lines":[{"line_number":637,"context_line":"                if (self._is_directory_updated(self._policy_dir_mtimes, path)"},{"line_number":638,"context_line":"                        or force_reload_policy_dir):"},{"line_number":639,"context_line":"                    if self.policy_path:"},{"line_number":640,"context_line":"                        if not policy_file_rules_changed:"},{"line_number":641,"context_line":"                            self._load_policy_file(self.policy_path,"},{"line_number":642,"context_line":"                                                   force_reload\u003dTrue,"},{"line_number":643,"context_line":"                                                   overwrite\u003dself.overwrite"}],"source_content_type":"text/x-python","patch_set":2,"id":"0c1b40de_0f6cc358","line":640,"range":{"start_line":640,"start_character":27,"end_line":640,"end_character":56},"updated":"2021-09-15 06:50:28.000000000","message":"Load only if no changes. Sounds a bit suspicious :) any comments?","commit_id":"f070442595df463cefb3f275b25837f4bb80b385"},{"author":{"_account_id":32927,"name":"mitya-eremeev-2","display_name":"Mitya Eremeev","email":"mitossvyaz@mail.ru","username":"mitya-eremeev-2"},"change_message_id":"eb7905c654891e548ea059ee9cea370d92a65aec","unresolved":true,"context_lines":[{"line_number":637,"context_line":"                if (self._is_directory_updated(self._policy_dir_mtimes, path)"},{"line_number":638,"context_line":"                        or force_reload_policy_dir):"},{"line_number":639,"context_line":"                    if self.policy_path:"},{"line_number":640,"context_line":"                        if not policy_file_rules_changed:"},{"line_number":641,"context_line":"                            self._load_policy_file(self.policy_path,"},{"line_number":642,"context_line":"                                                   force_reload\u003dTrue,"},{"line_number":643,"context_line":"                                                   overwrite\u003dself.overwrite"}],"source_content_type":"text/x-python","patch_set":2,"id":"b71f1c7b_df80e35b","line":640,"range":{"start_line":640,"start_character":27,"end_line":640,"end_character":56},"in_reply_to":"0c1b40de_0f6cc358","updated":"2021-09-15 07:16:05.000000000","message":"If policy_file_rules_changed is True then we are sure that all rules were reset and reloaded from scratch on line 622.\nSo we don\u0027t need to calculate rules one more time.\nWe only need to aply rules of policy.d folder on top of rules in main policy file.","commit_id":"f070442595df463cefb3f275b25837f4bb80b385"},{"author":{"_account_id":21813,"name":"Andrey Volkov","email":"m@amadev.ru","username":"avolkov"},"change_message_id":"ecd421f53320db15c9389c557fa236ac02766d50","unresolved":true,"context_lines":[{"line_number":638,"context_line":"                        or force_reload_policy_dir):"},{"line_number":639,"context_line":"                    if self.policy_path:"},{"line_number":640,"context_line":"                        if not policy_file_rules_changed:"},{"line_number":641,"context_line":"                            self._load_policy_file(self.policy_path,"},{"line_number":642,"context_line":"                                                   force_reload\u003dTrue,"},{"line_number":643,"context_line":"                                                   overwrite\u003dself.overwrite"},{"line_number":644,"context_line":"                                                   )"}],"source_content_type":"text/x-python","patch_set":2,"id":"3dda267d_64378b20","line":641,"range":{"start_line":641,"start_character":28,"end_line":641,"end_character":68},"updated":"2021-09-15 06:50:28.000000000","message":"Not sure I understand why this done in cycle. Seems not using any cycle vars (path). Am I missing something?","commit_id":"f070442595df463cefb3f275b25837f4bb80b385"},{"author":{"_account_id":32927,"name":"mitya-eremeev-2","display_name":"Mitya Eremeev","email":"mitossvyaz@mail.ru","username":"mitya-eremeev-2"},"change_message_id":"eb7905c654891e548ea059ee9cea370d92a65aec","unresolved":true,"context_lines":[{"line_number":638,"context_line":"                        or force_reload_policy_dir):"},{"line_number":639,"context_line":"                    if self.policy_path:"},{"line_number":640,"context_line":"                        if not policy_file_rules_changed:"},{"line_number":641,"context_line":"                            self._load_policy_file(self.policy_path,"},{"line_number":642,"context_line":"                                                   force_reload\u003dTrue,"},{"line_number":643,"context_line":"                                                   overwrite\u003dself.overwrite"},{"line_number":644,"context_line":"                                                   )"}],"source_content_type":"text/x-python","patch_set":2,"id":"6b8b9be0_842383bd","line":641,"range":{"start_line":641,"start_character":28,"end_line":641,"end_character":68},"in_reply_to":"3dda267d_64378b20","updated":"2021-09-15 07:16:05.000000000","message":"This function was called in different way then before.\nNow it was called with \"force_reload\u003dTrue\", which guarantees that all rules will be reset and main policy file will be reloaded no matter it was changed or not.\nAfter that rules from policy.d folder will be applied on top of rules in main policy file.","commit_id":"f070442595df463cefb3f275b25837f4bb80b385"},{"author":{"_account_id":32927,"name":"mitya-eremeev-2","display_name":"Mitya Eremeev","email":"mitossvyaz@mail.ru","username":"mitya-eremeev-2"},"change_message_id":"108f2f063f0205125030fba771b4e79ffde7972c","unresolved":true,"context_lines":[{"line_number":638,"context_line":"                        or force_reload_policy_dir):"},{"line_number":639,"context_line":"                    if self.policy_path:"},{"line_number":640,"context_line":"                        if not policy_file_rules_changed:"},{"line_number":641,"context_line":"                            self._load_policy_file(self.policy_path,"},{"line_number":642,"context_line":"                                                   force_reload\u003dTrue,"},{"line_number":643,"context_line":"                                                   overwrite\u003dself.overwrite"},{"line_number":644,"context_line":"                                                   )"}],"source_content_type":"text/x-python","patch_set":2,"id":"c6a264b3_efe88e90","line":641,"range":{"start_line":641,"start_character":28,"end_line":641,"end_character":68},"in_reply_to":"6b8b9be0_842383bd","updated":"2021-09-15 07:27:14.000000000","message":"Now I understood you.\nI fixed code in the way that we have only one policy.d folder.\nBut we can have multiple policy.d folders.","commit_id":"f070442595df463cefb3f275b25837f4bb80b385"},{"author":{"_account_id":32927,"name":"mitya-eremeev-2","display_name":"Mitya Eremeev","email":"mitossvyaz@mail.ru","username":"mitya-eremeev-2"},"change_message_id":"aa66459496df39f44b5f5571faf66691b7eabe06","unresolved":true,"context_lines":[{"line_number":638,"context_line":"                        or force_reload_policy_dir):"},{"line_number":639,"context_line":"                    if self.policy_path:"},{"line_number":640,"context_line":"                        if not policy_file_rules_changed:"},{"line_number":641,"context_line":"                            self._load_policy_file(self.policy_path,"},{"line_number":642,"context_line":"                                                   force_reload\u003dTrue,"},{"line_number":643,"context_line":"                                                   overwrite\u003dself.overwrite"},{"line_number":644,"context_line":"                                                   )"}],"source_content_type":"text/x-python","patch_set":2,"id":"90aca364_6a8aae9f","line":641,"range":{"start_line":641,"start_character":28,"end_line":641,"end_character":68},"in_reply_to":"c6a264b3_efe88e90","updated":"2021-09-20 17:33:41.000000000","message":"Done","commit_id":"f070442595df463cefb3f275b25837f4bb80b385"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"4175c0fe17d2c4b909c00a8a8fc0b3dc4ad25f59","unresolved":true,"context_lines":[{"line_number":628,"context_line":"            force_reload_policy_dirs \u003d force_reload"},{"line_number":629,"context_line":"            if policy_file_rules_changed:"},{"line_number":630,"context_line":"                force_reload_policy_dirs \u003d True"},{"line_number":631,"context_line":"            existing_policy_dirs \u003d list()"},{"line_number":632,"context_line":"            for path in self.conf.oslo_policy.policy_dirs:"},{"line_number":633,"context_line":"                try:"},{"line_number":634,"context_line":"                    path \u003d self._get_policy_path(path)"}],"source_content_type":"text/x-python","patch_set":7,"id":"104340e2_7fa50de4","line":631,"updated":"2021-10-07 10:13:53.000000000","message":"nit: use literals where possible\n\n  existing_policy_dirs \u003d []\n\nAlso, can you add a newline after this?","commit_id":"695ba0d963dd0cb994d8cc5d19b234c5e5ee2e52"},{"author":{"_account_id":32927,"name":"mitya-eremeev-2","display_name":"Mitya Eremeev","email":"mitossvyaz@mail.ru","username":"mitya-eremeev-2"},"change_message_id":"a6331e2ac2524c5a04def47a103651d185708f49","unresolved":false,"context_lines":[{"line_number":628,"context_line":"            force_reload_policy_dirs \u003d force_reload"},{"line_number":629,"context_line":"            if policy_file_rules_changed:"},{"line_number":630,"context_line":"                force_reload_policy_dirs \u003d True"},{"line_number":631,"context_line":"            existing_policy_dirs \u003d list()"},{"line_number":632,"context_line":"            for path in self.conf.oslo_policy.policy_dirs:"},{"line_number":633,"context_line":"                try:"},{"line_number":634,"context_line":"                    path \u003d self._get_policy_path(path)"}],"source_content_type":"text/x-python","patch_set":7,"id":"4e8a3221_969bfb34","line":631,"in_reply_to":"104340e2_7fa50de4","updated":"2021-10-11 08:57:00.000000000","message":"Done","commit_id":"695ba0d963dd0cb994d8cc5d19b234c5e5ee2e52"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"4175c0fe17d2c4b909c00a8a8fc0b3dc4ad25f59","unresolved":true,"context_lines":[{"line_number":632,"context_line":"            for path in self.conf.oslo_policy.policy_dirs:"},{"line_number":633,"context_line":"                try:"},{"line_number":634,"context_line":"                    path \u003d self._get_policy_path(path)"},{"line_number":635,"context_line":"                    existing_policy_dirs.append(path)"},{"line_number":636,"context_line":"                except cfg.ConfigFilesNotFoundError:"},{"line_number":637,"context_line":"                    continue"},{"line_number":638,"context_line":"                if self._is_directory_updated(self._policy_dir_mtimes,"}],"source_content_type":"text/x-python","patch_set":7,"id":"474e2619_1958c63c","line":635,"updated":"2021-10-07 10:13:53.000000000","message":"nit:\n\n  existing_policy_dirs.append(self._get_policy_path(path))\n\navoids redefining \u0027path\u0027","commit_id":"695ba0d963dd0cb994d8cc5d19b234c5e5ee2e52"},{"author":{"_account_id":32927,"name":"mitya-eremeev-2","display_name":"Mitya Eremeev","email":"mitossvyaz@mail.ru","username":"mitya-eremeev-2"},"change_message_id":"a6331e2ac2524c5a04def47a103651d185708f49","unresolved":false,"context_lines":[{"line_number":632,"context_line":"            for path in self.conf.oslo_policy.policy_dirs:"},{"line_number":633,"context_line":"                try:"},{"line_number":634,"context_line":"                    path \u003d self._get_policy_path(path)"},{"line_number":635,"context_line":"                    existing_policy_dirs.append(path)"},{"line_number":636,"context_line":"                except cfg.ConfigFilesNotFoundError:"},{"line_number":637,"context_line":"                    continue"},{"line_number":638,"context_line":"                if self._is_directory_updated(self._policy_dir_mtimes,"}],"source_content_type":"text/x-python","patch_set":7,"id":"52ba1815_363579c4","line":635,"in_reply_to":"474e2619_1958c63c","updated":"2021-10-11 08:57:00.000000000","message":"I need to have some variable because it\u0027s used in 2 places: l.636, 646.\nI renamed variable, now \"path\" is not redefined.","commit_id":"695ba0d963dd0cb994d8cc5d19b234c5e5ee2e52"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"4175c0fe17d2c4b909c00a8a8fc0b3dc4ad25f59","unresolved":true,"context_lines":[{"line_number":636,"context_line":"                except cfg.ConfigFilesNotFoundError:"},{"line_number":637,"context_line":"                    continue"},{"line_number":638,"context_line":"                if self._is_directory_updated(self._policy_dir_mtimes,"},{"line_number":639,"context_line":"                                              path):"},{"line_number":640,"context_line":"                    force_reload_policy_dirs \u003d True"},{"line_number":641,"context_line":"            if force_reload_policy_dirs and existing_policy_dirs:"},{"line_number":642,"context_line":"                if self.policy_path:"}],"source_content_type":"text/x-python","patch_set":7,"id":"a0f13a84_75252a21","line":639,"updated":"2021-10-07 10:13:53.000000000","message":"nit: can fit on one line","commit_id":"695ba0d963dd0cb994d8cc5d19b234c5e5ee2e52"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"4175c0fe17d2c4b909c00a8a8fc0b3dc4ad25f59","unresolved":true,"context_lines":[{"line_number":637,"context_line":"                    continue"},{"line_number":638,"context_line":"                if self._is_directory_updated(self._policy_dir_mtimes,"},{"line_number":639,"context_line":"                                              path):"},{"line_number":640,"context_line":"                    force_reload_policy_dirs \u003d True"},{"line_number":641,"context_line":"            if force_reload_policy_dirs and existing_policy_dirs:"},{"line_number":642,"context_line":"                if self.policy_path:"},{"line_number":643,"context_line":"                    if not policy_file_rules_changed:"}],"source_content_type":"text/x-python","patch_set":7,"id":"a1202d4f_75bf7a04","line":640,"updated":"2021-10-07 10:13:53.000000000","message":"This is a change in behavior. Previously, if \u0027force_reload_policy_dir\u0027 was False, then we would determine whether we should scan a directory for policy changes on a directory-by-directory basis. For example, if dir_a was updated but dir_b was not then we\u0027d only scan dir_a for updates. With this change, we now scan all directories if a single one changes (so both dir_a and dir_b in this example). Was that intentional? If so, can you add a comment explaining why this is necessary for future reviewers.","commit_id":"695ba0d963dd0cb994d8cc5d19b234c5e5ee2e52"},{"author":{"_account_id":32927,"name":"mitya-eremeev-2","display_name":"Mitya Eremeev","email":"mitossvyaz@mail.ru","username":"mitya-eremeev-2"},"change_message_id":"dffa315339fe270654986aecf173bf307bca74a6","unresolved":true,"context_lines":[{"line_number":637,"context_line":"                    continue"},{"line_number":638,"context_line":"                if self._is_directory_updated(self._policy_dir_mtimes,"},{"line_number":639,"context_line":"                                              path):"},{"line_number":640,"context_line":"                    force_reload_policy_dirs \u003d True"},{"line_number":641,"context_line":"            if force_reload_policy_dirs and existing_policy_dirs:"},{"line_number":642,"context_line":"                if self.policy_path:"},{"line_number":643,"context_line":"                    if not policy_file_rules_changed:"}],"source_content_type":"text/x-python","patch_set":7,"id":"ddf55d42_c8cd0e4b","line":640,"in_reply_to":"a1202d4f_75bf7a04","updated":"2021-10-07 12:02:28.000000000","message":"Yes, if change was made in any policy directory or main policy file then all policy directories and main file are re-calculated from scratch.\nWe don\u0027t have separate rule sets for every policy folder, we only have the only rule set in RAM for all rule configs (self.rules)\nSo it\u0027s the only way to be consistent.\nI gave a short example how current behavior is misleading:\nhttps://bugs.launchpad.net/oslo.policy/+bug/1943584/comments/3\n\nComments in code will be added soon.","commit_id":"695ba0d963dd0cb994d8cc5d19b234c5e5ee2e52"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"4175c0fe17d2c4b909c00a8a8fc0b3dc4ad25f59","unresolved":true,"context_lines":[{"line_number":646,"context_line":"                                               overwrite\u003dself.overwrite"},{"line_number":647,"context_line":"                                               )"},{"line_number":648,"context_line":"                else:"},{"line_number":649,"context_line":"                    self.rules \u003d Rules(default_rule\u003dself.default_rule)"},{"line_number":650,"context_line":"                for path in existing_policy_dirs:"},{"line_number":651,"context_line":"                    self._walk_through_policy_directory("},{"line_number":652,"context_line":"                        path, self._load_policy_file, True, False)"}],"source_content_type":"text/x-python","patch_set":7,"id":"ea299226_17687a73","line":649,"updated":"2021-10-07 10:13:53.000000000","message":"I must admit I\u0027m struggling to follow the logic here. Why are we loading the policy file at \u0027self.policy_path\u0027 again? We already did this above starting on line 622. Could you add some comments explaining why you\u0027re doing this and what role the conditional plays?","commit_id":"695ba0d963dd0cb994d8cc5d19b234c5e5ee2e52"},{"author":{"_account_id":32927,"name":"mitya-eremeev-2","display_name":"Mitya Eremeev","email":"mitossvyaz@mail.ru","username":"mitya-eremeev-2"},"change_message_id":"dffa315339fe270654986aecf173bf307bca74a6","unresolved":true,"context_lines":[{"line_number":646,"context_line":"                                               overwrite\u003dself.overwrite"},{"line_number":647,"context_line":"                                               )"},{"line_number":648,"context_line":"                else:"},{"line_number":649,"context_line":"                    self.rules \u003d Rules(default_rule\u003dself.default_rule)"},{"line_number":650,"context_line":"                for path in existing_policy_dirs:"},{"line_number":651,"context_line":"                    self._walk_through_policy_directory("},{"line_number":652,"context_line":"                        path, self._load_policy_file, True, False)"}],"source_content_type":"text/x-python","patch_set":7,"id":"d6779212_73bd5368","line":649,"in_reply_to":"ea299226_17687a73","updated":"2021-10-07 12:02:28.000000000","message":"\"if force_reload_policy_dirs and existing_policy_dirs:\"\nHere we realize that some policy folders or main policy file were changed and we need to recalculate all rules from scratch, including a main policy file and all policy folders.\nFirst we care about a main policy file. We look at \"policy_file_rules_changed\". If it\u0027s true then we know:\n1. all rules were already reset here: https://review.opendev.org/c/openstack/oslo.policy/+/808957/7/oslo_policy/policy.py#622\n2. rules from main policy file were already applied.\n\nIf \"policy_file_rules_changed\" is False, then we know that main policy file was not changed and rules were not reset and rules from main policy file were not applied on top of empty \"self.rules\" yet. So we reset rules and force to re-calculate rules in main policy file. And after that we apply rules from every policy directory.\n\nI agree with you that the function is a bit \"ugly\" and \"spaghetti\" code.\nI can refactor the whole function to be more readable, but I\u0027m afraid core reviewers are not happy about it because my task is only to fix a bug.","commit_id":"695ba0d963dd0cb994d8cc5d19b234c5e5ee2e52"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"4175c0fe17d2c4b909c00a8a8fc0b3dc4ad25f59","unresolved":true,"context_lines":[{"line_number":648,"context_line":"                else:"},{"line_number":649,"context_line":"                    self.rules \u003d Rules(default_rule\u003dself.default_rule)"},{"line_number":650,"context_line":"                for path in existing_policy_dirs:"},{"line_number":651,"context_line":"                    self._walk_through_policy_directory("},{"line_number":652,"context_line":"                        path, self._load_policy_file, True, False)"},{"line_number":653,"context_line":""},{"line_number":654,"context_line":"            for default in self.registered_rules.values():"}],"source_content_type":"text/x-python","patch_set":7,"id":"1c96cd7e_6bdb2bfe","line":651,"updated":"2021-10-07 10:13:53.000000000","message":"This only has one caller (this one)...","commit_id":"695ba0d963dd0cb994d8cc5d19b234c5e5ee2e52"},{"author":{"_account_id":32927,"name":"mitya-eremeev-2","display_name":"Mitya Eremeev","email":"mitossvyaz@mail.ru","username":"mitya-eremeev-2"},"change_message_id":"dffa315339fe270654986aecf173bf307bca74a6","unresolved":true,"context_lines":[{"line_number":648,"context_line":"                else:"},{"line_number":649,"context_line":"                    self.rules \u003d Rules(default_rule\u003dself.default_rule)"},{"line_number":650,"context_line":"                for path in existing_policy_dirs:"},{"line_number":651,"context_line":"                    self._walk_through_policy_directory("},{"line_number":652,"context_line":"                        path, self._load_policy_file, True, False)"},{"line_number":653,"context_line":""},{"line_number":654,"context_line":"            for default in self.registered_rules.values():"}],"source_content_type":"text/x-python","patch_set":7,"id":"9acada91_fd64e8e5","line":651,"in_reply_to":"1c96cd7e_6bdb2bfe","updated":"2021-10-07 12:02:28.000000000","message":"Sorry, I didn\u0027t get what you mean.\nCould you elaborate please ?","commit_id":"695ba0d963dd0cb994d8cc5d19b234c5e5ee2e52"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"4175c0fe17d2c4b909c00a8a8fc0b3dc4ad25f59","unresolved":true,"context_lines":[{"line_number":649,"context_line":"                    self.rules \u003d Rules(default_rule\u003dself.default_rule)"},{"line_number":650,"context_line":"                for path in existing_policy_dirs:"},{"line_number":651,"context_line":"                    self._walk_through_policy_directory("},{"line_number":652,"context_line":"                        path, self._load_policy_file, True, False)"},{"line_number":653,"context_line":""},{"line_number":654,"context_line":"            for default in self.registered_rules.values():"},{"line_number":655,"context_line":"                if default.deprecated_for_removal:"}],"source_content_type":"text/x-python","patch_set":7,"id":"2913dd01_65b4cdb3","line":652,"range":{"start_line":652,"start_character":54,"end_line":652,"end_character":58},"updated":"2021-10-07 10:13:53.000000000","message":"...so we should drop this argument and any branches in the called code where this is False","commit_id":"695ba0d963dd0cb994d8cc5d19b234c5e5ee2e52"},{"author":{"_account_id":32927,"name":"mitya-eremeev-2","display_name":"Mitya Eremeev","email":"mitossvyaz@mail.ru","username":"mitya-eremeev-2"},"change_message_id":"dffa315339fe270654986aecf173bf307bca74a6","unresolved":true,"context_lines":[{"line_number":649,"context_line":"                    self.rules \u003d Rules(default_rule\u003dself.default_rule)"},{"line_number":650,"context_line":"                for path in existing_policy_dirs:"},{"line_number":651,"context_line":"                    self._walk_through_policy_directory("},{"line_number":652,"context_line":"                        path, self._load_policy_file, True, False)"},{"line_number":653,"context_line":""},{"line_number":654,"context_line":"            for default in self.registered_rules.values():"},{"line_number":655,"context_line":"                if default.deprecated_for_removal:"}],"source_content_type":"text/x-python","patch_set":7,"id":"5b82da05_57a66194","line":652,"range":{"start_line":652,"start_character":54,"end_line":652,"end_character":58},"in_reply_to":"2913dd01_65b4cdb3","updated":"2021-10-07 12:02:28.000000000","message":"Sorry I didn\u0027t understand what I should fix and why.\nFor every policy folder we call \"_walk_through_policy_directory\" and pass a function \"_load_policy_file\" which are applied for every file in the folder.\nAlso we pass arguments for the function:  force reload\u003dTrue (we re-calculate all files no matter they were changed or not), overwrite\u003dFalse (we do not reset rules, we already made it when main policy file was re-calculated).","commit_id":"695ba0d963dd0cb994d8cc5d19b234c5e5ee2e52"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"fe5be449ad0195d2dcfc6eff722cc62c659ef884","unresolved":false,"context_lines":[{"line_number":623,"context_line":"                    self.policy_path,"},{"line_number":624,"context_line":"                    force_reload,"},{"line_number":625,"context_line":"                    overwrite\u003dself.overwrite"},{"line_number":626,"context_line":"                )"},{"line_number":627,"context_line":""},{"line_number":628,"context_line":"            force_reload_policy_dirs \u003d force_reload"},{"line_number":629,"context_line":"            if policy_file_rules_changed:"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f881a45_7b24d2c4","line":626,"updated":"2021-10-21 10:00:33.000000000","message":"I\u0027m taking notes just to make sure I understand the logic here...\n\nSo we first attempt to load rules from the policy file, if present, and check if anything has changed.","commit_id":"949289e094090757576f9251019e10d53af7a663"},{"author":{"_account_id":32927,"name":"mitya-eremeev-2","display_name":"Mitya Eremeev","email":"mitossvyaz@mail.ru","username":"mitya-eremeev-2"},"change_message_id":"75c2c3537be2165665ac0759286d07e001845416","unresolved":false,"context_lines":[{"line_number":623,"context_line":"                    self.policy_path,"},{"line_number":624,"context_line":"                    force_reload,"},{"line_number":625,"context_line":"                    overwrite\u003dself.overwrite"},{"line_number":626,"context_line":"                )"},{"line_number":627,"context_line":""},{"line_number":628,"context_line":"            force_reload_policy_dirs \u003d force_reload"},{"line_number":629,"context_line":"            if policy_file_rules_changed:"}],"source_content_type":"text/x-python","patch_set":9,"id":"6d7f7067_586ca876","line":626,"in_reply_to":"3f881a45_7b24d2c4","updated":"2021-10-21 10:44:03.000000000","message":"if rules in main policy file were not changed, then total rules in RAM are not reset and main policy file is NOT reloaded. So at this moment we have sum of rules from main policy file and directories from their previous state. \nNow policy_file_rules_changed \u003d\u003d False.\n\nFunction \"_load_policy_file\" does not reset rules if a file was not changed, please see the function code.","commit_id":"949289e094090757576f9251019e10d53af7a663"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"fe5be449ad0195d2dcfc6eff722cc62c659ef884","unresolved":false,"context_lines":[{"line_number":627,"context_line":""},{"line_number":628,"context_line":"            force_reload_policy_dirs \u003d force_reload"},{"line_number":629,"context_line":"            if policy_file_rules_changed:"},{"line_number":630,"context_line":"                force_reload_policy_dirs \u003d True"},{"line_number":631,"context_line":"            existing_policy_dirs \u003d []"},{"line_number":632,"context_line":""},{"line_number":633,"context_line":"            for path in self.conf.oslo_policy.policy_dirs:"}],"source_content_type":"text/x-python","patch_set":9,"id":"026508a6_43befca5","line":630,"updated":"2021-10-21 10:00:33.000000000","message":"If something *has* changed, or if we\u0027ve insisted that everything be reloaded, we indicate that we\u0027ll reload the policy directories also","commit_id":"949289e094090757576f9251019e10d53af7a663"},{"author":{"_account_id":32927,"name":"mitya-eremeev-2","display_name":"Mitya Eremeev","email":"mitossvyaz@mail.ru","username":"mitya-eremeev-2"},"change_message_id":"75c2c3537be2165665ac0759286d07e001845416","unresolved":false,"context_lines":[{"line_number":627,"context_line":""},{"line_number":628,"context_line":"            force_reload_policy_dirs \u003d force_reload"},{"line_number":629,"context_line":"            if policy_file_rules_changed:"},{"line_number":630,"context_line":"                force_reload_policy_dirs \u003d True"},{"line_number":631,"context_line":"            existing_policy_dirs \u003d []"},{"line_number":632,"context_line":""},{"line_number":633,"context_line":"            for path in self.conf.oslo_policy.policy_dirs:"}],"source_content_type":"text/x-python","patch_set":9,"id":"1d97207b_7ad2ec9f","line":630,"in_reply_to":"026508a6_43befca5","updated":"2021-10-21 10:44:03.000000000","message":"If a main policy file was changed or we insist to reload all rules from scratch then we insist to reload all policy directories.","commit_id":"949289e094090757576f9251019e10d53af7a663"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"fe5be449ad0195d2dcfc6eff722cc62c659ef884","unresolved":false,"context_lines":[{"line_number":644,"context_line":"                # to be consistent."},{"line_number":645,"context_line":"                if self._is_directory_updated(self._policy_dir_mtimes,"},{"line_number":646,"context_line":"                                              absolute_path):"},{"line_number":647,"context_line":"                    force_reload_policy_dirs \u003d True"},{"line_number":648,"context_line":"            if force_reload_policy_dirs and existing_policy_dirs:"},{"line_number":649,"context_line":"                # Here we realize that some policy folders or main policy file"},{"line_number":650,"context_line":"                # were changed and we need to recalculate all rules from"}],"source_content_type":"text/x-python","patch_set":9,"id":"131e8b5b_0bcaf5fa","line":647,"updated":"2021-10-21 10:00:33.000000000","message":"Similarly, if any of the policy directories has changed (or more specifically, if any of the directory contents have changed), then we also indicate that we\u0027ll reload policy directories","commit_id":"949289e094090757576f9251019e10d53af7a663"},{"author":{"_account_id":32927,"name":"mitya-eremeev-2","display_name":"Mitya Eremeev","email":"mitossvyaz@mail.ru","username":"mitya-eremeev-2"},"change_message_id":"75c2c3537be2165665ac0759286d07e001845416","unresolved":false,"context_lines":[{"line_number":644,"context_line":"                # to be consistent."},{"line_number":645,"context_line":"                if self._is_directory_updated(self._policy_dir_mtimes,"},{"line_number":646,"context_line":"                                              absolute_path):"},{"line_number":647,"context_line":"                    force_reload_policy_dirs \u003d True"},{"line_number":648,"context_line":"            if force_reload_policy_dirs and existing_policy_dirs:"},{"line_number":649,"context_line":"                # Here we realize that some policy folders or main policy file"},{"line_number":650,"context_line":"                # were changed and we need to recalculate all rules from"}],"source_content_type":"text/x-python","patch_set":9,"id":"0f625a55_7ce15fc4","line":647,"in_reply_to":"131e8b5b_0bcaf5fa","updated":"2021-10-21 10:44:03.000000000","message":"Yes,\nif any policy directory was changed then we reload all policy directories from scratch.","commit_id":"949289e094090757576f9251019e10d53af7a663"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"fe5be449ad0195d2dcfc6eff722cc62c659ef884","unresolved":false,"context_lines":[{"line_number":645,"context_line":"                if self._is_directory_updated(self._policy_dir_mtimes,"},{"line_number":646,"context_line":"                                              absolute_path):"},{"line_number":647,"context_line":"                    force_reload_policy_dirs \u003d True"},{"line_number":648,"context_line":"            if force_reload_policy_dirs and existing_policy_dirs:"},{"line_number":649,"context_line":"                # Here we realize that some policy folders or main policy file"},{"line_number":650,"context_line":"                # were changed and we need to recalculate all rules from"},{"line_number":651,"context_line":"                # scratch."}],"source_content_type":"text/x-python","patch_set":9,"id":"a0862075_4db38a40","line":648,"updated":"2021-10-21 10:00:33.000000000","message":"Finally, if we\u0027ve indicated that we should reload directories *and* we have directories to reload, then we do the necessary work.","commit_id":"949289e094090757576f9251019e10d53af7a663"},{"author":{"_account_id":32927,"name":"mitya-eremeev-2","display_name":"Mitya Eremeev","email":"mitossvyaz@mail.ru","username":"mitya-eremeev-2"},"change_message_id":"75c2c3537be2165665ac0759286d07e001845416","unresolved":false,"context_lines":[{"line_number":645,"context_line":"                if self._is_directory_updated(self._policy_dir_mtimes,"},{"line_number":646,"context_line":"                                              absolute_path):"},{"line_number":647,"context_line":"                    force_reload_policy_dirs \u003d True"},{"line_number":648,"context_line":"            if force_reload_policy_dirs and existing_policy_dirs:"},{"line_number":649,"context_line":"                # Here we realize that some policy folders or main policy file"},{"line_number":650,"context_line":"                # were changed and we need to recalculate all rules from"},{"line_number":651,"context_line":"                # scratch."}],"source_content_type":"text/x-python","patch_set":9,"id":"9dea9d76_a3e51795","line":648,"in_reply_to":"a0862075_4db38a40","updated":"2021-10-21 10:44:03.000000000","message":"Yes, you\u0027re right.","commit_id":"949289e094090757576f9251019e10d53af7a663"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"fe5be449ad0195d2dcfc6eff722cc62c659ef884","unresolved":true,"context_lines":[{"line_number":661,"context_line":"                        self._load_policy_file(path\u003dself.policy_path,"},{"line_number":662,"context_line":"                                               force_reload\u003dTrue,"},{"line_number":663,"context_line":"                                               overwrite\u003dself.overwrite"},{"line_number":664,"context_line":"                                               )"},{"line_number":665,"context_line":"                else:"},{"line_number":666,"context_line":"                    self.rules \u003d Rules(default_rule\u003dself.default_rule)"},{"line_number":667,"context_line":"                for path in existing_policy_dirs:"}],"source_content_type":"text/x-python","patch_set":9,"id":"da9c94b9_75273ce6","line":664,"updated":"2021-10-21 10:00:33.000000000","message":"I still don\u0027t get the point of this. In fact, I don\u0027t really get the point of the \u0027force_reload\u0027 parameter. You\u0027re saying that if there are *any* changes to any policy file or directory, then we should reload *everything*, yes? However, you already reloaded the main policy file above on line 622. What reason is there for reloading it again, this time with \u0027force_reload\u0027 explicitly set to True? Surely if the timestamps are the same, then there\u0027s no reason to insist on loading the policy configuration again?","commit_id":"949289e094090757576f9251019e10d53af7a663"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"3b32c8f7f8048fb0ab03077a832788060fa5047b","unresolved":false,"context_lines":[{"line_number":661,"context_line":"                        self._load_policy_file(path\u003dself.policy_path,"},{"line_number":662,"context_line":"                                               force_reload\u003dTrue,"},{"line_number":663,"context_line":"                                               overwrite\u003dself.overwrite"},{"line_number":664,"context_line":"                                               )"},{"line_number":665,"context_line":"                else:"},{"line_number":666,"context_line":"                    self.rules \u003d Rules(default_rule\u003dself.default_rule)"},{"line_number":667,"context_line":"                for path in existing_policy_dirs:"}],"source_content_type":"text/x-python","patch_set":9,"id":"f8835f22_a9393e5f","line":664,"in_reply_to":"0c984cd5_1eda218f","updated":"2021-10-21 11:04:52.000000000","message":"\u003e The problem is that if \"policy_file_rules_changed \u003d\u003d False\" then a main policy file was not reloaded and rules were not reset on line 622.\n\u003e So we should force to reset all rules and re-calculate a main policy file.\n\nOkay. Are we definitely doing that though? What happens if \u0027self.overwrite\u0027 is set to False? In that case we will not re-initialize \u0027self.rules\u0027. Should we?\n\n\u003e Even if timestamps are the same in main policy file (main policy file was not changed) we cannot take rules from the main policy file and apply policy directories rules on top of main policy file rules.\n\u003e There is no separate rule entity for main policy file rule and for policy directory rules. We only have \"self.rules\" which is sum of all rules already applied.\n\nOkay, so the previous check is really just to see if the files have changed. We don\u0027t care about the side effect of loading these files. Gotcha.","commit_id":"949289e094090757576f9251019e10d53af7a663"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"2d407ceeae6cf42dd181e66197972c22ae27664a","unresolved":false,"context_lines":[{"line_number":661,"context_line":"                        self._load_policy_file(path\u003dself.policy_path,"},{"line_number":662,"context_line":"                                               force_reload\u003dTrue,"},{"line_number":663,"context_line":"                                               overwrite\u003dself.overwrite"},{"line_number":664,"context_line":"                                               )"},{"line_number":665,"context_line":"                else:"},{"line_number":666,"context_line":"                    self.rules \u003d Rules(default_rule\u003dself.default_rule)"},{"line_number":667,"context_line":"                for path in existing_policy_dirs:"}],"source_content_type":"text/x-python","patch_set":9,"id":"2cf4d94a_a8a2acfe","line":664,"in_reply_to":"76b8f26c_9656467a","updated":"2021-10-21 12:56:51.000000000","message":"Okay, we might want to investigate removing that flag because it\u0027s weird, but that\u0027s not your responsibility. Thanks!","commit_id":"949289e094090757576f9251019e10d53af7a663"},{"author":{"_account_id":32927,"name":"mitya-eremeev-2","display_name":"Mitya Eremeev","email":"mitossvyaz@mail.ru","username":"mitya-eremeev-2"},"change_message_id":"75c2c3537be2165665ac0759286d07e001845416","unresolved":false,"context_lines":[{"line_number":661,"context_line":"                        self._load_policy_file(path\u003dself.policy_path,"},{"line_number":662,"context_line":"                                               force_reload\u003dTrue,"},{"line_number":663,"context_line":"                                               overwrite\u003dself.overwrite"},{"line_number":664,"context_line":"                                               )"},{"line_number":665,"context_line":"                else:"},{"line_number":666,"context_line":"                    self.rules \u003d Rules(default_rule\u003dself.default_rule)"},{"line_number":667,"context_line":"                for path in existing_policy_dirs:"}],"source_content_type":"text/x-python","patch_set":9,"id":"0c984cd5_1eda218f","line":664,"in_reply_to":"da9c94b9_75273ce6","updated":"2021-10-21 10:44:03.000000000","message":"The problem is that if \"policy_file_rules_changed \u003d\u003d False\" then a main policy file was not reloaded and rules were not reset on line 622.\nSo we should force to reset all rules and re-calculate a main policy file.\n\nEven if timestamps are the same in main policy file (main policy file was not changed) we cannot take rules from the main policy file and apply policy directories rules on top of main policy file rules.\nThere is no separate rule entity for main policy file rule and for policy directory rules. We only have \"self.rules\" which is sum of all rules already applied.","commit_id":"949289e094090757576f9251019e10d53af7a663"},{"author":{"_account_id":32927,"name":"mitya-eremeev-2","display_name":"Mitya Eremeev","email":"mitossvyaz@mail.ru","username":"mitya-eremeev-2"},"change_message_id":"85be3046906fc835f19a3eac847f91a8550fbe50","unresolved":false,"context_lines":[{"line_number":661,"context_line":"                        self._load_policy_file(path\u003dself.policy_path,"},{"line_number":662,"context_line":"                                               force_reload\u003dTrue,"},{"line_number":663,"context_line":"                                               overwrite\u003dself.overwrite"},{"line_number":664,"context_line":"                                               )"},{"line_number":665,"context_line":"                else:"},{"line_number":666,"context_line":"                    self.rules \u003d Rules(default_rule\u003dself.default_rule)"},{"line_number":667,"context_line":"                for path in existing_policy_dirs:"}],"source_content_type":"text/x-python","patch_set":9,"id":"76b8f26c_9656467a","line":664,"in_reply_to":"f8835f22_a9393e5f","updated":"2021-10-21 12:04:19.000000000","message":"if \u0027self.overwrite\u0027 is set to False, then rules will not be reset and all new rules will be applied on top of \"self.rules\".\nI doubt if an user uses Enforcer(overwrite\u003dFalse).\nBy default overwrite \u003d\u003d True in class \"Enforcer\" and in function \"_load_policy_file\".\nBut if an user uses Enforcer with self.overwrite\u003dFalse, it\u0027s weird pattern and user\u0027s responsibility.","commit_id":"949289e094090757576f9251019e10d53af7a663"}],"oslo_policy/tests/test_policy.py":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"4175c0fe17d2c4b909c00a8a8fc0b3dc4ad25f59","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":7,"id":"aceaff64_8a26e199","updated":"2021-10-07 10:13:53.000000000","message":"Given you\u0027ve apparently fixed a bug, I\u0027d expect to see a test here that previously would have failed but now succeeds. Can you add one?","commit_id":"695ba0d963dd0cb994d8cc5d19b234c5e5ee2e52"}]}
