)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"9eeb0235915ecf6258929e6a6d65df9aa678b923","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"565ca9ab_70c07769","updated":"2025-02-03 13:58:48.000000000","message":"For the following three commands\n```\naws s3api put-object --bucket test --key test  --checksum-algorithm sha256 --debug\naws s3api list-objects --bucket test\naws s3api get-object --bucket test --key test --debug -\n```\n\nthe stats I see WITHOUT this patch\n\n```\nswift_s3_checksum_algo_request:1|c|#account:AUTH_test,container:test,header_x_amz_checksum_sha256:unknown,header_x_amz_content_sha256:hash_64,header_x_amz_sdk_checksum_algorithm:SHA256,method:PUT,status:200\nswift_s3_checksum_algo_request:1|c|#account:AUTH_test,container:test,header_x_amz_content_sha256:hash_64,method:GET,status:200\nswift_s3_checksum_algo_request:1|c|#account:AUTH_test,container:test,header_x_amz_content_sha256:hash_64,method:GET,status:200\n```\n\nand then WITH this patch:\n```\nswift_s3_checksum_algo_request:1|c|#account:AUTH_test,container:test,header_x_amz_checksum_sha256:b64_44,header_x_amz_content_sha256:hash_64,header_x_amz_sdk_checksum_algorithm:SHA256,method:PUT,status:200,type:object\nswift_s3_checksum_algo_request:1|c|#account:AUTH_test,container:test,header_x_amz_content_sha256:hash_64,method:GET,status:200,type:container\nswift_s3_checksum_algo_request:1|c|#account:AUTH_test,container:test,header_x_amz_content_sha256:hash_64,method:GET,status:200,type:object\n```","commit_id":"ade478a28665a8ec36cb74e027e6df05022d4a60"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"4e5bd1272c910e63e1b4739a62462c135edfd979","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"6742d156_c5f30319","updated":"2025-02-03 17:04:24.000000000","message":"let\u0027s squash this!","commit_id":"ade478a28665a8ec36cb74e027e6df05022d4a60"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"5bb1cb2dfd87ad40520ca7b06b2c11b4571d5bf4","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"692b2432_8ff48f02","updated":"2025-02-03 15:05:47.000000000","message":"tried all the checksum variants:\n\n```\nswift_s3_checksum_algo_request:1|c|#account:AUTH_test,container:test,header_x_amz_checksum_sha1:b64_28,header_x_amz_content_sha256:hash_64,header_x_amz_sdk_checksum_algorithm:SHA1,method:PUT,status:200,type:object\nswift_s3_checksum_algo_request:1|c|#account:AUTH_test,container:test,header_x_amz_checksum_sha256:b64_44,header_x_amz_content_sha256:hash_64,header_x_amz_sdk_checksum_algorithm:SHA256,method:PUT,status:200,type:object\nswift_s3_checksum_algo_request:1|c|#account:AUTH_test,container:test,header_x_amz_checksum_crc32:b64_8,header_x_amz_content_sha256:hash_64,header_x_amz_sdk_checksum_algorithm:CRC32,method:PUT,status:200,type:object\nswift_s3_checksum_algo_request:1|c|#account:AUTH_test,container:test,header_x_amz_checksum_crc32c:b64_8,header_x_amz_content_sha256:hash_64,header_x_amz_sdk_checksum_algorithm:CRC32C,method:PUT,status:200,type:object\nswift_s3_checksum_algo_request:1|c|#account:AUTH_test,container:test,header_x_amz_checksum_crc64nvme:b64_12,header_x_amz_content_sha256:hash_64,header_x_amz_sdk_checksum_algorithm:CRC64NVME,method:PUT,status:200,type:object\n```","commit_id":"ade478a28665a8ec36cb74e027e6df05022d4a60"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"4e5bd1272c910e63e1b4739a62462c135edfd979","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"037295d5_d374722a","in_reply_to":"565ca9ab_70c07769","updated":"2025-02-03 17:04:24.000000000","message":"interesting!  so x-amz-checksum-sha256 is for PUT \"checksum\" and x-amz-content-sha256 is more like just \"auth\" - fixing the header_x_amz_checksum_sha256:unknown \u003d\u003e test,header_x_amz_checksum_sha256:b64_44 seems like a very nice fix","commit_id":"ade478a28665a8ec36cb74e027e6df05022d4a60"}],"swift/common/middleware/s3api/s3api.py":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"9eeb0235915ecf6258929e6a6d65df9aa678b923","unresolved":true,"context_lines":[{"line_number":394,"context_line":"        if \u0027swift.backend_path\u0027 in env:"},{"line_number":395,"context_line":"            vers, acc, con, obj \u003d split_path("},{"line_number":396,"context_line":"                env.get(\u0027swift.backend_path\u0027), 1, 4, True)"},{"line_number":397,"context_line":"            if obj:"},{"line_number":398,"context_line":"                labels[\u0027type\u0027] \u003d \u0027object\u0027"},{"line_number":399,"context_line":"                labels[\u0027account\u0027] \u003d acc"},{"line_number":400,"context_line":"                labels[\u0027container\u0027] \u003d con"}],"source_content_type":"text/x-python","patch_set":1,"id":"e83b35a3_362001d4","line":397,"updated":"2025-02-03 13:58:48.000000000","message":"we should surely find a way to share this code with proxy_logging, but for now I just wanted a fix.","commit_id":"ade478a28665a8ec36cb74e027e6df05022d4a60"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"9eeb0235915ecf6258929e6a6d65df9aa678b923","unresolved":true,"context_lines":[{"line_number":395,"context_line":"            vers, acc, con, obj \u003d split_path("},{"line_number":396,"context_line":"                env.get(\u0027swift.backend_path\u0027), 1, 4, True)"},{"line_number":397,"context_line":"            if obj:"},{"line_number":398,"context_line":"                labels[\u0027type\u0027] \u003d \u0027object\u0027"},{"line_number":399,"context_line":"                labels[\u0027account\u0027] \u003d acc"},{"line_number":400,"context_line":"                labels[\u0027container\u0027] \u003d con"},{"line_number":401,"context_line":"            elif con:"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f7149b7_c282cc6c","line":398,"updated":"2025-02-03 13:58:48.000000000","message":"alternatively we could set \u0027object\u0027 label to None, but proxy_logging uses \u0027type\u0027 labels so I went for consistency","commit_id":"ade478a28665a8ec36cb74e027e6df05022d4a60"},{"author":{"_account_id":35790,"name":"Shreeya Deshpande","email":"shreeyad@nvidia.com","username":"shreeyad"},"change_message_id":"872bcd6a6227f595d20c3c5861379bdef14d27f8","unresolved":false,"context_lines":[{"line_number":395,"context_line":"            vers, acc, con, obj \u003d split_path("},{"line_number":396,"context_line":"                env.get(\u0027swift.backend_path\u0027), 1, 4, True)"},{"line_number":397,"context_line":"            if obj:"},{"line_number":398,"context_line":"                labels[\u0027type\u0027] \u003d \u0027object\u0027"},{"line_number":399,"context_line":"                labels[\u0027account\u0027] \u003d acc"},{"line_number":400,"context_line":"                labels[\u0027container\u0027] \u003d con"},{"line_number":401,"context_line":"            elif con:"}],"source_content_type":"text/x-python","patch_set":1,"id":"2081332e_a938cdd4","line":398,"in_reply_to":"7f7149b7_c282cc6c","updated":"2025-02-03 14:41:30.000000000","message":"Acknowledged","commit_id":"ade478a28665a8ec36cb74e027e6df05022d4a60"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"9eeb0235915ecf6258929e6a6d65df9aa678b923","unresolved":true,"context_lines":[{"line_number":403,"context_line":"                labels[\u0027account\u0027] \u003d acc"},{"line_number":404,"context_line":"                labels[\u0027container\u0027] \u003d con"},{"line_number":405,"context_line":"            elif acc:"},{"line_number":406,"context_line":"                labels[\u0027account\u0027] \u003d acc"},{"line_number":407,"context_line":"                labels[\u0027type\u0027] \u003d \u0027account\u0027"},{"line_number":408,"context_line":"            else:"},{"line_number":409,"context_line":"                labels[\u0027type\u0027] \u003d \u0027UNKNOWN\u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"67f7def5_22a0e839","line":406,"updated":"2025-02-03 13:58:48.000000000","message":"alternatively, rather than omit the container label, we could set it to None. But proxy_logging omits it so I went for consistency.","commit_id":"ade478a28665a8ec36cb74e027e6df05022d4a60"},{"author":{"_account_id":35790,"name":"Shreeya Deshpande","email":"shreeyad@nvidia.com","username":"shreeyad"},"change_message_id":"872bcd6a6227f595d20c3c5861379bdef14d27f8","unresolved":false,"context_lines":[{"line_number":403,"context_line":"                labels[\u0027account\u0027] \u003d acc"},{"line_number":404,"context_line":"                labels[\u0027container\u0027] \u003d con"},{"line_number":405,"context_line":"            elif acc:"},{"line_number":406,"context_line":"                labels[\u0027account\u0027] \u003d acc"},{"line_number":407,"context_line":"                labels[\u0027type\u0027] \u003d \u0027account\u0027"},{"line_number":408,"context_line":"            else:"},{"line_number":409,"context_line":"                labels[\u0027type\u0027] \u003d \u0027UNKNOWN\u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"0ec87e23_76ffd606","line":406,"in_reply_to":"67f7def5_22a0e839","updated":"2025-02-03 14:41:30.000000000","message":"Acknowledged","commit_id":"ade478a28665a8ec36cb74e027e6df05022d4a60"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"6cc849e1c72897b96404d068a732617e40685350","unresolved":true,"context_lines":[{"line_number":408,"context_line":"            else:"},{"line_number":409,"context_line":"                labels[\u0027type\u0027] \u003d \u0027UNKNOWN\u0027"},{"line_number":410,"context_line":"        else:"},{"line_number":411,"context_line":"            labels[\u0027type\u0027] \u003d \u0027UNKNOWN\u0027"},{"line_number":412,"context_line":""},{"line_number":413,"context_line":"        self.statsd.increment(\"swift_s3_checksum_algo_request\", labels)"},{"line_number":414,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"f39da0a9_c36ce116","line":411,"updated":"2025-02-03 15:13:15.000000000","message":"all the if/elif/else above reminded me that I wondered if it would be a useful property of the labeled metrics API to ignore labels with value None when constructing the line to send. Then I could have written:\n\n```\nvers, acc, con, obj \u003d split_path(\n                env.get(\u0027swift.backend_path\u0027), 1, 4, True)\nlabels[\u0027container\u0027] \u003d con\n```\n\nwithout worrying about whether ``con`` was None - None values just get dropped from the labels??\n\nBut I guess that assumes no-one ever wants to report a label with value ``None``, and I could alternatively have achieved the same by writing:\n```\nlabels \u003d {(k, v) for k, v in labels.items() if v is not None}\n```\nbefore calling increment.","commit_id":"ade478a28665a8ec36cb74e027e6df05022d4a60"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"4e5bd1272c910e63e1b4739a62462c135edfd979","unresolved":true,"context_lines":[{"line_number":408,"context_line":"            else:"},{"line_number":409,"context_line":"                labels[\u0027type\u0027] \u003d \u0027UNKNOWN\u0027"},{"line_number":410,"context_line":"        else:"},{"line_number":411,"context_line":"            labels[\u0027type\u0027] \u003d \u0027UNKNOWN\u0027"},{"line_number":412,"context_line":""},{"line_number":413,"context_line":"        self.statsd.increment(\"swift_s3_checksum_algo_request\", labels)"},{"line_number":414,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"395258a5_ed04786e","line":411,"in_reply_to":"f39da0a9_c36ce116","updated":"2025-02-03 17:04:24.000000000","message":"if we ever write the bug where we send a label\u003dNone and the fix ends up being auditing all call sites to add the above code we might bake it into the API\n\n... but as you state it makes it impossible to send label\u003dNone\n\n... which probably ends up being label\u003d\u0027None\u0027 on the wire; so maybe a weird enough use-case that it\u0027s ok to make you jump through hoops if that\u0027s really what you want?","commit_id":"ade478a28665a8ec36cb74e027e6df05022d4a60"}]}
