)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"d3518b6b436837b06015ebb25f4b3dea23d90591","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"3f7a2c22_f17af954","updated":"2026-09-17 12:11:10.000000000","message":"If base_labels is not already installed then let\u0027s make s3api install it, and then we can hope that auth middlewares and/or rightmost proxy-logging will set the account. That requires some refactoring  to make base_labels helper functions available, which I tried out here \n\n1006018: sq? wip: re-use base_labels helpers in s3api | https://review.opendev.org/c/openstack/swift/+/1006018 \n\n...and then went on to see how it would work out in this patch.","commit_id":"875364b80483d79c11beb37f87d67aeed65dd4df"}],"swift/common/middleware/s3api/s3api.py":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"d3518b6b436837b06015ebb25f4b3dea23d90591","unresolved":true,"context_lines":[{"line_number":413,"context_line":""},{"line_number":414,"context_line":"        labels[\u0027status\u0027] \u003d resp.status_int"},{"line_number":415,"context_line":"        labels[\u0027method\u0027] \u003d env.get(\u0027REQUEST_METHOD\u0027)"},{"line_number":416,"context_line":"        swift_path \u003d env.get(\u0027swift.backend_path\u0027)"},{"line_number":417,"context_line":"        if swift_path:"},{"line_number":418,"context_line":"            vers, acc, con, obj \u003d split_path(swift_path, 1, 4, True)"},{"line_number":419,"context_line":"            if obj:"}],"source_content_type":"text/x-python","patch_set":1,"id":"af91cb8c_366315cc","side":"PARENT","line":416,"updated":"2026-09-17 12:11:10.000000000","message":"existing deficiency: 400 responses have no swift.backend_path, but they do have a path which would at least give us container and object","commit_id":"ef169bada576dbe7a6b87da4bf94c7431b448b16"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"d3518b6b436837b06015ebb25f4b3dea23d90591","unresolved":true,"context_lines":[{"line_number":407,"context_line":""},{"line_number":408,"context_line":"        return labels"},{"line_number":409,"context_line":""},{"line_number":410,"context_line":"    def _emit_response_header_stats(self, env, resp, labels):"},{"line_number":411,"context_line":"        if not labels:"},{"line_number":412,"context_line":"            return"},{"line_number":413,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"c7a278fb_ed6b3886","line":410,"updated":"2026-09-17 12:11:10.000000000","message":"this method name is a little odd because the stats are primarily about the request headers. The only label related to response is the status int. I expect it to be \n\n``_emit_request_header_stats``\n\nparticularly because the caller passes in a variable named ``req_header_labels``","commit_id":"875364b80483d79c11beb37f87d67aeed65dd4df"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"d3518b6b436837b06015ebb25f4b3dea23d90591","unresolved":true,"context_lines":[{"line_number":415,"context_line":"        if base_labels is not None:"},{"line_number":416,"context_line":"            labels.update(base_labels)"},{"line_number":417,"context_line":"            if labels.get(\u0027account\u0027) is None:"},{"line_number":418,"context_line":"                swift_path \u003d env.get(\u0027swift.backend_path\u0027)"},{"line_number":419,"context_line":"                if swift_path:"},{"line_number":420,"context_line":"                    labels[\u0027account\u0027] \u003d split_path("},{"line_number":421,"context_line":"                        swift_path, 1, 4, True)[1]"}],"source_content_type":"text/x-python","patch_set":1,"id":"032395c3_89c700ee","line":418,"updated":"2026-09-17 12:11:10.000000000","message":"``swift.backend_path`` is not a reliable source for account, because in some circumstances it can still have a fernet token on the account field\n\nSee: https://review.opendev.org/c/openstack/swift/+/974367\n\nIMHO we should (plan to) stop using it as a source of \u0027account\u0027; auth middlewares should populate the base_labels with an account. To facilitate that, s3api can install base_labels in the request env if it is not already there (so it is not relying on proxy_logging).","commit_id":"875364b80483d79c11beb37f87d67aeed65dd4df"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"d3518b6b436837b06015ebb25f4b3dea23d90591","unresolved":true,"context_lines":[{"line_number":419,"context_line":"                if swift_path:"},{"line_number":420,"context_line":"                    labels[\u0027account\u0027] \u003d split_path("},{"line_number":421,"context_line":"                        swift_path, 1, 4, True)[1]"},{"line_number":422,"context_line":"        else:"},{"line_number":423,"context_line":"            labels[\u0027account\u0027] \u003d None"},{"line_number":424,"context_line":"            labels[\u0027api\u0027] \u003d \u0027S3\u0027"},{"line_number":425,"context_line":"            labels[\u0027method\u0027] \u003d env.get(\u0027REQUEST_METHOD\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"bbe60083_4876a9e4","line":422,"updated":"2026-09-17 12:11:10.000000000","message":"````\nelse:\n    \u003ccreate base labels\u003e\n````\n\nlet\u0027s use common data structures and help functions to always use base labels as a starting point","commit_id":"875364b80483d79c11beb37f87d67aeed65dd4df"}],"test/unit/common/middleware/s3api/test_s3api.py":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"d3518b6b436837b06015ebb25f4b3dea23d90591","unresolved":true,"context_lines":[{"line_number":1979,"context_line":"            self.assertEqual(\u0027S3\u0027, labels.pop(\u0027api\u0027))"},{"line_number":1980,"context_line":"            self.assertIn(\u0027account\u0027, labels)"},{"line_number":1981,"context_line":"            if labels[\u0027account\u0027] is None:"},{"line_number":1982,"context_line":"                labels.pop(\u0027account\u0027)"},{"line_number":1983,"context_line":"        return labels"},{"line_number":1984,"context_line":""},{"line_number":1985,"context_line":"    def test_emit_stats_x_amx_content_sha256_real_hash(self):"}],"source_content_type":"text/x-python","patch_set":1,"id":"bb2c7848_f8e9ca8f","line":1982,"updated":"2026-09-17 12:11:10.000000000","message":"I can see this patch is WIP, so I hope this is just a temporary workaround. I\u0027d prefer the helper not to be modifying the data structure that we are testing.","commit_id":"875364b80483d79c11beb37f87d67aeed65dd4df"}]}
