)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"d6744338ee5db35cc0e462e7194db1cead09f14a","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"348b5db3_6a879aed","updated":"2023-10-26 23:59:12.000000000","message":"I\u0027m not sure I understand the value of the named-tuple - it makes the assertIn failures a little harder to eyeball:\n\n    E       AssertionError: (b\u0027account-auditor.failures:1|c\u0027, (\u0027host\u0027, 8125)) not found in [SendToCall(payload\u003db\u0027testfailures:1|c\u0027, address\u003d(\u0027host\u0027, 8125)), SendToCall(payload\u003db\u0027testtiming:1.5116|ms\u0027, address\u003d(\u0027host\u0027, 8125))]\n\n... but I\u0027m not sure have a strong reason to object to this patch; without the prefix stub matching the actual presented sendto results won\u0027t look like what a real statsd server would get from a real statsd client that a real swift deamon configured.  So that seems reasonable, I like asserting things look a lot like what actually happens in prod!  But I\u0027d suggest we take it further:\n\nhttps://review.opendev.org/c/openstack/swift/+/899437\n\n... and maybe keep going!","commit_id":"40118461486e334fcb84d60e51e0bfb2b1251674"}],"test/debug_logger.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"d6744338ee5db35cc0e462e7194db1cead09f14a","unresolved":true,"context_lines":[{"line_number":57,"context_line":"        return None, None"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def _open_socket(self):"},{"line_number":60,"context_line":"        return self"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"    # sendto and close are mimicing the socket calls."},{"line_number":63,"context_line":"    def sendto(self, msg, target):"}],"source_content_type":"text/x-python","patch_set":3,"id":"2caf093c_a503c9db","side":"PARENT","line":60,"updated":"2023-10-26 23:59:12.000000000","message":"ok, so this was weird.","commit_id":"9191a32e2ecad99f9bf129676b52c9d1fba5d269"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"d6744338ee5db35cc0e462e7194db1cead09f14a","unresolved":true,"context_lines":[{"line_number":66,"context_line":"            sendto\u003dlambda payload, address: self.sendto_calls.append("},{"line_number":67,"context_line":"                SendtoCall(payload, address)),"},{"line_number":68,"context_line":"            close\u003dlambda: None,"},{"line_number":69,"context_line":"        )"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"    def _send(self, *args, **kwargs):"},{"line_number":72,"context_line":"        self.send_calls.append((args, kwargs))"}],"source_content_type":"text/x-python","patch_set":3,"id":"25048309_fbc13092","line":69,"updated":"2023-10-26 23:59:12.000000000","message":"but this is *kind of* weird too?  Ok you make a thing and it only has two methods and they\u0027re pretty simple - ok, but what\u0027s wrong with a simple class?  Seems like a StubSocket or something would be a bit more idiomatic.","commit_id":"40118461486e334fcb84d60e51e0bfb2b1251674"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"d26e53dcfbedb6fafc993895d807c5c61d722a22","unresolved":true,"context_lines":[{"line_number":41,"context_line":"        self.sendto_calls.append(SendtoCall(payload, address))"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    def close(self):"},{"line_number":44,"context_line":"        pass"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"class FakeStatsdClient(statsd_client.StatsdClient):"}],"source_content_type":"text/x-python","patch_set":18,"id":"b73cd05d_7c47c9d1","line":44,"updated":"2024-06-25 15:26:33.000000000","message":"ok so this just shifts the existing socket capture out to a class and wraps the captured stuff in a NamedTuple. I\u0027m not sure I actually saw any access to the members *by name* but that\u0027s fine - it is a useful helper.","commit_id":"a21d078009e2750b8a513dd9f832723c3b51dbe0"}],"test/unit/account/test_auditor.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"d6744338ee5db35cc0e462e7194db1cead09f14a","unresolved":true,"context_lines":[{"line_number":120,"context_line":"        # do an audit"},{"line_number":121,"context_line":"        conf \u003d {\u0027devices\u0027: tempdir, \u0027mount_check\u0027: False,"},{"line_number":122,"context_line":"                \u0027recon_cache_path\u0027: tempdir}"},{"line_number":123,"context_line":"        test_auditor \u003d auditor.AccountAuditor(conf, logger\u003dself.logger)"},{"line_number":124,"context_line":"        test_auditor.run_once()"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"        # validate errors"}],"source_content_type":"text/x-python","patch_set":3,"id":"b05f414c_f374e5bf","line":123,"updated":"2023-10-26 23:59:12.000000000","message":"since we pass in logger\u003dself.logger it makes sense that we\u0027d have to configure prefix before we create the deamon; even tho real code would configure the logger/stats-client from the conf dict","commit_id":"40118461486e334fcb84d60e51e0bfb2b1251674"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"d6744338ee5db35cc0e462e7194db1cead09f14a","unresolved":true,"context_lines":[{"line_number":138,"context_line":"            {\u0027failures\u0027: 1})"},{"line_number":139,"context_line":"        self.assertIn("},{"line_number":140,"context_line":"            (b\u0027account-auditor.failures:1|c\u0027, (\u0027host\u0027, 8125)),"},{"line_number":141,"context_line":"            test_auditor.logger.statsd_client.sendto_calls)"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"if __name__ \u003d\u003d \u0027__main__\u0027:"}],"source_content_type":"text/x-python","patch_set":3,"id":"7ffd90c5_84f8348d","line":141,"updated":"2023-10-26 23:59:12.000000000","message":"that\u0027s pretty nice; we\u0027re injecting our fake behind the statsd_client dependency so we can see what it spits on the wire.  Verify we\u0027re actually using it\u0027s interface(s) correctly to ground truth.  I can get behind that ...\n\n... but it means our tests might someday grow some fancy parsing logic that\u0027s not far off from the prometheus statsd exporter server implementation; and that\u0027s probably not written in python so we can\u0027t just import it.","commit_id":"40118461486e334fcb84d60e51e0bfb2b1251674"}],"test/unit/common/middleware/test_proxy_logging.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"d6744338ee5db35cc0e462e7194db1cead09f14a","unresolved":true,"context_lines":[{"line_number":174,"context_line":""},{"line_number":175,"context_line":"    def test_log_request_statsd_invalid_stats_types(self):"},{"line_number":176,"context_line":"        app \u003d proxy_logging.ProxyLoggingMiddleware(FakeApp(), {})"},{"line_number":177,"context_line":"        app.access_logger \u003d debug_logger()"},{"line_number":178,"context_line":"        for url in [\u0027/\u0027, \u0027/foo\u0027, \u0027/foo/bar\u0027, \u0027/v1\u0027]:"},{"line_number":179,"context_line":"            req \u003d Request.blank(url, environ\u003d{\u0027REQUEST_METHOD\u0027: \u0027GET\u0027})"},{"line_number":180,"context_line":"            resp \u003d app(req.environ, start_response)"}],"source_content_type":"text/x-python","patch_set":3,"id":"c2fe6009_241e13cc","side":"PARENT","line":177,"updated":"2023-10-26 23:59:12.000000000","message":"there\u0027s a lot of this cleanup in here; but i prefer using the constructor.","commit_id":"9191a32e2ecad99f9bf129676b52c9d1fba5d269"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"d6744338ee5db35cc0e462e7194db1cead09f14a","unresolved":true,"context_lines":[{"line_number":163,"context_line":"            self.assertIn("},{"line_number":164,"context_line":"                ((\u0027proxy-server.%s:%s|c\u0027 % (metric, value)).encode(),"},{"line_number":165,"context_line":"                 (\u0027host\u0027, 8125)),"},{"line_number":166,"context_line":"                app.access_logger.statsd_client.sendto_calls)"},{"line_number":167,"context_line":""},{"line_number":168,"context_line":"    def test_logger_statsd_prefix(self):"},{"line_number":169,"context_line":"        app \u003d proxy_logging.ProxyLoggingMiddleware("}],"source_content_type":"text/x-python","patch_set":3,"id":"0c4fa7bb_14da6c94","line":166,"updated":"2023-10-26 23:59:12.000000000","message":"how much value does seeing the stubbed prefix appended add over the existing assertions?  what\u0027s the end game here?","commit_id":"40118461486e334fcb84d60e51e0bfb2b1251674"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"d6744338ee5db35cc0e462e7194db1cead09f14a","unresolved":true,"context_lines":[{"line_number":538,"context_line":"            [x for x in resp]"},{"line_number":539,"context_line":"            log_parts \u003d self._log_parts(app)"},{"line_number":540,"context_line":"            headers \u003d unquote(log_parts[14]).split(\u0027\\n\u0027)"},{"line_number":541,"context_line":"            self.assertIn(\u0027Host: localhost:80\u0027, headers)"},{"line_number":542,"context_line":""},{"line_number":543,"context_line":"    def test_access_log_headers_only(self):"},{"line_number":544,"context_line":"        app \u003d proxy_logging.ProxyLoggingMiddleware("}],"source_content_type":"text/x-python","patch_set":3,"id":"7ecb797d_99c8d39e","line":541,"updated":"2023-10-26 23:59:12.000000000","message":"this is also nicer","commit_id":"40118461486e334fcb84d60e51e0bfb2b1251674"}]}
