)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9041eab869a582a1f2a596c6f3a453353ad25ce1","unresolved":false,"context_lines":[{"line_number":10,"context_line":"Nova returned a list of correct choices, but the href link"},{"line_number":11,"context_line":"is incorrect. This is due to that Nova treated words in url"},{"line_number":12,"context_line":"after localhost:port/ to be the \u0027path\u0027 and it was joined"},{"line_number":13,"context_line":"with the base_url. When depoly with uwsgi or wrong version"},{"line_number":14,"context_line":"info was provided, those words will be duplicated in the"},{"line_number":15,"context_line":"returned herf field."},{"line_number":16,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"ff346bd7_d2f4ce89","line":13,"range":{"start_line":13,"start_character":24,"end_line":13,"end_character":30},"updated":"2017-07-25 13:43:30.000000000","message":"deploy","commit_id":"21d755075ea5c0dce9a4aed0c395a46a525779d1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9041eab869a582a1f2a596c6f3a453353ad25ce1","unresolved":false,"context_lines":[{"line_number":12,"context_line":"after localhost:port/ to be the \u0027path\u0027 and it was joined"},{"line_number":13,"context_line":"with the base_url. When depoly with uwsgi or wrong version"},{"line_number":14,"context_line":"info was provided, those words will be duplicated in the"},{"line_number":15,"context_line":"returned herf field."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"This patch strip the \u0027compute\u0027 and version info from the"},{"line_number":18,"context_line":"path when build href."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"ff346bd7_b2f38a9e","line":15,"range":{"start_line":15,"start_character":9,"end_line":15,"end_character":13},"updated":"2017-07-25 13:43:30.000000000","message":"href","commit_id":"21d755075ea5c0dce9a4aed0c395a46a525779d1"}],"nova/api/openstack/compute/views/versions.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9041eab869a582a1f2a596c6f3a453353ad25ce1","unresolved":false,"context_lines":[{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    def _strip_invalid_url_prefix_from_path(self, path):"},{"line_number":88,"context_line":"        \"\"\"Strip the compute and version prefix in path, as"},{"line_number":89,"context_line":"        they will be latter joined using url_join."},{"line_number":90,"context_line":"        \"\"\""},{"line_number":91,"context_line":"        if path:"},{"line_number":92,"context_line":"            path \u003d path.split(\u0027/\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff346bd7_32355a47","line":89,"range":{"start_line":89,"start_character":21,"end_line":89,"end_character":27},"updated":"2017-07-25 13:43:30.000000000","message":"later","commit_id":"21d755075ea5c0dce9a4aed0c395a46a525779d1"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"40c7f523cb21d6b6b9894c99639c5e261c1bc21b","unresolved":false,"context_lines":[{"line_number":90,"context_line":"        \"\"\""},{"line_number":91,"context_line":"        if path:"},{"line_number":92,"context_line":"            path \u003d path.split(\u0027/\u0027)"},{"line_number":93,"context_line":"            if path[1] \u003d\u003d \u0027compute\u0027:"},{"line_number":94,"context_line":"                del path[1]"},{"line_number":95,"context_line":"            if path[1].lower().startswith(\u0027v\u0027):"},{"line_number":96,"context_line":"                if len(path[1]) \u003e 1 and path[1][1].isdigit():"}],"source_content_type":"text/x-python","patch_set":5,"id":"ff346bd7_9d4bdd29","line":93,"range":{"start_line":93,"start_character":27,"end_line":93,"end_character":34},"updated":"2017-07-26 06:33:40.000000000","message":"This sounds a hardcode. People may deploy the nova api under any URL.","commit_id":"1f745ce10c1e90fca769d14bf12679bcedf8db83"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"010b19e7ab967fa485a3faf4f99e652be42b956f","unresolved":false,"context_lines":[{"line_number":90,"context_line":"        \"\"\""},{"line_number":91,"context_line":"        if path:"},{"line_number":92,"context_line":"            path \u003d path.split(\u0027/\u0027)"},{"line_number":93,"context_line":"            if path[1] \u003d\u003d \u0027compute\u0027:"},{"line_number":94,"context_line":"                del path[1]"},{"line_number":95,"context_line":"            if path[1].lower().startswith(\u0027v\u0027):"},{"line_number":96,"context_line":"                if len(path[1]) \u003e 1 and path[1][1].isdigit():"}],"source_content_type":"text/x-python","patch_set":5,"id":"ff346bd7_6351b662","line":93,"range":{"start_line":93,"start_character":27,"end_line":93,"end_character":34},"in_reply_to":"ff346bd7_7d3a7934","updated":"2017-07-26 07:50:56.000000000","message":"yes, this is not right always. it can be anything","commit_id":"1f745ce10c1e90fca769d14bf12679bcedf8db83"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"9cb57e1c6c6efd3499a1339657e3d1bcd85b0471","unresolved":false,"context_lines":[{"line_number":90,"context_line":"        \"\"\""},{"line_number":91,"context_line":"        if path:"},{"line_number":92,"context_line":"            path \u003d path.split(\u0027/\u0027)"},{"line_number":93,"context_line":"            if path[1] \u003d\u003d \u0027compute\u0027:"},{"line_number":94,"context_line":"                del path[1]"},{"line_number":95,"context_line":"            if path[1].lower().startswith(\u0027v\u0027):"},{"line_number":96,"context_line":"                if len(path[1]) \u003e 1 and path[1][1].isdigit():"}],"source_content_type":"text/x-python","patch_set":5,"id":"ff346bd7_7d3a7934","line":93,"range":{"start_line":93,"start_character":27,"end_line":93,"end_character":34},"in_reply_to":"ff346bd7_9d4bdd29","updated":"2017-07-26 06:46:11.000000000","message":"really, didn\u0027t know that, if that is the case, I guess we have to read the base_url here.","commit_id":"1f745ce10c1e90fca769d14bf12679bcedf8db83"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"305e77f7d006ddca01da9f14e33b5f4345fa7aff","unresolved":false,"context_lines":[{"line_number":40,"context_line":"                \"links\": ["},{"line_number":41,"context_line":"                    {"},{"line_number":42,"context_line":"                        \"rel\": \"self\","},{"line_number":43,"context_line":"                        \"href\": self.generate_href(version[\u0027id\u0027], req.path),"},{"line_number":44,"context_line":"                    },"},{"line_number":45,"context_line":"                ],"},{"line_number":46,"context_line":"                \"media-types\": version[\u0027media-types\u0027],"}],"source_content_type":"text/x-python","patch_set":6,"id":"ff346bd7_c300626a","line":43,"range":{"start_line":43,"start_character":66,"end_line":43,"end_character":74},"updated":"2017-07-26 07:47:02.000000000","message":"@Kevin, maybe we should try req.environ[\u0027PATH_INFO\u0027] https://www.python.org/dev/peps/pep-0333/#environ-variables","commit_id":"13d6370798d894b78096665b4aeaf0934d05cf34"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"5ffac87a7067ef8561f7eb3a2ffb56af27739968","unresolved":false,"context_lines":[{"line_number":40,"context_line":"                \"links\": ["},{"line_number":41,"context_line":"                    {"},{"line_number":42,"context_line":"                        \"rel\": \"self\","},{"line_number":43,"context_line":"                        \"href\": self.generate_href(version[\u0027id\u0027], req.path),"},{"line_number":44,"context_line":"                    },"},{"line_number":45,"context_line":"                ],"},{"line_number":46,"context_line":"                \"media-types\": version[\u0027media-types\u0027],"}],"source_content_type":"text/x-python","patch_set":6,"id":"5f7c97a3_92f9ed1d","line":43,"range":{"start_line":43,"start_character":66,"end_line":43,"end_character":74},"in_reply_to":"ff346bd7_23f96e4c","updated":"2018-07-11 08:24:40.000000000","message":"Yea, I think we can use req.environ[\u0027PATH_INFO\u0027] to get the request URL without the application virtual location. And we strip the wrong version part in the beginning of URL, instead of it with correct version.","commit_id":"13d6370798d894b78096665b4aeaf0934d05cf34"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"0be16b579cd7f1279e7794739124ff57bf163a6e","unresolved":false,"context_lines":[{"line_number":40,"context_line":"                \"links\": ["},{"line_number":41,"context_line":"                    {"},{"line_number":42,"context_line":"                        \"rel\": \"self\","},{"line_number":43,"context_line":"                        \"href\": self.generate_href(version[\u0027id\u0027], req.path),"},{"line_number":44,"context_line":"                    },"},{"line_number":45,"context_line":"                ],"},{"line_number":46,"context_line":"                \"media-types\": version[\u0027media-types\u0027],"}],"source_content_type":"text/x-python","patch_set":6,"id":"ff346bd7_23f96e4c","line":43,"range":{"start_line":43,"start_character":66,"end_line":43,"end_character":74},"in_reply_to":"ff346bd7_4377d203","updated":"2017-07-26 07:53:55.000000000","message":"That was my initial plan, but check this test:\nhttp://git.openstack.org/cgit/openstack/nova/tree/nova/tests/unit/api/openstack/compute/test_versions.py#n203\nlooks like we want to provide correct href like this.","commit_id":"13d6370798d894b78096665b4aeaf0934d05cf34"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"0d5a5d26839224053d01297833954348d48ab790","unresolved":false,"context_lines":[{"line_number":40,"context_line":"                \"links\": ["},{"line_number":41,"context_line":"                    {"},{"line_number":42,"context_line":"                        \"rel\": \"self\","},{"line_number":43,"context_line":"                        \"href\": self.generate_href(version[\u0027id\u0027], req.path),"},{"line_number":44,"context_line":"                    },"},{"line_number":45,"context_line":"                ],"},{"line_number":46,"context_line":"                \"media-types\": version[\u0027media-types\u0027],"}],"source_content_type":"text/x-python","patch_set":6,"id":"ff346bd7_4377d203","line":43,"range":{"start_line":43,"start_character":66,"end_line":43,"end_character":74},"in_reply_to":"ff346bd7_c300626a","updated":"2017-07-26 07:50:24.000000000","message":"Why do not we just provide the href with self.prefix + version only ?\n\ni mean not to pass req.path here","commit_id":"13d6370798d894b78096665b4aeaf0934d05cf34"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"5ffac87a7067ef8561f7eb3a2ffb56af27739968","unresolved":false,"context_lines":[{"line_number":96,"context_line":"            if path[1].lower().startswith(\u0027v\u0027):"},{"line_number":97,"context_line":"                if len(path[1]) \u003e 1 and path[1][1].isdigit():"},{"line_number":98,"context_line":"                    del path[1]"},{"line_number":99,"context_line":"            path \u003d \u0027/\u0027.join(path)"},{"line_number":100,"context_line":"        else:"},{"line_number":101,"context_line":"            path \u003d \u0027\u0027"},{"line_number":102,"context_line":"        return path"}],"source_content_type":"text/x-python","patch_set":6,"id":"5f7c97a3_f2138158","line":99,"updated":"2018-07-11 08:24:40.000000000","message":"This looks too hacky for me.","commit_id":"13d6370798d894b78096665b4aeaf0934d05cf34"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"4645b3d050eba81c32555d98660fd85394067ae3","unresolved":false,"context_lines":[{"line_number":93,"context_line":"        else:"},{"line_number":94,"context_line":"            version_number \u003d \u0027v2\u0027"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"        if path and path.startswith(\u0027/v\u0027):"},{"line_number":97,"context_line":"            path \u003d re.sub(\u0027\\/v[^\\/]*\\/\u0027, \u0027/\u0027, path, count\u003d1)"},{"line_number":98,"context_line":"        path \u003d path or \u0027\u0027"},{"line_number":99,"context_line":"        return common.url_join(self.prefix, version_number, path)"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_538b8cc1","line":97,"range":{"start_line":96,"start_character":8,"end_line":97,"end_character":60},"updated":"2018-08-15 02:46:30.000000000","message":"I prefer to move this a standalone method. And calling that method out of generate_href() method. We pass a patch which already strip the invalid version.\n\nAnd we better to have comment to explain what is the code doing, and a ref to the original bug.","commit_id":"2cfd34677f536c0183acc34eb35196f5b446197b"}],"nova/tests/unit/api/openstack/compute/test_versions.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9041eab869a582a1f2a596c6f3a453353ad25ce1","unresolved":false,"context_lines":[{"line_number":300,"context_line":"            },"},{"line_number":301,"context_line":"        ], }"},{"line_number":302,"context_line":""},{"line_number":303,"context_line":"        self.assertThat(jsonutils.loads(res.body),"},{"line_number":304,"context_line":"                        matchers.DictMatches(expected))"},{"line_number":305,"context_line":""},{"line_number":306,"context_line":"    def test_multi_choice_server_atom(self):"},{"line_number":307,"context_line":"        \"\"\"Make sure multi choice responses do not have content-type"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff346bd7_72c76214","line":304,"range":{"start_line":303,"start_character":8,"end_line":304,"end_character":55},"updated":"2017-07-25 13:43:30.000000000","message":"Seems simpler to just use:\n\nself.assertDictEqual(expected, jsonutils.loads(res.body))","commit_id":"21d755075ea5c0dce9a4aed0c395a46a525779d1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"283265b2aac28b63555bbc661af86d016ceab92e","unresolved":false,"context_lines":[{"line_number":300,"context_line":"            },"},{"line_number":301,"context_line":"        ], }"},{"line_number":302,"context_line":""},{"line_number":303,"context_line":"        self.assertThat(jsonutils.loads(res.body),"},{"line_number":304,"context_line":"                        matchers.DictMatches(expected))"},{"line_number":305,"context_line":""},{"line_number":306,"context_line":"    def test_multi_choice_server_atom(self):"},{"line_number":307,"context_line":"        \"\"\"Make sure multi choice responses do not have content-type"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff346bd7_a24d7573","line":304,"range":{"start_line":303,"start_character":8,"end_line":304,"end_character":55},"in_reply_to":"ff346bd7_72c76214","updated":"2017-07-25 14:37:27.000000000","message":"Actually the output that DictMatches gives is nicer when there is a failure, so let\u0027s just keep using that.","commit_id":"21d755075ea5c0dce9a4aed0c395a46a525779d1"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"4645b3d050eba81c32555d98660fd85394067ae3","unresolved":false,"context_lines":[{"line_number":256,"context_line":"        \"\"\""},{"line_number":257,"context_line":"        # When deploy using uwsgi, the base_url contains \u0027compute\u0027."},{"line_number":258,"context_line":"        req \u003d fakes.HTTPRequest.blank("},{"line_number":259,"context_line":"            \u0027/v2.0/images/1\u0027, base_url\u003d\u0027http://localhost/compute\u0027)"},{"line_number":260,"context_line":"        req.accept \u003d \"application/json\""},{"line_number":261,"context_line":"        res \u003d req.get_response(self.wsgi_app)"},{"line_number":262,"context_line":"        self.assertEqual(300, res.status_int)"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_b3478077","line":259,"range":{"start_line":259,"start_character":13,"end_line":259,"end_character":27},"updated":"2018-08-15 02:46:30.000000000","message":"good luck we don\u0027t have API called as \u0027/volumes\u0027. That will be stripped. So maybe we need more improvement.","commit_id":"2cfd34677f536c0183acc34eb35196f5b446197b"}]}
