)]}'
{"swift/common/middleware/copy.py":[{"author":{"_account_id":9625,"name":"Thiago da Silva","email":"thiagodasilva@gmail.com","username":"thiago"},"change_message_id":"89036b50272d5104d45c1bd32e04d8d8175a9f17","unresolved":false,"context_lines":[{"line_number":515,"context_line":""},{"line_number":516,"context_line":"        # We no longer need these headers"},{"line_number":517,"context_line":"        sink_req.headers.pop(\u0027X-Copy-From\u0027, None)"},{"line_number":518,"context_line":"        sink_req.headers.pop(\u0027X-Copy-From-Account\u0027, None)"},{"line_number":519,"context_line":""},{"line_number":520,"context_line":"        # If the copy request does not explicitly override content-type,"},{"line_number":521,"context_line":"        # use the one present in the source object."}],"source_content_type":"text/x-python","patch_set":8,"id":"1aa78d24_3712cf57","line":518,"updated":"2016-07-06 16:46:59.000000000","message":"should x-fresh-metadata also be popped here?","commit_id":"d2212ed3cbe2b0fbc31e5d5055a62c15cbb34bd6"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"56bf3103dc200b0ef01cb7fbbf23584663f9ea40","unresolved":false,"context_lines":[{"line_number":515,"context_line":""},{"line_number":516,"context_line":"        # We no longer need these headers"},{"line_number":517,"context_line":"        sink_req.headers.pop(\u0027X-Copy-From\u0027, None)"},{"line_number":518,"context_line":"        sink_req.headers.pop(\u0027X-Copy-From-Account\u0027, None)"},{"line_number":519,"context_line":""},{"line_number":520,"context_line":"        # If the copy request does not explicitly override content-type,"},{"line_number":521,"context_line":"        # use the one present in the source object."}],"source_content_type":"text/x-python","patch_set":8,"id":"1aa78d24_cb6b7684","line":518,"in_reply_to":"1aa78d24_3712cf57","updated":"2016-07-08 14:43:07.000000000","message":"It could be removed as far as Swift is concerned, since this is the only place we inspect it, but we don\u0027t if a third party middleware might use it. Historically, perhaps it was important to remove the X-Copy-From headers to prevent the request looping back to the copy handling code, whereas X-Fresh-Metadata is harmless in that respect.\n\nSo I agree it would be cleaner to remove it here, but pragmatically we should probably leave it, just in case.","commit_id":"d2212ed3cbe2b0fbc31e5d5055a62c15cbb34bd6"},{"author":{"_account_id":9625,"name":"Thiago da Silva","email":"thiagodasilva@gmail.com","username":"thiago"},"change_message_id":"c3516f4b78f3e6a86c54b9218376fe02de6a1007","unresolved":false,"context_lines":[{"line_number":515,"context_line":""},{"line_number":516,"context_line":"        # We no longer need these headers"},{"line_number":517,"context_line":"        sink_req.headers.pop(\u0027X-Copy-From\u0027, None)"},{"line_number":518,"context_line":"        sink_req.headers.pop(\u0027X-Copy-From-Account\u0027, None)"},{"line_number":519,"context_line":""},{"line_number":520,"context_line":"        # If the copy request does not explicitly override content-type,"},{"line_number":521,"context_line":"        # use the one present in the source object."}],"source_content_type":"text/x-python","patch_set":8,"id":"1aa78d24_b0e12001","line":518,"in_reply_to":"1aa78d24_cb6b7684","updated":"2016-07-08 17:47:46.000000000","message":"Ok, I had a concern on whether x-fresh-metadata would get persisted, but it doesn\u0027t, so no chance of this header getting processed again if object was copied.","commit_id":"d2212ed3cbe2b0fbc31e5d5055a62c15cbb34bd6"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"3cb8e1f034b85dbe9ef308b1bf9737059153c3de","unresolved":false,"context_lines":[{"line_number":467,"context_line":"            # Post-as-copy: ignore new sysmeta, copy existing sysmeta"},{"line_number":468,"context_line":"            remove_items(sink_req.headers, is_object_sysmeta)"},{"line_number":469,"context_line":"            copy_header_subset(source_resp, sink_req, is_object_sysmeta)"},{"line_number":470,"context_line":"        elif config_true_value(req.headers.get(\u0027x-fresh-metadata\u0027, \u0027false\u0027)):"},{"line_number":471,"context_line":"            # x-fresh-metadata only applies to copy, not post-as-copy: ignore"},{"line_number":472,"context_line":"            # existing user metadata, update existing sysmeta with new"},{"line_number":473,"context_line":"            copy_header_subset(source_resp, sink_req, is_object_sysmeta)"}],"source_content_type":"text/x-python","patch_set":10,"id":"dada55a8_8fcc426b","line":470,"range":{"start_line":470,"start_character":67,"end_line":470,"end_character":74},"updated":"2016-07-21 02:25:10.000000000","message":"NIT: Isn\u0027t the False here redundant? Default return will be None, which in config_true_value this should be a False.","commit_id":"b9ea63d64c62873af66fd8fee81961b1328126ff"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"de6ec22ae7278835c5826d93382c6f2957a3815f","unresolved":false,"context_lines":[{"line_number":467,"context_line":"            # Post-as-copy: ignore new sysmeta, copy existing sysmeta"},{"line_number":468,"context_line":"            remove_items(sink_req.headers, is_object_sysmeta)"},{"line_number":469,"context_line":"            copy_header_subset(source_resp, sink_req, is_object_sysmeta)"},{"line_number":470,"context_line":"        elif config_true_value(req.headers.get(\u0027x-fresh-metadata\u0027, \u0027false\u0027)):"},{"line_number":471,"context_line":"            # x-fresh-metadata only applies to copy, not post-as-copy: ignore"},{"line_number":472,"context_line":"            # existing user metadata, update existing sysmeta with new"},{"line_number":473,"context_line":"            copy_header_subset(source_resp, sink_req, is_object_sysmeta)"}],"source_content_type":"text/x-python","patch_set":10,"id":"dada55a8_3291f153","line":470,"range":{"start_line":470,"start_character":67,"end_line":470,"end_character":74},"in_reply_to":"dada55a8_8fcc426b","updated":"2016-07-22 09:30:48.000000000","message":"Agree, strictly it is redundant and usually I would delete the default when it is unnecessary. Here I went with what was already there (line 505 on master) bearing in mind that it\u0027s sometimes helpful to have the default be explicit for easier understanding of the behaviour - it saves the reader going off to check how config_true_value handles a None.","commit_id":"b9ea63d64c62873af66fd8fee81961b1328126ff"}],"swift/common/middleware/slo.py":[{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"d290f061e8b360c73d338332e9e9894af93b2e2b","unresolved":false,"context_lines":[{"line_number":759,"context_line":"                    and source_req.params.get(\u0027multipart-manifest\u0027) !\u003d \u0027get\u0027"},{"line_number":760,"context_line":"                    and \u0027swift.post_as_copy\u0027 not in source_req.environ):"},{"line_number":761,"context_line":"                # delete the slo header so it is not copied to the destination"},{"line_number":762,"context_line":"                del source_resp.headers[\u0027X-Static-Large-Object\u0027]"},{"line_number":763,"context_line":"                source_resp \u003d SloGetContext(self).get_or_head_response("},{"line_number":764,"context_line":"                    source_req, source_resp.headers.items(),"},{"line_number":765,"context_line":"                    source_resp.app_iter)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a5de9d1_fe2b5a92","line":762,"updated":"2016-01-29 03:21:28.000000000","message":"Should there be an update in the slo unit test test_copy_hook_manifest for this new behavior?","commit_id":"fdebb3e4e61aa88cbb73edf94ee9b51f77f599ae"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"b821bd31512728cf9c14ae36d3581767bb601b04","unresolved":false,"context_lines":[{"line_number":759,"context_line":"                    and source_req.params.get(\u0027multipart-manifest\u0027) !\u003d \u0027get\u0027"},{"line_number":760,"context_line":"                    and \u0027swift.post_as_copy\u0027 not in source_req.environ):"},{"line_number":761,"context_line":"                # delete the slo header so it is not copied to the destination"},{"line_number":762,"context_line":"                del source_resp.headers[\u0027X-Static-Large-Object\u0027]"},{"line_number":763,"context_line":"                source_resp \u003d SloGetContext(self).get_or_head_response("},{"line_number":764,"context_line":"                    source_req, source_resp.headers.items(),"},{"line_number":765,"context_line":"                    source_resp.app_iter)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a5de9d1_4f0e178d","line":762,"in_reply_to":"7a5de9d1_fe2b5a92","updated":"2016-02-01 15:44:13.000000000","message":"Done, yes, good call","commit_id":"fdebb3e4e61aa88cbb73edf94ee9b51f77f599ae"}],"swift/proxy/controllers/obj.py":[{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"d290f061e8b360c73d338332e9e9894af93b2e2b","unresolved":false,"context_lines":[{"line_number":489,"context_line":""},{"line_number":490,"context_line":"        # the sink_req has already been initialised with the original req\u0027s"},{"line_number":491,"context_line":"        # headers, now we decide what updates to make to those headers"},{"line_number":492,"context_line":"        if fresh_meta_flag or \u0027swift.post_as_copy\u0027 in sink_req.environ:"},{"line_number":493,"context_line":"            # post-as-copy: ignore new sysmeta, copy existing sysmeta;"},{"line_number":494,"context_line":"            # copy x-static-large-object here so that it happens even if SLO"},{"line_number":495,"context_line":"            # middleware is not installed at time the post-as-copy occurs"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a5de9d1_00e930e6","line":492,"updated":"2016-01-29 03:21:28.000000000","message":"I don\u0027t see the \u0027x-fresh-metadata\u0027 used in any of our tests.  Is there some other way that we cover that case for testing this when only fresh_meta_flag is set? (I don\u0027t know much about this flag, so ... sorry if this is a newbie question).\n\nAlso, should there be updates to the test_obj \"POST_as_COPY\" cases for this?","commit_id":"fdebb3e4e61aa88cbb73edf94ee9b51f77f599ae"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"b821bd31512728cf9c14ae36d3581767bb601b04","unresolved":false,"context_lines":[{"line_number":489,"context_line":""},{"line_number":490,"context_line":"        # the sink_req has already been initialised with the original req\u0027s"},{"line_number":491,"context_line":"        # headers, now we decide what updates to make to those headers"},{"line_number":492,"context_line":"        if fresh_meta_flag or \u0027swift.post_as_copy\u0027 in sink_req.environ:"},{"line_number":493,"context_line":"            # post-as-copy: ignore new sysmeta, copy existing sysmeta;"},{"line_number":494,"context_line":"            # copy x-static-large-object here so that it happens even if SLO"},{"line_number":495,"context_line":"            # middleware is not installed at time the post-as-copy occurs"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a5de9d1_53e6bde8","line":492,"in_reply_to":"7a5de9d1_00e930e6","updated":"2016-02-01 15:44:13.000000000","message":"The \u0027x-fresh-metadata\u0027 header used to be used to indicate that a post-as-copy was happening, but it got replaced with the swift.post_as_copy flag in the environ.\n\nHowever it is, and always has been AFAIK, available to clients to use (although undocumented I believe) to force a complete replacement of metadata headers during a COPY i.e. to force post-as-copy like behaviour.\n\nI added a func test change to verify that in next patch set.\n\nAs for test_obj, I\u0027m not sure I can add anything there beyond the test_server coverage.","commit_id":"fdebb3e4e61aa88cbb73edf94ee9b51f77f599ae"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"d397c5478606e98d7fda94c53710a83101f5441d","unresolved":false,"context_lines":[{"line_number":503,"context_line":"            # from the source to the sink; exclude content-type which is"},{"line_number":504,"context_line":"            # handled conditionally below; exclude etag because the GET may"},{"line_number":505,"context_line":"            # have been ranged so the etag would not match the actual content."},{"line_number":506,"context_line":"            do_not_copy_headers \u003d [\u0027x-object-manifest\u0027, \u0027etag\u0027, \u0027content-type\u0027]"},{"line_number":507,"context_line":"            copy_header_subset(source_resp, sink_req,"},{"line_number":508,"context_line":"                               lambda k: k.lower() not in do_not_copy_headers)"},{"line_number":509,"context_line":"            # now overwrite with original req headers , except content-length"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a5de9d1_cb4d3b3f","line":506,"updated":"2016-01-31 05:37:18.000000000","message":"I wanted to understand what would break if I didn\u0027t have \u0027content-type\u0027 included here.  Removing that from this list does not break any unit or functests.  Could/Should we have a test to assert this behavior?","commit_id":"fdebb3e4e61aa88cbb73edf94ee9b51f77f599ae"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"b821bd31512728cf9c14ae36d3581767bb601b04","unresolved":false,"context_lines":[{"line_number":503,"context_line":"            # from the source to the sink; exclude content-type which is"},{"line_number":504,"context_line":"            # handled conditionally below; exclude etag because the GET may"},{"line_number":505,"context_line":"            # have been ranged so the etag would not match the actual content."},{"line_number":506,"context_line":"            do_not_copy_headers \u003d [\u0027x-object-manifest\u0027, \u0027etag\u0027, \u0027content-type\u0027]"},{"line_number":507,"context_line":"            copy_header_subset(source_resp, sink_req,"},{"line_number":508,"context_line":"                               lambda k: k.lower() not in do_not_copy_headers)"},{"line_number":509,"context_line":"            # now overwrite with original req headers , except content-length"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a5de9d1_ef57c355","line":506,"in_reply_to":"7a5de9d1_cb4d3b3f","updated":"2016-02-01 15:44:13.000000000","message":"hmmm, its pretty hard to test that because it seems that one way or another the sink req must end up with a content-type header: if one is not provided with the source-req or auto-detected, then the source resp values is applied below at line 518. If one is provided with source-req then it gets written back over at line 510.\n\nSo I don\u0027t think it is strictly necessary to even have content-type in do_not_copy headers, but I prefer leaving it there for clarity as to the precedence of the source of the content-type.\n\nBut, I will add test for autodetect and no content-type in source req.","commit_id":"fdebb3e4e61aa88cbb73edf94ee9b51f77f599ae"},{"author":{"_account_id":12261,"name":"Mahati","email":"mahati.chamarthy@gmail.com","username":"Mahati"},"change_message_id":"a9b5ea4d38ddceded657ac30700a9ea5df7e2195","unresolved":false,"context_lines":[{"line_number":493,"context_line":"            # post-as-copy: ignore new sysmeta, copy existing sysmeta;"},{"line_number":494,"context_line":"            # copy x-static-large-object here so that it happens even if SLO"},{"line_number":495,"context_line":"            # middleware is not installed at time the post-as-copy occurs"},{"line_number":496,"context_line":"            copy_headers \u003d [\u0027content-length\u0027, \u0027x-static-large-object\u0027]"},{"line_number":497,"context_line":"            condition \u003d lambda k: (is_sys_meta(\u0027object\u0027, k) or"},{"line_number":498,"context_line":"                                   k.lower() in copy_headers)"},{"line_number":499,"context_line":"            remove_items(sink_req.headers, condition)"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a5de9d1_1bc7cf65","line":496,"updated":"2016-02-02 11:07:24.000000000","message":"This maybe pretty basic, how are we sure that we will always have \u0027x-static\u003dlarge-object\u0027? What if slo was never installed? So keeping the below condition makes sense right?\n\n\"if \u0027X-Static-Large-Object\u0027 in source_resp.headers\"","commit_id":"b82fd917f12cc7f5dcb2a8d00db7b0b96ac602c3"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"97cb77db6f0650770ea8ca46fd5045ff539b40df","unresolved":false,"context_lines":[{"line_number":493,"context_line":"            # post-as-copy: ignore new sysmeta, copy existing sysmeta;"},{"line_number":494,"context_line":"            # copy x-static-large-object here so that it happens even if SLO"},{"line_number":495,"context_line":"            # middleware is not installed at time the post-as-copy occurs"},{"line_number":496,"context_line":"            copy_headers \u003d [\u0027content-length\u0027, \u0027x-static-large-object\u0027]"},{"line_number":497,"context_line":"            condition \u003d lambda k: (is_sys_meta(\u0027object\u0027, k) or"},{"line_number":498,"context_line":"                                   k.lower() in copy_headers)"},{"line_number":499,"context_line":"            remove_items(sink_req.headers, condition)"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a5de9d1_26c38b3a","line":496,"in_reply_to":"7a5de9d1_1bc7cf65","updated":"2016-02-02 12:22:04.000000000","message":"We don\u0027t know there will always be an x-static-large-object, but the code does not assert that, it just says that if its there then its ok to copy it.\n\nBut, I really should not be using a list where a tuple would do the job :(","commit_id":"b82fd917f12cc7f5dcb2a8d00db7b0b96ac602c3"}],"test/unit/common/middleware/test_copy.py":[{"author":{"_account_id":9625,"name":"Thiago da Silva","email":"thiagodasilva@gmail.com","username":"thiago"},"change_message_id":"89036b50272d5104d45c1bd32e04d8d8175a9f17","unresolved":false,"context_lines":[{"line_number":1260,"context_line":"        self.assertEqual(\u0027Not Bar\u0027, req_headers.get(\u0027X-Foo\u0027))"},{"line_number":1261,"context_line":"        self.assertNotIn(\u0027X-Timestamp\u0027, req_headers)"},{"line_number":1262,"context_line":"        self.assertNotIn(\u0027X-Backend-Timestamp\u0027, req_headers)"},{"line_number":1263,"context_line":""},{"line_number":1264,"context_line":""},{"line_number":1265,"context_line":"class TestServerSideCopyConfiguration(unittest.TestCase):"},{"line_number":1266,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"1aa78d24_11bd1eb7","line":1263,"updated":"2016-07-06 16:46:59.000000000","message":"I added one more test here of X-Fresh-Metadata\n\nhttp://paste.fedoraproject.org/388376/78235061/","commit_id":"d2212ed3cbe2b0fbc31e5d5055a62c15cbb34bd6"}]}
