)]}'
{"oslo_log/formatters.py":[{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"0d7bd302d1e7d096fa353545f90e17af2289fcea","unresolved":false,"context_lines":[{"line_number":29,"context_line":""},{"line_number":30,"context_line":"def _dictify_context(context):"},{"line_number":31,"context_line":"    if getattr(context, \u0027get_logging_values\u0027, None):"},{"line_number":32,"context_line":"        return context.get_logging_values()"},{"line_number":33,"context_line":"    # This dict only style logging format is deprecated, and will be removed"},{"line_number":34,"context_line":"    # when projects using a dictionary object for context are updated"},{"line_number":35,"context_line":"    elif isinstance(context, dict):"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a57f1b5_2380e4f6","line":32,"updated":"2016-02-11 17:52:52.000000000","message":"We should probably keep the to_dict() support as a fall-back for now, until we\u0027re sure all projects are using our base class.","commit_id":"d2a050ad4cba34f9d07d5265fc2d17450bf9bf7e"},{"author":{"_account_id":16051,"name":"Ronald Bradford","email":"ronald.bradford@gmail.com","username":"ronaldbradford"},"change_message_id":"a935904c0d3806ac6f37269c7f422fc8f4dc9f6d","unresolved":false,"context_lines":[{"line_number":29,"context_line":""},{"line_number":30,"context_line":"def _dictify_context(context):"},{"line_number":31,"context_line":"    if getattr(context, \u0027get_logging_values\u0027, None):"},{"line_number":32,"context_line":"        return context.get_logging_values()"},{"line_number":33,"context_line":"    # This dict only style logging format is deprecated, and will be removed"},{"line_number":34,"context_line":"    # when projects using a dictionary object for context are updated"},{"line_number":35,"context_line":"    elif isinstance(context, dict):"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a57f1b5_2e0a0b7a","line":32,"in_reply_to":"3a57f1b5_2380e4f6","updated":"2016-02-11 18:19:28.000000000","message":"ok.\n\nAre you happy if this is all TC approved projects using our base class? \n\nPresently that count is 2:\n\nSolum - https://review.openstack.org/#/c/275433/\nManila - in development progress","commit_id":"d2a050ad4cba34f9d07d5265fc2d17450bf9bf7e"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"5db5e0c968ed9003fc7e3fb4a3f16255ff64810d","unresolved":false,"context_lines":[{"line_number":29,"context_line":""},{"line_number":30,"context_line":"def _dictify_context(context):"},{"line_number":31,"context_line":"    if getattr(context, \u0027get_logging_values\u0027, None):"},{"line_number":32,"context_line":"        return context.get_logging_values()"},{"line_number":33,"context_line":"    # This dict only style logging format is deprecated, and will be removed"},{"line_number":34,"context_line":"    # when projects using a dictionary object for context are updated"},{"line_number":35,"context_line":"    elif isinstance(context, dict):"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a57f1b5_6939dda3","line":32,"in_reply_to":"3a57f1b5_2e0a0b7a","updated":"2016-02-11 18:34:14.000000000","message":"We should follow our deprecation policy. Right now I think that means declaring that we will drop support, issuing a deprecation warning, then waiting a cycle. If you do that now, we could remove support in Ocala. Robert\u0027s backwards-compatibility proposal https://review.openstack.org/#/c/226157 is relevant but not yet adopted.","commit_id":"d2a050ad4cba34f9d07d5265fc2d17450bf9bf7e"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"1e004192332a4b26c51b499b43babb5bf321245b","unresolved":false,"context_lines":[{"line_number":33,"context_line":"    if getattr(context, \u0027get_logging_values\u0027, None):"},{"line_number":34,"context_line":"        return context.get_logging_values()"},{"line_number":35,"context_line":"    elif getattr(context, \u0027to_dict\u0027, None):"},{"line_number":36,"context_line":"        warnings.simplefilter(\u0027always\u0027)"},{"line_number":37,"context_line":"        debtcollector.deprecate("},{"line_number":38,"context_line":"            \u0027The RequestContext.get_logging_values() \u0027"},{"line_number":39,"context_line":"            \u0027method should be defined for logging context specific \u0027"}],"source_content_type":"text/x-python","patch_set":2,"id":"dae33548_190e91e4","line":36,"updated":"2016-02-18 17:36:50.000000000","message":"Applications should set up filters, but not libs. I think this is in the debtcollector library docs to show how to ensure the warnings are emitted, but it shouldn\u0027t be here.","commit_id":"9d9a695fd46aff11d0ea7a84e81283a04a1b436d"},{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"6013af0b5a9227aed3f7b4b684afbbca2f86eef7","unresolved":false,"context_lines":[{"line_number":28,"context_line":"from oslo_serialization import jsonutils"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"def _dictify_context(context):"},{"line_number":32,"context_line":"    if getattr(context, \u0027get_logging_values\u0027, None):"},{"line_number":33,"context_line":"        return context.get_logging_values()"},{"line_number":34,"context_line":"    elif getattr(context, \u0027to_dict\u0027, None):"}],"source_content_type":"text/x-python","patch_set":3,"id":"bae84128_065e0ce9","line":31,"updated":"2016-02-19 16:00:10.000000000","message":"why\u0027d you factor out the \"if context is None\"?","commit_id":"d81d16a1365963cebe088281e7a6e06cf14c0df9"},{"author":{"_account_id":16051,"name":"Ronald Bradford","email":"ronald.bradford@gmail.com","username":"ronaldbradford"},"change_message_id":"7e740efc07a2a354f93839342d4e277c95fa9bd9","unresolved":false,"context_lines":[{"line_number":28,"context_line":"from oslo_serialization import jsonutils"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"def _dictify_context(context):"},{"line_number":32,"context_line":"    if getattr(context, \u0027get_logging_values\u0027, None):"},{"line_number":33,"context_line":"        return context.get_logging_values()"},{"line_number":34,"context_line":"    elif getattr(context, \u0027to_dict\u0027, None):"}],"source_content_type":"text/x-python","patch_set":3,"id":"bae84128_868327cc","line":31,"in_reply_to":"bae84128_065e0ce9","updated":"2016-02-22 14:59:21.000000000","message":"There are actually two conditions, not one (in original code) when we want to return an empty dict.\n\nAlso, from a logical perspective you want the code to read well. So what\u0027s the most obvious and used path of the code.\n\nAs we read code 100s of times more then we write it, IMO to me it now reads easier.\n\nI have no comment if it actually is more performant except to say, this should not be called with an empty option (that\u0027s really an exception)","commit_id":"d81d16a1365963cebe088281e7a6e06cf14c0df9"},{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"81a0573b3bd8284fb5373c0370d126c791d2f5af","unresolved":false,"context_lines":[{"line_number":28,"context_line":"from oslo_serialization import jsonutils"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"def _dictify_context(context):"},{"line_number":32,"context_line":"    if getattr(context, \u0027get_logging_values\u0027, None):"},{"line_number":33,"context_line":"        return context.get_logging_values()"},{"line_number":34,"context_line":"    elif getattr(context, \u0027to_dict\u0027, None):"}],"source_content_type":"text/x-python","patch_set":3,"id":"bae84128_ba91d354","line":31,"in_reply_to":"bae84128_868327cc","updated":"2016-02-22 15:34:29.000000000","message":"If I read your reply correctly, you\u0027re saying:\n\n The original code used an \u0027if\u0027 to check for None then\n iterated over an empty collection. This is slower than a\n single check and therefore bad.\n\n Readability is good. This reads better to me.\n\nI don\u0027t care about performance at this granularity. Iterating over empty things is a fine pattern which should be unrolled and eliminated by any half-decent evaluator. CPython may not qualify but even if not, the difference is negligible.\n\nI agree readability is important but why is your version more readable? I prefer to drive down a low-level concern like None-checking to low-level functions. By writing robust low-level functions, all my higher level code becomes less cluttered.\n\nI\u0027ve taken some time to unpack this and confirm our values to hopefully enhance our further comms but the issue itself is pretty trivial so I\u0027m going to +2.","commit_id":"d81d16a1365963cebe088281e7a6e06cf14c0df9"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"a52ef4b5635c7cb350a900bd5f0e1aa437020e18","unresolved":false,"context_lines":[{"line_number":43,"context_line":"    elif isinstance(context, dict):"},{"line_number":44,"context_line":"        return context"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    return {}"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"# A configuration object is given to us when the application registers"}],"source_content_type":"text/x-python","patch_set":5,"id":"9aed3d3a_1e7c9c71","line":46,"updated":"2016-02-25 19:55:19.000000000","message":"is the intention to change the logic? because this doesn\u0027t work the way it did before. If context was a dict then context would be returned whereas now it\u0027ll check to_dict first.\n\nThe commit message didn\u0027t mention the change in behavior.","commit_id":"a4f186bd7d5d3c444a4f90450564b5fc0832f2c7"},{"author":{"_account_id":16051,"name":"Ronald Bradford","email":"ronald.bradford@gmail.com","username":"ronaldbradford"},"change_message_id":"7ec68516beaf9585c2e5daa23126287ca9266a30","unresolved":false,"context_lines":[{"line_number":43,"context_line":"    elif isinstance(context, dict):"},{"line_number":44,"context_line":"        return context"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    return {}"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"# A configuration object is given to us when the application registers"}],"source_content_type":"text/x-python","patch_set":5,"id":"9aed3d3a_376d4305","line":46,"in_reply_to":"9aed3d3a_1e7c9c71","updated":"2016-02-25 20:47:46.000000000","message":"The purpose of this spec is to use get_logging_values() rather then to_dict() for oslo.log use.\n\nThe code block as it stands goes to highlight by a deprecated notice of the intended work which is being implemented, and to catch projects (in particular those those use Oslo Incubator) to graduate to Oslo libraries.  \n\nThe legacy use of passing a dict object to logging also fails to ensure consistent logging support across projects, and actually causes extra checks. While it would be great to deprecate this, this is a change in logic, and will be discussed and subsequently corrected in other projects first.\n\nThe commit message clearly indicates what logic is in this commit. Related commits matching the topic go to show the larger scope of work.\n\nFWIW, if all OpenStack logging used and extended and context.RequestContext, a great goal to have consistent and clean code in any project development, this entire method could be removed.","commit_id":"a4f186bd7d5d3c444a4f90450564b5fc0832f2c7"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"a52ef4b5635c7cb350a900bd5f0e1aa437020e18","unresolved":false,"context_lines":[{"line_number":66,"context_line":"        \u0027context\u0027,"},{"line_number":67,"context_line":"        context_utils.get_current()"},{"line_number":68,"context_line":"    )"},{"line_number":69,"context_line":"    if context:"},{"line_number":70,"context_line":"        d \u003d _dictify_context(context)"},{"line_number":71,"context_line":"        # Copy the context values directly onto the record so they can be"},{"line_number":72,"context_line":"        # used by the formatting strings."}],"source_content_type":"text/x-python","patch_set":5,"id":"9aed3d3a_7e9048ed","line":69,"updated":"2016-02-25 19:55:19.000000000","message":"it\u0027s unfortunate that this had to change. The function was cleaner looking without the extra logic.","commit_id":"a4f186bd7d5d3c444a4f90450564b5fc0832f2c7"},{"author":{"_account_id":16051,"name":"Ronald Bradford","email":"ronald.bradford@gmail.com","username":"ronaldbradford"},"change_message_id":"7ec68516beaf9585c2e5daa23126287ca9266a30","unresolved":false,"context_lines":[{"line_number":66,"context_line":"        \u0027context\u0027,"},{"line_number":67,"context_line":"        context_utils.get_current()"},{"line_number":68,"context_line":"    )"},{"line_number":69,"context_line":"    if context:"},{"line_number":70,"context_line":"        d \u003d _dictify_context(context)"},{"line_number":71,"context_line":"        # Copy the context values directly onto the record so they can be"},{"line_number":72,"context_line":"        # used by the formatting strings."}],"source_content_type":"text/x-python","patch_set":5,"id":"9aed3d3a_37442373","line":69,"in_reply_to":"9aed3d3a_7e9048ed","updated":"2016-02-25 20:47:46.000000000","message":"I would consider the improvement of code by excluding unneeded code via a pre condition to be the optimal way to write any code.","commit_id":"a4f186bd7d5d3c444a4f90450564b5fc0832f2c7"}],"oslo_log/tests/unit/test_formatters.py":[{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"a52ef4b5635c7cb350a900bd5f0e1aa437020e18","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2016 OpenStack Foundation"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":4,"context_line":"# not use this file except in compliance with the License. You may obtain"}],"source_content_type":"text/x-python","patch_set":5,"id":"9aed3d3a_7e55e81b","line":1,"updated":"2016-02-25 19:55:19.000000000","message":"Remove copyright.","commit_id":"a4f186bd7d5d3c444a4f90450564b5fc0832f2c7"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"a52ef4b5635c7cb350a900bd5f0e1aa437020e18","unresolved":false,"context_lines":[{"line_number":21,"context_line":"from oslotest import base as test_base"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"def _fake_context():"},{"line_number":25,"context_line":"    ctxt \u003d context.RequestContext(user\u003d\"user\","},{"line_number":26,"context_line":"                                  tenant\u003d\"tenant\","},{"line_number":27,"context_line":"                                  project_domain\u003d\"pdomain\","}],"source_content_type":"text/x-python","patch_set":5,"id":"9aed3d3a_e1d2fd33","line":24,"updated":"2016-02-25 19:55:19.000000000","message":"the context seems real to me...","commit_id":"a4f186bd7d5d3c444a4f90450564b5fc0832f2c7"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"a52ef4b5635c7cb350a900bd5f0e1aa437020e18","unresolved":false,"context_lines":[{"line_number":22,"context_line":""},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"def _fake_context():"},{"line_number":25,"context_line":"    ctxt \u003d context.RequestContext(user\u003d\"user\","},{"line_number":26,"context_line":"                                  tenant\u003d\"tenant\","},{"line_number":27,"context_line":"                                  project_domain\u003d\"pdomain\","},{"line_number":28,"context_line":"                                  user_domain\u003d\"udomain\","}],"source_content_type":"text/x-python","patch_set":5,"id":"9aed3d3a_e1367db3","line":25,"updated":"2016-02-25 19:55:19.000000000","message":"prefer \u0027 for strings.","commit_id":"a4f186bd7d5d3c444a4f90450564b5fc0832f2c7"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"a52ef4b5635c7cb350a900bd5f0e1aa437020e18","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        self.tenant \u003d tenant"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def to_dict(self):"},{"line_number":41,"context_line":"        return {\u0027user\u0027: self.user,"},{"line_number":42,"context_line":"                \u0027tenant\u0027: self.tenant}"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"9aed3d3a_a15595c7","line":41,"updated":"2016-02-25 19:55:19.000000000","message":"at least pick \u0027 or \" for strings in the same part.","commit_id":"a4f186bd7d5d3c444a4f90450564b5fc0832f2c7"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"a52ef4b5635c7cb350a900bd5f0e1aa437020e18","unresolved":false,"context_lines":[{"line_number":45,"context_line":"class FormatterTest(test_base.BaseTestCase):"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    def setUp(self):"},{"line_number":48,"context_line":"        super(FormatterTest, self).setUp()"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"    def test_replace_false_value_exists(self):"},{"line_number":51,"context_line":"        d \u003d {\"user\": \"user1\"}"}],"source_content_type":"text/x-python","patch_set":5,"id":"9aed3d3a_4193e9a3","line":48,"updated":"2016-02-25 19:55:19.000000000","message":"this is the default behavior for python so get rid of it.","commit_id":"a4f186bd7d5d3c444a4f90450564b5fc0832f2c7"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"a52ef4b5635c7cb350a900bd5f0e1aa437020e18","unresolved":false,"context_lines":[{"line_number":47,"context_line":"    def setUp(self):"},{"line_number":48,"context_line":"        super(FormatterTest, self).setUp()"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"    def test_replace_false_value_exists(self):"},{"line_number":51,"context_line":"        d \u003d {\"user\": \"user1\"}"},{"line_number":52,"context_line":"        s \u003d \"%(user)s\" % formatters._ReplaceFalseValue(d)"},{"line_number":53,"context_line":"        self.assertEqual(d[\u0027user\u0027], s)"}],"source_content_type":"text/x-python","patch_set":5,"id":"9aed3d3a_61dd4d70","line":50,"updated":"2016-02-25 19:55:19.000000000","message":"what is this test asserting? That _ReplaceFalseValue exists? A comment would help.\n\nThis applies to all these tests.","commit_id":"a4f186bd7d5d3c444a4f90450564b5fc0832f2c7"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"a52ef4b5635c7cb350a900bd5f0e1aa437020e18","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        self.assertEqual(\"-\", s)"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"    def test_dictify_context_empty(self):"},{"line_number":61,"context_line":"        self.assertEqual({}, formatters._dictify_context(None))"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    @mock.patch(\"debtcollector.deprecate\")"},{"line_number":64,"context_line":"    def test_dictify_context_with_dict(self, mock_deprecate):"}],"source_content_type":"text/x-python","patch_set":5,"id":"9aed3d3a_810051ac","line":61,"updated":"2016-02-25 19:55:19.000000000","message":"is None supposed to be {} (an empty dict?)","commit_id":"a4f186bd7d5d3c444a4f90450564b5fc0832f2c7"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"a52ef4b5635c7cb350a900bd5f0e1aa437020e18","unresolved":false,"context_lines":[{"line_number":63,"context_line":"    @mock.patch(\"debtcollector.deprecate\")"},{"line_number":64,"context_line":"    def test_dictify_context_with_dict(self, mock_deprecate):"},{"line_number":65,"context_line":"        d \u003d {\"user\": \"user\"}"},{"line_number":66,"context_line":"        self.assertEqual(d, formatters._dictify_context(d))"},{"line_number":67,"context_line":"        mock_deprecate.assert_not_called()"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    @mock.patch(\"debtcollector.deprecate\")"}],"source_content_type":"text/x-python","patch_set":5,"id":"9aed3d3a_41e4890c","line":66,"updated":"2016-02-25 19:55:19.000000000","message":"this could use assertIs","commit_id":"a4f186bd7d5d3c444a4f90450564b5fc0832f2c7"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"a52ef4b5635c7cb350a900bd5f0e1aa437020e18","unresolved":false,"context_lines":[{"line_number":76,"context_line":"    @mock.patch(\"debtcollector.deprecate\")"},{"line_number":77,"context_line":"    def test_dictify_context_without_get_logging_values(self, mock_deprecate):"},{"line_number":78,"context_line":"        ctxt \u003d AlternativeRequestContext(user\u003d\"user\", tenant\u003d\"tenant\")"},{"line_number":79,"context_line":"        d \u003d {\"user\": \"user\", \"tenant\": \"tenant\"}"},{"line_number":80,"context_line":"        self.assertEqual(d, formatters._dictify_context(ctxt))"},{"line_number":81,"context_line":"        mock_deprecate.assert_called_with("},{"line_number":82,"context_line":"            \u0027The RequestContext.get_logging_values() \u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"9aed3d3a_01872110","line":79,"updated":"2016-02-25 19:55:19.000000000","message":"the user and tenant values should be unique strings so that the text can verify that the code worked correctly and hardcoded strings aren\u0027t left in the code. Use self.getUniqueString() for the user and tenant strings.","commit_id":"a4f186bd7d5d3c444a4f90450564b5fc0832f2c7"}]}
