)]}'
{"tripleo_common/image/image_uploader.py":[{"author":{"_account_id":6926,"name":"Bogdan Dobrelya","email":"bdobreli@redhat.com","username":"bogdando"},"change_message_id":"357fa3645853f50cce67e87aa87a3f0c6922ad17","unresolved":true,"context_lines":[{"line_number":1952,"context_line":"                    new_layers \u003d []"},{"line_number":1953,"context_line":"                    for layer in layers:"},{"line_number":1954,"context_line":"                        layer_type \u003d layer.get(\u0027mediaType\u0027)"},{"line_number":1955,"context_line":"                        if layer_type \u003d\u003d MEDIA_OCI_LAYER_COMPRESSED:"},{"line_number":1956,"context_line":"                            layer[\u0027mediaType\u0027] \u003d MEDIA_BLOB_COMPRESSED"},{"line_number":1957,"context_line":"                        elif layer_type \u003d\u003d MEDIA_OCI_LAYER:"},{"line_number":1958,"context_line":"                            layer[\u0027mediaType\u0027] \u003d MEDIA_BLOB"},{"line_number":1959,"context_line":"                        new_layers.append(layer)"},{"line_number":1960,"context_line":"                    manifest[\u0027layers\u0027] \u003d new_layers"},{"line_number":1961,"context_line":"            elif manifest_type \u003d\u003d MEDIA_CONFIG:"}],"source_content_type":"text/x-python","patch_set":3,"id":"cc626dd7_8da3c674","line":1958,"range":{"start_line":1955,"start_character":0,"end_line":1958,"end_character":59},"updated":"2021-09-22 09:35:35.000000000","message":"don\u0027t we need the else case here so that no layers would stay behind?","commit_id":"13605c924ce9bfe641c2fffecd4f0ab943ee0c8f"},{"author":{"_account_id":14985,"name":"Alex Schultz","email":"aschultz@next-development.com","username":"mwhahaha"},"change_message_id":"b93c457719ef37faf3aa0633e4b2f476cb26a00a","unresolved":true,"context_lines":[{"line_number":1952,"context_line":"                    new_layers \u003d []"},{"line_number":1953,"context_line":"                    for layer in layers:"},{"line_number":1954,"context_line":"                        layer_type \u003d layer.get(\u0027mediaType\u0027)"},{"line_number":1955,"context_line":"                        if layer_type \u003d\u003d MEDIA_OCI_LAYER_COMPRESSED:"},{"line_number":1956,"context_line":"                            layer[\u0027mediaType\u0027] \u003d MEDIA_BLOB_COMPRESSED"},{"line_number":1957,"context_line":"                        elif layer_type \u003d\u003d MEDIA_OCI_LAYER:"},{"line_number":1958,"context_line":"                            layer[\u0027mediaType\u0027] \u003d MEDIA_BLOB"},{"line_number":1959,"context_line":"                        new_layers.append(layer)"},{"line_number":1960,"context_line":"                    manifest[\u0027layers\u0027] \u003d new_layers"},{"line_number":1961,"context_line":"            elif manifest_type \u003d\u003d MEDIA_CONFIG:"}],"source_content_type":"text/x-python","patch_set":3,"id":"f4d8660f_b6275451","line":1958,"range":{"start_line":1955,"start_character":0,"end_line":1958,"end_character":59},"in_reply_to":"a192f50d_91a23738","updated":"2021-09-22 14:01:32.000000000","message":"I could follow up with checking layer validity but I don\u0027t think it\u0027s something we necessarily want to handle at this time and is definitely not part of this patch.","commit_id":"13605c924ce9bfe641c2fffecd4f0ab943ee0c8f"},{"author":{"_account_id":14985,"name":"Alex Schultz","email":"aschultz@next-development.com","username":"mwhahaha"},"change_message_id":"1900e7aabc21ab6c56fee3091a358a270215567d","unresolved":true,"context_lines":[{"line_number":1952,"context_line":"                    new_layers \u003d []"},{"line_number":1953,"context_line":"                    for layer in layers:"},{"line_number":1954,"context_line":"                        layer_type \u003d layer.get(\u0027mediaType\u0027)"},{"line_number":1955,"context_line":"                        if layer_type \u003d\u003d MEDIA_OCI_LAYER_COMPRESSED:"},{"line_number":1956,"context_line":"                            layer[\u0027mediaType\u0027] \u003d MEDIA_BLOB_COMPRESSED"},{"line_number":1957,"context_line":"                        elif layer_type \u003d\u003d MEDIA_OCI_LAYER:"},{"line_number":1958,"context_line":"                            layer[\u0027mediaType\u0027] \u003d MEDIA_BLOB"},{"line_number":1959,"context_line":"                        new_layers.append(layer)"},{"line_number":1960,"context_line":"                    manifest[\u0027layers\u0027] \u003d new_layers"},{"line_number":1961,"context_line":"            elif manifest_type \u003d\u003d MEDIA_CONFIG:"}],"source_content_type":"text/x-python","patch_set":3,"id":"a192f50d_91a23738","line":1958,"range":{"start_line":1955,"start_character":0,"end_line":1958,"end_character":59},"in_reply_to":"a729f01f_8a73af68","updated":"2021-09-22 13:13:58.000000000","message":"This is to prevent regression based on previous logic.  The unit tests break because we actually don\u0027t provide a media type so we\u0027d be putting one in if none was provided. In order to prevent possible breakages, we don\u0027t want to force some incorrect logic. So this only handles if it\u0027s specified rather than always putting something in.","commit_id":"13605c924ce9bfe641c2fffecd4f0ab943ee0c8f"},{"author":{"_account_id":6926,"name":"Bogdan Dobrelya","email":"bdobreli@redhat.com","username":"bogdando"},"change_message_id":"e191cd5efb366eb7a8449ba68196252f3838f967","unresolved":true,"context_lines":[{"line_number":1952,"context_line":"                    new_layers \u003d []"},{"line_number":1953,"context_line":"                    for layer in layers:"},{"line_number":1954,"context_line":"                        layer_type \u003d layer.get(\u0027mediaType\u0027)"},{"line_number":1955,"context_line":"                        if layer_type \u003d\u003d MEDIA_OCI_LAYER_COMPRESSED:"},{"line_number":1956,"context_line":"                            layer[\u0027mediaType\u0027] \u003d MEDIA_BLOB_COMPRESSED"},{"line_number":1957,"context_line":"                        elif layer_type \u003d\u003d MEDIA_OCI_LAYER:"},{"line_number":1958,"context_line":"                            layer[\u0027mediaType\u0027] \u003d MEDIA_BLOB"},{"line_number":1959,"context_line":"                        new_layers.append(layer)"},{"line_number":1960,"context_line":"                    manifest[\u0027layers\u0027] \u003d new_layers"},{"line_number":1961,"context_line":"            elif manifest_type \u003d\u003d MEDIA_CONFIG:"}],"source_content_type":"text/x-python","patch_set":3,"id":"a729f01f_8a73af68","line":1958,"range":{"start_line":1955,"start_character":0,"end_line":1958,"end_character":59},"in_reply_to":"cc626dd7_8da3c674","updated":"2021-09-22 09:36:56.000000000","message":"or if that\u0027s expected to reduce layers by that conversion, please make sure those removed get invalidated in the global layers cache as well","commit_id":"13605c924ce9bfe641c2fffecd4f0ab943ee0c8f"},{"author":{"_account_id":6926,"name":"Bogdan Dobrelya","email":"bdobreli@redhat.com","username":"bogdando"},"change_message_id":"6bd9d7e6a394eba2c173add74e3b3d3c70e304db","unresolved":true,"context_lines":[{"line_number":1962,"context_line":"                manifest_type \u003d MEDIA_MANIFEST_V2"},{"line_number":1963,"context_line":"            elif manifest_type \u003d\u003d MEDIA_OCI_INDEX_V1:"},{"line_number":1964,"context_line":"                manifest_type \u003d MEDIA_MANIFEST_V2_LIST"},{"line_number":1965,"context_line":"            manifest[\u0027mediaType\u0027] \u003d manifest_type"},{"line_number":1966,"context_line":"            manifest_str \u003d json.dumps(manifest, indent\u003d3)"},{"line_number":1967,"context_line":""},{"line_number":1968,"context_line":"        export \u003d target_url.netloc in cls.export_registries"}],"source_content_type":"text/x-python","patch_set":3,"id":"787468bf_d75e9d46","line":1965,"updated":"2021-09-22 09:32:35.000000000","message":"so here we\u0027ll have a two different mediaTypes set in two places: {\u0027mediaType\u0027: manifest_type, {\u0027config\u0027: {\u0027mediaType\u0027: MEDIA_CONFIG}}}\n\nand the former always wins, while the latter always loses by the future lookups:\n\nmanifest.get(\u0027mediaType\u0027, manifest.get(\u0027config\u0027,{}).get(\u0027mediaType\u0027))\n\nI hope that is expected","commit_id":"13605c924ce9bfe641c2fffecd4f0ab943ee0c8f"},{"author":{"_account_id":14985,"name":"Alex Schultz","email":"aschultz@next-development.com","username":"mwhahaha"},"change_message_id":"b93c457719ef37faf3aa0633e4b2f476cb26a00a","unresolved":true,"context_lines":[{"line_number":1962,"context_line":"                manifest_type \u003d MEDIA_MANIFEST_V2"},{"line_number":1963,"context_line":"            elif manifest_type \u003d\u003d MEDIA_OCI_INDEX_V1:"},{"line_number":1964,"context_line":"                manifest_type \u003d MEDIA_MANIFEST_V2_LIST"},{"line_number":1965,"context_line":"            manifest[\u0027mediaType\u0027] \u003d manifest_type"},{"line_number":1966,"context_line":"            manifest_str \u003d json.dumps(manifest, indent\u003d3)"},{"line_number":1967,"context_line":""},{"line_number":1968,"context_line":"        export \u003d target_url.netloc in cls.export_registries"}],"source_content_type":"text/x-python","patch_set":3,"id":"79b21d9a_c48203eb","line":1965,"in_reply_to":"74d04e4a_76a67fee","updated":"2021-09-22 14:01:32.000000000","message":"https://github.com/opencontainers/image-spec/blob/main/manifest.md#image-manifest-property-descriptions","commit_id":"13605c924ce9bfe641c2fffecd4f0ab943ee0c8f"},{"author":{"_account_id":14985,"name":"Alex Schultz","email":"aschultz@next-development.com","username":"mwhahaha"},"change_message_id":"1900e7aabc21ab6c56fee3091a358a270215567d","unresolved":true,"context_lines":[{"line_number":1962,"context_line":"                manifest_type \u003d MEDIA_MANIFEST_V2"},{"line_number":1963,"context_line":"            elif manifest_type \u003d\u003d MEDIA_OCI_INDEX_V1:"},{"line_number":1964,"context_line":"                manifest_type \u003d MEDIA_MANIFEST_V2_LIST"},{"line_number":1965,"context_line":"            manifest[\u0027mediaType\u0027] \u003d manifest_type"},{"line_number":1966,"context_line":"            manifest_str \u003d json.dumps(manifest, indent\u003d3)"},{"line_number":1967,"context_line":""},{"line_number":1968,"context_line":"        export \u003d target_url.netloc in cls.export_registries"}],"source_content_type":"text/x-python","patch_set":3,"id":"74d04e4a_76a67fee","line":1965,"in_reply_to":"787468bf_d75e9d46","updated":"2021-09-22 13:13:58.000000000","message":"If you look at the docker spec vs oci, the oci doesn\u0027t have a top level mediaType. If not specified it\u0027s techincally OCi but to make sure it\u0027s oci we are also checking the config mediaType which will differ from the toplevel one.\n\n{\n  \"schemaVersion\": 2,\n  \"mediaType\": \"application/vnd.docker.distribution.manifest.v2+json\",\n  \"config\": {\n    \"mediaType\": \"application/vnd.docker.container.image.v1+json\",\n    \"size\": 3913,\n    \"digest\": \"sha256:d93240b8f6d1a0e58dc6a8f3eb6e656fab91bacc6d2308985e74939c0821e603\"\n  },\n  \"layers\": [\n   ...\n}\n\n\nvs \n\n{\n  \"schemaVersion\": 2,\n  \"config\": {\n    \"mediaType\": \"application/vnd.oci.image.config.v1+json\",\n    \"digest\": \"sha256:3a3f74d0ebe3c4723a06718a5b7c3f7c8ffb5b2967aa5e9200852c8a269bdc9b\",\n    \"size\": 3877\n  },\n  \"layers\": [\n  ...\n}\n\nTechnically i think the OCI manifest can have an item at the top level however it seems in practice i may not.  We\u0027re being safe here.","commit_id":"13605c924ce9bfe641c2fffecd4f0ab943ee0c8f"}]}
