)]}'
{"oslo_policy/generator.py":[{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"89a8927717e5fbfb37614bc159475ca299d8f27b","unresolved":false,"context_lines":[{"line_number":130,"context_line":"    if default.deprecated_for_removal:"},{"line_number":131,"context_line":"        text \u003d ("},{"line_number":132,"context_line":"            \u0027# DEPRECATED\\n# \"%(name)s\" has been deprecated since \u0027"},{"line_number":133,"context_line":"            \u0027%(since)s.\\n%(reason)s\\n%(text)s\u0027"},{"line_number":134,"context_line":"        ) % {\u0027name\u0027: default.name,"},{"line_number":135,"context_line":"             \u0027since\u0027: default.deprecated_since,"},{"line_number":136,"context_line":"             \u0027reason\u0027: _format_help_text(default.deprecated_reason),"}],"source_content_type":"text/x-python","patch_set":11,"id":"3f4b6375_95395cd8","line":133,"range":{"start_line":133,"start_character":23,"end_line":133,"end_character":37},"updated":"2017-11-15 19:15:30.000000000","message":"don\u0027t you need a # after both of these \\n ?","commit_id":"d3ea093c18a2c9e83ae9dcb3a3f5f3deae213bf8"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"dcfa33007b7a52fa1f4db2802074be00ed0375fa","unresolved":false,"context_lines":[{"line_number":130,"context_line":"    if default.deprecated_for_removal:"},{"line_number":131,"context_line":"        text \u003d ("},{"line_number":132,"context_line":"            \u0027# DEPRECATED\\n# \"%(name)s\" has been deprecated since \u0027"},{"line_number":133,"context_line":"            \u0027%(since)s.\\n%(reason)s\\n%(text)s\u0027"},{"line_number":134,"context_line":"        ) % {\u0027name\u0027: default.name,"},{"line_number":135,"context_line":"             \u0027since\u0027: default.deprecated_since,"},{"line_number":136,"context_line":"             \u0027reason\u0027: _format_help_text(default.deprecated_reason),"}],"source_content_type":"text/x-python","patch_set":11,"id":"1f485f77_d0592d35","line":133,"range":{"start_line":133,"start_character":23,"end_line":133,"end_character":37},"in_reply_to":"3f4b6375_95395cd8","updated":"2017-11-15 19:53:35.000000000","message":"No - it is handled by the _format_help_text method.","commit_id":"d3ea093c18a2c9e83ae9dcb3a3f5f3deae213bf8"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"89a8927717e5fbfb37614bc159475ca299d8f27b","unresolved":false,"context_lines":[{"line_number":139,"context_line":"        text \u003d ("},{"line_number":140,"context_line":"            \u0027# DEPRECATED\\n# \"%(old_name)s\":\"%(old_check_str)s\" has been \u0027"},{"line_number":141,"context_line":"            \u0027deprecated since %(since)s in favor of \u0027"},{"line_number":142,"context_line":"            \u0027\"%(name)s\":\"%(check_str)s\".\\n\u0027"},{"line_number":143,"context_line":"            \u0027%(reason)s\\n%(text)s\u0027"},{"line_number":144,"context_line":"        ) % {\u0027old_name\u0027: default.deprecated_rule.name,"},{"line_number":145,"context_line":"             \u0027old_check_str\u0027: default.deprecated_rule.check_str,"},{"line_number":146,"context_line":"             \u0027since\u0027: default.deprecated_since,"}],"source_content_type":"text/x-python","patch_set":11,"id":"3f4b6375_15532c19","line":143,"range":{"start_line":142,"start_character":40,"end_line":143,"end_character":25},"updated":"2017-11-15 19:15:30.000000000","message":"ditto","commit_id":"d3ea093c18a2c9e83ae9dcb3a3f5f3deae213bf8"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"dcfa33007b7a52fa1f4db2802074be00ed0375fa","unresolved":false,"context_lines":[{"line_number":139,"context_line":"        text \u003d ("},{"line_number":140,"context_line":"            \u0027# DEPRECATED\\n# \"%(old_name)s\":\"%(old_check_str)s\" has been \u0027"},{"line_number":141,"context_line":"            \u0027deprecated since %(since)s in favor of \u0027"},{"line_number":142,"context_line":"            \u0027\"%(name)s\":\"%(check_str)s\".\\n\u0027"},{"line_number":143,"context_line":"            \u0027%(reason)s\\n%(text)s\u0027"},{"line_number":144,"context_line":"        ) % {\u0027old_name\u0027: default.deprecated_rule.name,"},{"line_number":145,"context_line":"             \u0027old_check_str\u0027: default.deprecated_rule.check_str,"},{"line_number":146,"context_line":"             \u0027since\u0027: default.deprecated_since,"}],"source_content_type":"text/x-python","patch_set":11,"id":"1f485f77_50453d42","line":143,"range":{"start_line":142,"start_character":40,"end_line":143,"end_character":25},"in_reply_to":"3f4b6375_15532c19","updated":"2017-11-15 19:53:35.000000000","message":"Same comment as above.","commit_id":"d3ea093c18a2c9e83ae9dcb3a3f5f3deae213bf8"}],"oslo_policy/policy.py":[{"author":{"_account_id":5638,"name":"Davanum Srinivas","email":"davanum@gmail.com","username":"dims-v"},"change_message_id":"5cdf4d74a93aa13fe4d87cdd1b52faa9dc041fbd","unresolved":false,"context_lines":[{"line_number":779,"context_line":"        :param rule_object: an instance of RuleDefault or DocumentedRuleDefault"},{"line_number":780,"context_line":"        \"\"\""},{"line_number":781,"context_line":"        if rule_object.deprecated_for_removal:"},{"line_number":782,"context_line":"            LOG.warning("},{"line_number":783,"context_line":"                \u0027Policy %(policy)s was deprecated in %(deprecated_in)s \u0027"},{"line_number":784,"context_line":"                \u0027because %(reason)s. It is being replaced with \u0027"},{"line_number":785,"context_line":"                \u0027%(replacement)s. You need to either ensure the new policy \u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f515b1d_e35377e1","line":782,"updated":"2017-10-05 22:18:20.000000000","message":"warnings.warn may be a better way than a LOG.warning. looks good otherwise!\n\nLet\u0027s ping Doug and others to see which one would work better.\n\nhttp://codesearch.openstack.org/?q\u003dwarnings.warn","commit_id":"087f9bd555d7820199220dc7c9c10c97b7f0cefa"},{"author":{"_account_id":9796,"name":"ChangBo Guo","email":"glongwave@gmail.com","username":"gcb"},"change_message_id":"f210d53f7b40db69a5c388af3f23d2dadc213c18","unresolved":false,"context_lines":[{"line_number":754,"context_line":"                # can check if this specific policy is deprecated or not. If it"},{"line_number":755,"context_line":"                # is, then we should log a warning with valueable information"},{"line_number":756,"context_line":"                # to the operator."},{"line_number":757,"context_line":"                self._log_deprecation(to_check)"},{"line_number":758,"context_line":""},{"line_number":759,"context_line":"                result \u003d _checks._check("},{"line_number":760,"context_line":"                    rule\u003dto_check,"}],"source_content_type":"text/x-python","patch_set":2,"id":"7f515b1d_a7e4320e","line":757,"range":{"start_line":757,"start_character":0,"end_line":757,"end_character":47},"updated":"2017-10-09 04:02:48.000000000","message":"I guess his will invoke many warnings for each API call","commit_id":"8fc024fcfcd118e8cd719f6312bc324070fd9e53"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"bccbf8e226b9b82cdc6feacad0bb8e5d9bbece2a","unresolved":false,"context_lines":[{"line_number":754,"context_line":"                # can check if this specific policy is deprecated or not. If it"},{"line_number":755,"context_line":"                # is, then we should log a warning with valueable information"},{"line_number":756,"context_line":"                # to the operator."},{"line_number":757,"context_line":"                self._log_deprecation(to_check)"},{"line_number":758,"context_line":""},{"line_number":759,"context_line":"                result \u003d _checks._check("},{"line_number":760,"context_line":"                    rule\u003dto_check,"}],"source_content_type":"text/x-python","patch_set":2,"id":"7f515b1d_a9287585","line":757,"range":{"start_line":757,"start_character":0,"end_line":757,"end_character":47},"in_reply_to":"7f515b1d_a7e4320e","updated":"2017-10-09 18:37:49.000000000","message":"It will - I guess that was my main reason for including it here, so that it\u0027s super verbose. Unless it\u0027s better suited somewhere else?","commit_id":"8fc024fcfcd118e8cd719f6312bc324070fd9e53"},{"author":{"_account_id":9796,"name":"ChangBo Guo","email":"glongwave@gmail.com","username":"gcb"},"change_message_id":"f210d53f7b40db69a5c388af3f23d2dadc213c18","unresolved":false,"context_lines":[{"line_number":781,"context_line":"        if (isinstance(rule_object, RuleDefault) and"},{"line_number":782,"context_line":"                rule_object.deprecated_for_removal):"},{"line_number":783,"context_line":"            warnings.warn("},{"line_number":784,"context_line":"                \u0027Policy %(policy)s was deprecated in %(deprecated_in)s \u0027"},{"line_number":785,"context_line":"                \u0027because %(reason)s. It is being replaced with \u0027"},{"line_number":786,"context_line":"                \u0027%(replacement)s. This change will take effect in \u0027"},{"line_number":787,"context_line":"                \u0027%(removal)s.\u0027 % {"},{"line_number":788,"context_line":"                    \u0027policy\u0027: rule_object.name,"},{"line_number":789,"context_line":"                    \u0027deprecated_in\u0027: rule_object.deprecated_since,"},{"line_number":790,"context_line":"                    \u0027reason\u0027: rule_object.deprecated_reason,"},{"line_number":791,"context_line":"                    \u0027replacement\u0027: rule_object.deprecated_in_favor_of,"},{"line_number":792,"context_line":"                    \u0027removal\u0027: rule_object.removal_in"},{"line_number":793,"context_line":"                }"},{"line_number":794,"context_line":"            )"},{"line_number":795,"context_line":""},{"line_number":796,"context_line":"    def register_default(self, default):"}],"source_content_type":"text/x-python","patch_set":2,"id":"7f515b1d_07b3060c","line":793,"range":{"start_line":784,"start_character":0,"end_line":793,"end_character":17},"updated":"2017-10-09 04:02:48.000000000","message":"we\u0027d better format the warning message according to parameters\u0027 values, not just put all parameters in one warning message.","commit_id":"8fc024fcfcd118e8cd719f6312bc324070fd9e53"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"bccbf8e226b9b82cdc6feacad0bb8e5d9bbece2a","unresolved":false,"context_lines":[{"line_number":781,"context_line":"        if (isinstance(rule_object, RuleDefault) and"},{"line_number":782,"context_line":"                rule_object.deprecated_for_removal):"},{"line_number":783,"context_line":"            warnings.warn("},{"line_number":784,"context_line":"                \u0027Policy %(policy)s was deprecated in %(deprecated_in)s \u0027"},{"line_number":785,"context_line":"                \u0027because %(reason)s. It is being replaced with \u0027"},{"line_number":786,"context_line":"                \u0027%(replacement)s. This change will take effect in \u0027"},{"line_number":787,"context_line":"                \u0027%(removal)s.\u0027 % {"},{"line_number":788,"context_line":"                    \u0027policy\u0027: rule_object.name,"},{"line_number":789,"context_line":"                    \u0027deprecated_in\u0027: rule_object.deprecated_since,"},{"line_number":790,"context_line":"                    \u0027reason\u0027: rule_object.deprecated_reason,"},{"line_number":791,"context_line":"                    \u0027replacement\u0027: rule_object.deprecated_in_favor_of,"},{"line_number":792,"context_line":"                    \u0027removal\u0027: rule_object.removal_in"},{"line_number":793,"context_line":"                }"},{"line_number":794,"context_line":"            )"},{"line_number":795,"context_line":""},{"line_number":796,"context_line":"    def register_default(self, default):"}],"source_content_type":"text/x-python","patch_set":2,"id":"7f515b1d_a41417ea","line":793,"range":{"start_line":784,"start_character":0,"end_line":793,"end_character":17},"in_reply_to":"7f515b1d_07b3060c","updated":"2017-10-09 18:37:49.000000000","message":"Done","commit_id":"8fc024fcfcd118e8cd719f6312bc324070fd9e53"},{"author":{"_account_id":9796,"name":"ChangBo Guo","email":"glongwave@gmail.com","username":"gcb"},"change_message_id":"f210d53f7b40db69a5c388af3f23d2dadc213c18","unresolved":false,"context_lines":[{"line_number":858,"context_line":"                             in. Accepts any string, though valid version"},{"line_number":859,"context_line":"                             strings are encouraged. Silently ignored if"},{"line_number":860,"context_line":"                             deprecated_for_removal is False."},{"line_number":861,"context_line":"    :param deprecated_in_favor_of: indicates the replacement that is to be used"},{"line_number":862,"context_line":"                                   in favor of the deprecated policy. Silently"},{"line_number":863,"context_line":"                                   ignored if deprecated_for_removal is False."},{"line_number":864,"context_line":"    :param removal_in: indicates the release in which the deprecated policy is"},{"line_number":865,"context_line":"                       going to be removed. Silently ignored if"},{"line_number":866,"context_line":"                       deprecated_for_removal is False."},{"line_number":867,"context_line":""},{"line_number":868,"context_line":"    .. versionchanged 1.29"},{"line_number":869,"context_line":"       Added *deprecated_for_removal* parameter."}],"source_content_type":"text/x-python","patch_set":2,"id":"7f515b1d_07a8a689","line":866,"range":{"start_line":861,"start_character":0,"end_line":866,"end_character":55},"updated":"2017-10-09 04:02:48.000000000","message":"I\u0027m afraid we add too many parameters here, can you remove these two parameters, we can you use three parameters like we did in oslo.config https://github.com/openstack/oslo.config/blob/master/oslo_config/cfg.py#L941","commit_id":"8fc024fcfcd118e8cd719f6312bc324070fd9e53"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"bccbf8e226b9b82cdc6feacad0bb8e5d9bbece2a","unresolved":false,"context_lines":[{"line_number":858,"context_line":"                             in. Accepts any string, though valid version"},{"line_number":859,"context_line":"                             strings are encouraged. Silently ignored if"},{"line_number":860,"context_line":"                             deprecated_for_removal is False."},{"line_number":861,"context_line":"    :param deprecated_in_favor_of: indicates the replacement that is to be used"},{"line_number":862,"context_line":"                                   in favor of the deprecated policy. Silently"},{"line_number":863,"context_line":"                                   ignored if deprecated_for_removal is False."},{"line_number":864,"context_line":"    :param removal_in: indicates the release in which the deprecated policy is"},{"line_number":865,"context_line":"                       going to be removed. Silently ignored if"},{"line_number":866,"context_line":"                       deprecated_for_removal is False."},{"line_number":867,"context_line":""},{"line_number":868,"context_line":"    .. versionchanged 1.29"},{"line_number":869,"context_line":"       Added *deprecated_for_removal* parameter."}],"source_content_type":"text/x-python","patch_set":2,"id":"7f515b1d_093e69b7","line":866,"range":{"start_line":861,"start_character":0,"end_line":866,"end_character":55},"in_reply_to":"7f515b1d_07a8a689","updated":"2017-10-09 18:37:49.000000000","message":"Done","commit_id":"8fc024fcfcd118e8cd719f6312bc324070fd9e53"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"48cf240cd61e9512863a2d46aaff6ad5ac4f1f9f","unresolved":false,"context_lines":[{"line_number":889,"context_line":"        self.check \u003d _parser.parse_rule(check_str)"},{"line_number":890,"context_line":"        self.description \u003d description"},{"line_number":891,"context_line":"        self.deprecated_for_removal \u003d deprecated_for_removal"},{"line_number":892,"context_line":"        self.deprecated_reason \u003d deprecated_reason"},{"line_number":893,"context_line":"        self.deprecated_since \u003d deprecated_since"},{"line_number":894,"context_line":"        self.deprecated_in_favor_of \u003d deprecated_in_favor_of"},{"line_number":895,"context_line":"        self.removal_in \u003d removal_in"},{"line_number":896,"context_line":""},{"line_number":897,"context_line":"    def __str__(self):"},{"line_number":898,"context_line":"        return \u0027\"%(name)s\": \"%(check_str)s\"\u0027 % {\u0027name\u0027: self.name,"}],"source_content_type":"text/x-python","patch_set":2,"id":"7f515b1d_e09eb405","line":895,"range":{"start_line":892,"start_character":8,"end_line":895,"end_character":36},"updated":"2017-10-06 17:14:09.000000000","message":"I\u0027m wondering if we need to enforce certain kwargs are present if deprecated_for_removal is True. So that we prevent the following usage:\n\n  policy.RuleDefault(\n      name\u003d\u0027foo:bar\u0027,\n      check_str\u003d\u0027role:baz\u0027,\n      deprecated_for_removal\u003dTrue\n  )\n\nThat would technically render a pretty useless warning. Thoughts?","commit_id":"8fc024fcfcd118e8cd719f6312bc324070fd9e53"},{"author":{"_account_id":9796,"name":"ChangBo Guo","email":"glongwave@gmail.com","username":"gcb"},"change_message_id":"f210d53f7b40db69a5c388af3f23d2dadc213c18","unresolved":false,"context_lines":[{"line_number":937,"context_line":"                        {\u0027path\u0027: \u0027/some\u0027, \u0027method\u0027: \u0027POST\u0027}]"},{"line_number":938,"context_line":"    \"\"\""},{"line_number":939,"context_line":"    def __init__(self, name, check_str, description, operations):"},{"line_number":940,"context_line":"        super(DocumentedRuleDefault, self).__init__("},{"line_number":941,"context_line":"            name, check_str, description)"},{"line_number":942,"context_line":"        self.operations \u003d operations"},{"line_number":943,"context_line":""},{"line_number":944,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":2,"id":"7f515b1d_a7cd5286","line":941,"range":{"start_line":940,"start_character":0,"end_line":941,"end_character":41},"updated":"2017-10-09 04:02:48.000000000","message":"These new parameters seem don\u0027t work with Class DocumentedRuleDefault due to we don\u0027t pass them here.","commit_id":"8fc024fcfcd118e8cd719f6312bc324070fd9e53"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"bccbf8e226b9b82cdc6feacad0bb8e5d9bbece2a","unresolved":false,"context_lines":[{"line_number":937,"context_line":"                        {\u0027path\u0027: \u0027/some\u0027, \u0027method\u0027: \u0027POST\u0027}]"},{"line_number":938,"context_line":"    \"\"\""},{"line_number":939,"context_line":"    def __init__(self, name, check_str, description, operations):"},{"line_number":940,"context_line":"        super(DocumentedRuleDefault, self).__init__("},{"line_number":941,"context_line":"            name, check_str, description)"},{"line_number":942,"context_line":"        self.operations \u003d operations"},{"line_number":943,"context_line":""},{"line_number":944,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":2,"id":"7f515b1d_0939c9d5","line":941,"range":{"start_line":940,"start_character":0,"end_line":941,"end_character":41},"in_reply_to":"7f515b1d_a7cd5286","updated":"2017-10-09 18:37:49.000000000","message":"Oh - good call. Let me add some tests for this.","commit_id":"8fc024fcfcd118e8cd719f6312bc324070fd9e53"},{"author":{"_account_id":9796,"name":"ChangBo Guo","email":"glongwave@gmail.com","username":"gcb"},"change_message_id":"b1fe4ebdcb19738590387b7b2842b3cb3f7dd74e","unresolved":false,"context_lines":[{"line_number":874,"context_line":"        self.deprecated_reason \u003d deprecated_reason"},{"line_number":875,"context_line":"        self.deprecated_since \u003d deprecated_since"},{"line_number":876,"context_line":""},{"line_number":877,"context_line":"        if deprecated_for_removal and not ("},{"line_number":878,"context_line":"                deprecated_reason or deprecated_since):"},{"line_number":879,"context_line":"            raise ValueError("},{"line_number":880,"context_line":"                \u0027%(name)s deprecated without deprecated_reason or \u0027"},{"line_number":881,"context_line":"                \u0027deprecated_since. Both must be supplied if deprecating a \u0027"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f4e5783_1a8769da","line":878,"range":{"start_line":877,"start_character":0,"end_line":878,"end_character":55},"updated":"2017-10-10 07:04:15.000000000","message":"deprecated_for_removal \u003d True,  deprecated_reason \u003d None, deprecated_since\u003d\u0027XYZ\u0027 doesn\u0027t raise ValueError.\n\nwhat about ?\nif deprecated_for_removal and (deprecated_reason is None or deprecated_since is None):","commit_id":"4c2b366024971318221a9e1416b5bf530ac6afb5"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"ce8d7c29bf5cd3656db7161059bc46783c9a9f61","unresolved":false,"context_lines":[{"line_number":874,"context_line":"        self.deprecated_reason \u003d deprecated_reason"},{"line_number":875,"context_line":"        self.deprecated_since \u003d deprecated_since"},{"line_number":876,"context_line":""},{"line_number":877,"context_line":"        if deprecated_for_removal and not ("},{"line_number":878,"context_line":"                deprecated_reason or deprecated_since):"},{"line_number":879,"context_line":"            raise ValueError("},{"line_number":880,"context_line":"                \u0027%(name)s deprecated without deprecated_reason or \u0027"},{"line_number":881,"context_line":"                \u0027deprecated_since. Both must be supplied if deprecating a \u0027"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f4e5783_5ceef388","line":878,"range":{"start_line":877,"start_character":0,"end_line":878,"end_character":55},"in_reply_to":"5f4e5783_1a8769da","updated":"2017-10-10 13:38:54.000000000","message":"Yeah - I think that is easier to read, too.","commit_id":"4c2b366024971318221a9e1416b5bf530ac6afb5"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"0b382c83a1417d68637af8b41a4e30310d2e3079","unresolved":false,"context_lines":[{"line_number":781,"context_line":"        if (isinstance(rule_object, RuleDefault) and"},{"line_number":782,"context_line":"                rule_object.deprecated_for_removal):"},{"line_number":783,"context_line":"            warnings.warn("},{"line_number":784,"context_line":"                \u0027Policy \"%(policy)s\" is deprecated for removal. %(reason)s \u0027"},{"line_number":785,"context_line":"                \u0027Its value may be silently ignored in the future.\u0027 % {"},{"line_number":786,"context_line":"                    \u0027policy\u0027: rule_object.name,"},{"line_number":787,"context_line":"                    \u0027reason\u0027: rule_object.deprecated_reason"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f4e5783_07feb236","line":784,"range":{"start_line":784,"start_character":64,"end_line":784,"end_character":74},"updated":"2017-10-11 19:25:39.000000000","message":"Reason authors may not always format them as complete sentences, or start with a capital letter, or end with a period.\n\nI suggest we change this to \n\n\u0027Policy \"%(policy)s\" is deprecated for removal and its value may be silently ignored in the future. Reason: %(reason)s\u0027","commit_id":"70763e21426e18e72193e601010205a04ee1d91b"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"98f5bff7af16a9e6dd1fa78ea3610fdeea02e785","unresolved":false,"context_lines":[{"line_number":781,"context_line":"        if (isinstance(rule_object, RuleDefault) and"},{"line_number":782,"context_line":"                rule_object.deprecated_for_removal):"},{"line_number":783,"context_line":"            warnings.warn("},{"line_number":784,"context_line":"                \u0027Policy \"%(policy)s\" is deprecated for removal. %(reason)s \u0027"},{"line_number":785,"context_line":"                \u0027Its value may be silently ignored in the future.\u0027 % {"},{"line_number":786,"context_line":"                    \u0027policy\u0027: rule_object.name,"},{"line_number":787,"context_line":"                    \u0027reason\u0027: rule_object.deprecated_reason"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f4e5783_82b290e5","line":784,"range":{"start_line":784,"start_character":64,"end_line":784,"end_character":74},"in_reply_to":"5f4e5783_07feb236","updated":"2017-10-12 23:01:14.000000000","message":"True - I originally made it this way because this is how oslo.config emits reasons, which apparently aren\u0027t a hard requirement. Since we\u0027re making it so that reason is always required if deprecated_for_removal \u003d True, then I think the format you\u0027re suggesting is fine.","commit_id":"70763e21426e18e72193e601010205a04ee1d91b"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"b6e048f1885732f1143943b824405f395cbb7dcd","unresolved":false,"context_lines":[{"line_number":755,"context_line":"                # that rule exists in ``self.rules``, then we\u0027re dealing with"},{"line_number":756,"context_line":"                # an override that was defined in a policy file and registered."},{"line_number":757,"context_line":"                # We should evaluate the deprecated policy because its"},{"line_number":758,"context_line":"                # explicitly being overridden. One the deprecated policy is"},{"line_number":759,"context_line":"                # removed, the override or default for the new policy will be"},{"line_number":760,"context_line":"                # used."},{"line_number":761,"context_line":"                if isinstance(rule, RuleDefault):"}],"source_content_type":"text/x-python","patch_set":8,"id":"5f4e5783_fd578601","line":758,"range":{"start_line":758,"start_character":47,"end_line":758,"end_character":50},"updated":"2017-10-12 20:23:57.000000000","message":"Once*","commit_id":"d428b6116003fd6b203d650d1795dffcc2bcc743"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"b6e048f1885732f1143943b824405f395cbb7dcd","unresolved":false,"context_lines":[{"line_number":788,"context_line":"        \"\"\""},{"line_number":789,"context_line":"        if rule.deprecated_for_removal:"},{"line_number":790,"context_line":"            warnings.warn("},{"line_number":791,"context_line":"                \u0027Policy \"%(policy)s\":\"%(check_str)s\" was deprecated for \u0027"},{"line_number":792,"context_line":"                \u0027removal in %(release)s. Reason: %(reason)s. Its value \u0027"},{"line_number":793,"context_line":"                \u0027may be silently ignored in the future.\u0027 % {"},{"line_number":794,"context_line":"                    \u0027policy\u0027: rule.name,"}],"source_content_type":"text/x-python","patch_set":8,"id":"5f4e5783_bd6a2eb0","line":791,"range":{"start_line":791,"start_character":36,"end_line":791,"end_character":52},"updated":"2017-10-12 20:23:57.000000000","message":"let\u0027s just state the policy, not the check_str. It\u0027s the policy rule as a whole that is deprecated here, not the default value (or non-default value... they could have customized, in which case this would make even less sense as written).","commit_id":"d428b6116003fd6b203d650d1795dffcc2bcc743"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"b6e048f1885732f1143943b824405f395cbb7dcd","unresolved":false,"context_lines":[{"line_number":789,"context_line":"        if rule.deprecated_for_removal:"},{"line_number":790,"context_line":"            warnings.warn("},{"line_number":791,"context_line":"                \u0027Policy \"%(policy)s\":\"%(check_str)s\" was deprecated for \u0027"},{"line_number":792,"context_line":"                \u0027removal in %(release)s. Reason: %(reason)s. Its value \u0027"},{"line_number":793,"context_line":"                \u0027may be silently ignored in the future.\u0027 % {"},{"line_number":794,"context_line":"                    \u0027policy\u0027: rule.name,"},{"line_number":795,"context_line":"                    \u0027check_str\u0027: rule.check_str,"}],"source_content_type":"text/x-python","patch_set":8,"id":"5f4e5783_46180cd2","line":792,"updated":"2017-10-12 20:23:57.000000000","message":"it\u0027s ambiguous whether the policy was deprecated in %(release)s or will be removed in %(release)s.\n\nI think it\u0027s probably sufficient to say \"Its value may be silently ignored in the future\" and not say \"for removal\". The one implies the other, right?\n\nAlso, I was thinking we might put that last sentence before the reason, especially if you remove the \"for removal\" phrase.","commit_id":"d428b6116003fd6b203d650d1795dffcc2bcc743"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"b6e048f1885732f1143943b824405f395cbb7dcd","unresolved":false,"context_lines":[{"line_number":799,"context_line":"            )"},{"line_number":800,"context_line":"        elif rule.deprecated_rule:"},{"line_number":801,"context_line":"            warnings.warn("},{"line_number":802,"context_line":"                \u0027Policy \"%(policy)s\":\"%(check_str)s\" was deprecated \u0027"},{"line_number":803,"context_line":"                \u0027in %(release)s. Reason %(reason)s. Either ensure \u0027"},{"line_number":804,"context_line":"                \u0027your deployment is ready for the new default or \u0027"},{"line_number":805,"context_line":"                \u0027copy/paste the deprecated policy into your policy \u0027"}],"source_content_type":"text/x-python","patch_set":8,"id":"5f4e5783_9daad2cf","line":802,"updated":"2017-10-12 20:23:57.000000000","message":"we\u0027ve got two cases that need pretty different messages and handling here:\n1) deprecated policy rule (e.g. renaming)\n2) deprecated default","commit_id":"d428b6116003fd6b203d650d1795dffcc2bcc743"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"b6e048f1885732f1143943b824405f395cbb7dcd","unresolved":false,"context_lines":[{"line_number":867,"context_line":"    :param description: A plain text description of the policy. This will be"},{"line_number":868,"context_line":"                        used to comment sample policy files for use by"},{"line_number":869,"context_line":"                        deployers."},{"line_number":870,"context_line":"    :param deprecated_rule: :class:`.DeprecatedRule`"},{"line_number":871,"context_line":"    :param deprecated_for_removal: indicates whether the policy is planned for"},{"line_number":872,"context_line":"                                   removal in a future release."},{"line_number":873,"context_line":"    :param deprecated_reason: indicates why this policy is planned for removal"}],"source_content_type":"text/x-python","patch_set":8,"id":"5f4e5783_3deabe0e","line":870,"updated":"2017-10-12 20:23:57.000000000","message":"it\u0027s worth noting that this design will only allow us to deprecate something once, so you can\u0027t rename in N, then rename again in N+1 and have the original policy, the policy from N, and the policy from N+1 all work in N+1. If we need to support deprecation cycles of more than one release, we might need to rework this to support that.","commit_id":"d428b6116003fd6b203d650d1795dffcc2bcc743"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"b6e048f1885732f1143943b824405f395cbb7dcd","unresolved":false,"context_lines":[{"line_number":1004,"context_line":""},{"line_number":1005,"context_line":"class DeprecatedRule(object):"},{"line_number":1006,"context_line":""},{"line_number":1007,"context_line":"    \"\"\"Represents a Deprecated policy or rule."},{"line_number":1008,"context_line":""},{"line_number":1009,"context_line":"    Here\u0027s how you can use it to change a policy\u0027s default role or rule. Assume"},{"line_number":1010,"context_line":"    the following policy exists in code::"}],"source_content_type":"text/x-python","patch_set":8,"id":"5f4e5783_9dc1b283","line":1007,"updated":"2017-10-12 20:23:57.000000000","message":"I think you\u0027re reworking this based on IRC conversation, so I\u0027ll hold off on comments here.","commit_id":"d428b6116003fd6b203d650d1795dffcc2bcc743"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"89a8927717e5fbfb37614bc159475ca299d8f27b","unresolved":false,"context_lines":[{"line_number":591,"context_line":"                            default.check_str + \u0027 or \u0027 +"},{"line_number":592,"context_line":"                            default.deprecated_rule.check_str"},{"line_number":593,"context_line":"                        )"},{"line_number":594,"context_line":"                        warnings.warn(deprecated_msg)"},{"line_number":595,"context_line":"                if default.deprecated_for_removal and ("},{"line_number":596,"context_line":"                        default.name in self.rules):"},{"line_number":597,"context_line":"                    # If a policy is going to be removed altogether, then we"}],"source_content_type":"text/x-python","patch_set":11,"id":"3f4b6375_556764b8","line":594,"updated":"2017-11-15 19:15:30.000000000","message":"The message needs to be different here. Operators need to be able to distinguish between the two cases, and the advice we give should be somewhat different as well. It should tell the operator that we\u0027re temporarily adding an OrCheck for the old rule\u0027s check_str but that will end when the old rule is removed in future.\n\nAlso, as-written this will print the same message twice if the conditionals on both line 567 and line 575 evaluate True. If the message was different, that might (or might not) be fine, but certainly not if they\u0027re identical as they are now.","commit_id":"d3ea093c18a2c9e83ae9dcb3a3f5f3deae213bf8"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"1bd755b2b189bea30bfe83ce8f2c8df42862dda8","unresolved":false,"context_lines":[{"line_number":591,"context_line":"                            default.check_str + \u0027 or \u0027 +"},{"line_number":592,"context_line":"                            default.deprecated_rule.check_str"},{"line_number":593,"context_line":"                        )"},{"line_number":594,"context_line":"                        warnings.warn(deprecated_msg)"},{"line_number":595,"context_line":"                if default.deprecated_for_removal and ("},{"line_number":596,"context_line":"                        default.name in self.rules):"},{"line_number":597,"context_line":"                    # If a policy is going to be removed altogether, then we"}],"source_content_type":"text/x-python","patch_set":11,"id":"1f485f77_0b32f85f","line":594,"in_reply_to":"3f4b6375_556764b8","updated":"2017-11-15 20:23:35.000000000","message":"no response about the messages needing to be different here vs. the line 567 case?","commit_id":"d3ea093c18a2c9e83ae9dcb3a3f5f3deae213bf8"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"89a8927717e5fbfb37614bc159475ca299d8f27b","unresolved":false,"context_lines":[{"line_number":592,"context_line":"                            default.deprecated_rule.check_str"},{"line_number":593,"context_line":"                        )"},{"line_number":594,"context_line":"                        warnings.warn(deprecated_msg)"},{"line_number":595,"context_line":"                if default.deprecated_for_removal and ("},{"line_number":596,"context_line":"                        default.name in self.rules):"},{"line_number":597,"context_line":"                    # If a policy is going to be removed altogether, then we"},{"line_number":598,"context_line":"                    # need to make sure we let operators know so they can clean"}],"source_content_type":"text/x-python","patch_set":11,"id":"1f485f77_5561afd2","line":595,"updated":"2017-11-15 19:15:30.000000000","message":"if the conditional on line 551 also evaluated True, the operator is going to get multiple conflicting messages here (possibly as many as 3, see previous comment).","commit_id":"d3ea093c18a2c9e83ae9dcb3a3f5f3deae213bf8"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"1bd755b2b189bea30bfe83ce8f2c8df42862dda8","unresolved":false,"context_lines":[{"line_number":592,"context_line":"                            default.deprecated_rule.check_str"},{"line_number":593,"context_line":"                        )"},{"line_number":594,"context_line":"                        warnings.warn(deprecated_msg)"},{"line_number":595,"context_line":"                if default.deprecated_for_removal and ("},{"line_number":596,"context_line":"                        default.name in self.rules):"},{"line_number":597,"context_line":"                    # If a policy is going to be removed altogether, then we"},{"line_number":598,"context_line":"                    # need to make sure we let operators know so they can clean"}],"source_content_type":"text/x-python","patch_set":11,"id":"1f485f77_8ba14897","line":595,"in_reply_to":"1f485f77_30bac1c0","updated":"2017-11-15 20:23:35.000000000","message":"line 567 checks that default.deprecated_rule.name is in self.rules, whereas 575 checks that default.name is not in self.rules. I.e. those are checking 2 entirely different things, and both can be True simultaneously. In fact, that would pretty common (someone has a policy file with the old deprecated rule name and has not added the new rule name), right?\n\nAnd addressing the other case, at some point I expect someone to set deprecated_for_removal\u003dTrue on something that already has a deprecated_rule set. Especially given that some projects will want to maintain deprecations for more than one release.","commit_id":"d3ea093c18a2c9e83ae9dcb3a3f5f3deae213bf8"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"dcfa33007b7a52fa1f4db2802074be00ed0375fa","unresolved":false,"context_lines":[{"line_number":592,"context_line":"                            default.deprecated_rule.check_str"},{"line_number":593,"context_line":"                        )"},{"line_number":594,"context_line":"                        warnings.warn(deprecated_msg)"},{"line_number":595,"context_line":"                if default.deprecated_for_removal and ("},{"line_number":596,"context_line":"                        default.name in self.rules):"},{"line_number":597,"context_line":"                    # If a policy is going to be removed altogether, then we"},{"line_number":598,"context_line":"                    # need to make sure we let operators know so they can clean"}],"source_content_type":"text/x-python","patch_set":11,"id":"1f485f77_30bac1c0","line":595,"in_reply_to":"1f485f77_5561afd2","updated":"2017-11-15 19:53:35.000000000","message":"Looking at how the if statements are written, it\u0027s impossible for the message to be emitted more than twice. This check requires the default.name to be in self.rules. The check on line 575 requires default.name to *not* be in self.rules.\n\nThe if statements on lines 567 and 575 can\u0027t both evaluate to True with the same rule. The if statement on line 567 requires the rule to the in self.rules while the if statement on line 575 requires it to not be in self.rules.\n\nI think the only way more than one message can be logged is if you set deprecated_for_removal \u003d True and supply a deprecate_rule argument (which wouldn\u0027t make much sense). Either way, we can probably provide some protection against that.","commit_id":"d3ea093c18a2c9e83ae9dcb3a3f5f3deae213bf8"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"89a8927717e5fbfb37614bc159475ca299d8f27b","unresolved":false,"context_lines":[{"line_number":886,"context_line":"    :param deprecated_rule: :class:`.DeprecatedRule`"},{"line_number":887,"context_line":"    :param deprecated_for_removal: indicates whether the policy is planned for"},{"line_number":888,"context_line":"                                   removal in a future release."},{"line_number":889,"context_line":"    :param deprecated_reason: indicates why this policy is planned for removal"},{"line_number":890,"context_line":"                              in a future release. Silently ignored if"},{"line_number":891,"context_line":"                              deprecated_for_removal is False."},{"line_number":892,"context_line":"    :param deprecated_since: indicates which release this policy was deprecated"}],"source_content_type":"text/x-python","patch_set":11,"id":"1f485f77_35687385","line":889,"updated":"2017-11-15 19:15:30.000000000","message":"maybe we should call this deprecated_removal_reason for better clarity...","commit_id":"d3ea093c18a2c9e83ae9dcb3a3f5f3deae213bf8"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"dcfa33007b7a52fa1f4db2802074be00ed0375fa","unresolved":false,"context_lines":[{"line_number":886,"context_line":"    :param deprecated_rule: :class:`.DeprecatedRule`"},{"line_number":887,"context_line":"    :param deprecated_for_removal: indicates whether the policy is planned for"},{"line_number":888,"context_line":"                                   removal in a future release."},{"line_number":889,"context_line":"    :param deprecated_reason: indicates why this policy is planned for removal"},{"line_number":890,"context_line":"                              in a future release. Silently ignored if"},{"line_number":891,"context_line":"                              deprecated_for_removal is False."},{"line_number":892,"context_line":"    :param deprecated_since: indicates which release this policy was deprecated"}],"source_content_type":"text/x-python","patch_set":11,"id":"1f485f77_100c65eb","line":889,"in_reply_to":"1f485f77_35687385","updated":"2017-11-15 19:53:35.000000000","message":"I kept this as consistent with oslo.config as possible.","commit_id":"d3ea093c18a2c9e83ae9dcb3a3f5f3deae213bf8"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"89a8927717e5fbfb37614bc159475ca299d8f27b","unresolved":false,"context_lines":[{"line_number":887,"context_line":"    :param deprecated_for_removal: indicates whether the policy is planned for"},{"line_number":888,"context_line":"                                   removal in a future release."},{"line_number":889,"context_line":"    :param deprecated_reason: indicates why this policy is planned for removal"},{"line_number":890,"context_line":"                              in a future release. Silently ignored if"},{"line_number":891,"context_line":"                              deprecated_for_removal is False."},{"line_number":892,"context_line":"    :param deprecated_since: indicates which release this policy was deprecated"},{"line_number":893,"context_line":"                             in. Accepts any string, though valid version"},{"line_number":894,"context_line":"                             strings are encouraged. Silently ignored if"}],"source_content_type":"text/x-python","patch_set":11,"id":"1f485f77_f5f65b63","line":891,"range":{"start_line":890,"start_character":51,"end_line":891,"end_character":62},"updated":"2017-11-15 19:15:30.000000000","message":"This should say it will be ignored if both deprecated_for_removal is False AND there is no deprecated_rule, to match what we\u0027re actually doing.","commit_id":"d3ea093c18a2c9e83ae9dcb3a3f5f3deae213bf8"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"dcfa33007b7a52fa1f4db2802074be00ed0375fa","unresolved":false,"context_lines":[{"line_number":887,"context_line":"    :param deprecated_for_removal: indicates whether the policy is planned for"},{"line_number":888,"context_line":"                                   removal in a future release."},{"line_number":889,"context_line":"    :param deprecated_reason: indicates why this policy is planned for removal"},{"line_number":890,"context_line":"                              in a future release. Silently ignored if"},{"line_number":891,"context_line":"                              deprecated_for_removal is False."},{"line_number":892,"context_line":"    :param deprecated_since: indicates which release this policy was deprecated"},{"line_number":893,"context_line":"                             in. Accepts any string, though valid version"},{"line_number":894,"context_line":"                             strings are encouraged. Silently ignored if"}],"source_content_type":"text/x-python","patch_set":11,"id":"1f485f77_90f735d4","line":891,"range":{"start_line":890,"start_character":51,"end_line":891,"end_character":62},"in_reply_to":"1f485f77_f5f65b63","updated":"2017-11-15 19:53:35.000000000","message":"Sure - that can be fixed easily in a follow on.","commit_id":"d3ea093c18a2c9e83ae9dcb3a3f5f3deae213bf8"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"89a8927717e5fbfb37614bc159475ca299d8f27b","unresolved":false,"context_lines":[{"line_number":1018,"context_line":"        self._operations \u003d ops"},{"line_number":1019,"context_line":""},{"line_number":1020,"context_line":""},{"line_number":1021,"context_line":"class DeprecatedRule(object):"},{"line_number":1022,"context_line":""},{"line_number":1023,"context_line":"    \"\"\"Represents a Deprecated policy or rule."},{"line_number":1024,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"1f485f77_f5689b1d","line":1021,"updated":"2017-11-15 19:15:30.000000000","message":"I\u0027m sure we\u0027ll have projects that want to keep things for more than one release after they\u0027re deprecated, and that\u0027s not possible with what we\u0027ve got here at the moment.\n\nIf we moved deprecated_for_removal, deprecated_reason and deprecated_since into this class, and changed deprecated_rule to allow an array, we could support multiple deprecations. E.g. in one release I change the name, in the next release I change the name again, or the check_str, or mark it deprecated for removal.","commit_id":"d3ea093c18a2c9e83ae9dcb3a3f5f3deae213bf8"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"dcfa33007b7a52fa1f4db2802074be00ed0375fa","unresolved":false,"context_lines":[{"line_number":1018,"context_line":"        self._operations \u003d ops"},{"line_number":1019,"context_line":""},{"line_number":1020,"context_line":""},{"line_number":1021,"context_line":"class DeprecatedRule(object):"},{"line_number":1022,"context_line":""},{"line_number":1023,"context_line":"    \"\"\"Represents a Deprecated policy or rule."},{"line_number":1024,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"1f485f77_50c41d5f","line":1021,"in_reply_to":"1f485f77_f5689b1d","updated":"2017-11-15 19:53:35.000000000","message":"Sure - that\u0027s if projects plan on queuing changes one release after another. My original thought was to give developers the tools to make multiple changes in one deprecation notice (e.g. they can change the name and check_str at the same time).\n\nWe could add something in the future to support multiple deprecation rules.","commit_id":"d3ea093c18a2c9e83ae9dcb3a3f5f3deae213bf8"}]}
