)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"59abbe1930ca4b8e2d11a76aeb6753eaf7da5678","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"[placement] Clean up TODOs in allocations.yaml gabbit"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"With the avent of gabbi 1.35.0 (already in test-requirements),"},{"line_number":10,"context_line":"subtitutions in the left hand side of a json path check are now allowed."},{"line_number":11,"context_line":"allocations.yaml had two TODOs related to this which this change fixes."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"ff82abbf_5cfd006c","line":9,"range":{"start_line":9,"start_character":9,"end_line":9,"end_character":14},"updated":"2017-11-28 04:39:31.000000000","message":"advent?","commit_id":"2948ca86fe6619ca114bba198b3c88a2d982edb0"}],"nova/tests/functional/api/openstack/placement/gabbits/allocations.yaml":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"570e2aa5ac395ba1fc0efae2db7310bd8d1a8ef3","unresolved":false,"context_lines":[{"line_number":268,"context_line":"      $.allocations[\u0027833f0885-f78c-4788-bb2b-3607b0656be7\u0027].resources.DISK_GB: 20"},{"line_number":269,"context_line":"      $.allocations[\u0027833f0885-f78c-4788-bb2b-3607b0656be7\u0027].resources.VCPU: 4"},{"line_number":270,"context_line":"      $.allocations[\u0027599ffd2d-526a-4b2e-8683-f13ad25f9958\u0027].resources.DISK_GB: 10"},{"line_number":271,"context_line":"      $.allocations[\u002739715579-2167-4c63-8247-301311cc6703\u0027].resources.DISK_GB: 10"},{"line_number":272,"context_line":""},{"line_number":273,"context_line":"- name: confirm 404 for allocations of bad resource provider"},{"line_number":274,"context_line":"  GET: /resource_providers/cb8a3007-b93a-471f-9e1f-4d58355678bd/allocations"}],"source_content_type":"text/x-yaml","patch_set":2,"id":"3f4b6375_12fa8d41","line":271,"updated":"2017-10-19 11:00:04.000000000","message":"this is what the output of the below looks like","commit_id":"f97ad9acefe818c4c46b88115b0600893251c328"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"bdc0e360e74268c0f72eabddf86a4e3b95200a99","unresolved":false,"context_lines":[{"line_number":279,"context_line":"- name: check allocations by consumer id"},{"line_number":280,"context_line":"  GET: /allocations/833f0885-f78c-4788-bb2b-3607b0656be7"},{"line_number":281,"context_line":"  response_json_paths:"},{"line_number":282,"context_line":"      $.allocations[\u0027$ENVIRON[\u0027RP_UUID\u0027]\u0027].generation: 7"},{"line_number":283,"context_line":"      $.allocations[\u0027$ENVIRON[\u0027RP_UUID\u0027]\u0027].resources.DISK_GB: 20"},{"line_number":284,"context_line":"      $.allocations[\u0027$ENVIRON[\u0027RP_UUID\u0027]\u0027].resources.VCPU: 4"},{"line_number":285,"context_line":""}],"source_content_type":"text/x-yaml","patch_set":2,"id":"3f4b6375_20dae516","line":282,"updated":"2017-10-18 21:39:36.000000000","message":"These look weird to me, but I\u0027m definitely no gabbi expert.  Is there a dot missing between \u0027allocations\u0027 and the new stuff?  What\u0027s with the extra single quotes?","commit_id":"f97ad9acefe818c4c46b88115b0600893251c328"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"10955c3043975e23af5a9ba66a380120d7ebdcda","unresolved":false,"context_lines":[{"line_number":279,"context_line":"- name: check allocations by consumer id"},{"line_number":280,"context_line":"  GET: /allocations/833f0885-f78c-4788-bb2b-3607b0656be7"},{"line_number":281,"context_line":"  response_json_paths:"},{"line_number":282,"context_line":"      $.allocations[\u0027$ENVIRON[\u0027RP_UUID\u0027]\u0027].generation: 7"},{"line_number":283,"context_line":"      $.allocations[\u0027$ENVIRON[\u0027RP_UUID\u0027]\u0027].resources.DISK_GB: 20"},{"line_number":284,"context_line":"      $.allocations[\u0027$ENVIRON[\u0027RP_UUID\u0027]\u0027].resources.VCPU: 4"},{"line_number":285,"context_line":""}],"source_content_type":"text/x-yaml","patch_set":2,"id":"3f4b6375_e0c60d17","line":282,"in_reply_to":"3f4b6375_20dae516","updated":"2017-10-18 21:46:56.000000000","message":"It is bizarre but necessary with some kinds of substitutions. See https://gabbi.readthedocs.io/en/latest/jsonpath.html#substitution for a bit more info. I can comment with that or put it in the commit message (tomorrow) if you think that\u0027s a good plan.\n\nWhen [] is used in a json path expression, the \u0027.\u0027 are optional. I left the trailing one in in this case because that pattern is used elsewhere in this same file and I figured may as well be consistent.\n\nI find it slightly easier to read too.\n\nThe json path parser is tweaky (it\u0027s a third party library that gabbi uses), unfortunately, and there are lots of slightly different ways to express the same thing.","commit_id":"f97ad9acefe818c4c46b88115b0600893251c328"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"6adae87e301340846397a257b77dd1e7b8f818c3","unresolved":false,"context_lines":[{"line_number":279,"context_line":"- name: check allocations by consumer id"},{"line_number":280,"context_line":"  GET: /allocations/833f0885-f78c-4788-bb2b-3607b0656be7"},{"line_number":281,"context_line":"  response_json_paths:"},{"line_number":282,"context_line":"      $.allocations[\u0027$ENVIRON[\u0027RP_UUID\u0027]\u0027].generation: 7"},{"line_number":283,"context_line":"      $.allocations[\u0027$ENVIRON[\u0027RP_UUID\u0027]\u0027].resources.DISK_GB: 20"},{"line_number":284,"context_line":"      $.allocations[\u0027$ENVIRON[\u0027RP_UUID\u0027]\u0027].resources.VCPU: 4"},{"line_number":285,"context_line":""}],"source_content_type":"text/x-yaml","patch_set":2,"id":"3f4b6375_8845301a","line":282,"in_reply_to":"3f4b6375_32ab491e","updated":"2017-10-19 11:58:34.000000000","message":"Thanks for explaining all of that.","commit_id":"f97ad9acefe818c4c46b88115b0600893251c328"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"b7328feec419d28a52c68d98bb9c6048ec20cc4d","unresolved":false,"context_lines":[{"line_number":279,"context_line":"- name: check allocations by consumer id"},{"line_number":280,"context_line":"  GET: /allocations/833f0885-f78c-4788-bb2b-3607b0656be7"},{"line_number":281,"context_line":"  response_json_paths:"},{"line_number":282,"context_line":"      $.allocations[\u0027$ENVIRON[\u0027RP_UUID\u0027]\u0027].generation: 7"},{"line_number":283,"context_line":"      $.allocations[\u0027$ENVIRON[\u0027RP_UUID\u0027]\u0027].resources.DISK_GB: 20"},{"line_number":284,"context_line":"      $.allocations[\u0027$ENVIRON[\u0027RP_UUID\u0027]\u0027].resources.VCPU: 4"},{"line_number":285,"context_line":""}],"source_content_type":"text/x-yaml","patch_set":2,"id":"3f4b6375_f35025d7","line":282,"in_reply_to":"3f4b6375_b3886d71","updated":"2017-10-18 22:09:24.000000000","message":"Hey, here\u0027s another idea: would it work to say\n\n $[\".allocations.$ENVIRON[\u0027RP_UUID\u0027].generation\"]: 7\n\n?\n\nQuoting the whole thing makes it a bit more readable IMO.","commit_id":"f97ad9acefe818c4c46b88115b0600893251c328"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"5436836d87e88e3bb3da82e8fc43d92f36cd5ed7","unresolved":false,"context_lines":[{"line_number":279,"context_line":"- name: check allocations by consumer id"},{"line_number":280,"context_line":"  GET: /allocations/833f0885-f78c-4788-bb2b-3607b0656be7"},{"line_number":281,"context_line":"  response_json_paths:"},{"line_number":282,"context_line":"      $.allocations[\u0027$ENVIRON[\u0027RP_UUID\u0027]\u0027].generation: 7"},{"line_number":283,"context_line":"      $.allocations[\u0027$ENVIRON[\u0027RP_UUID\u0027]\u0027].resources.DISK_GB: 20"},{"line_number":284,"context_line":"      $.allocations[\u0027$ENVIRON[\u0027RP_UUID\u0027]\u0027].resources.VCPU: 4"},{"line_number":285,"context_line":""}],"source_content_type":"text/x-yaml","patch_set":2,"id":"3f4b6375_b3886d71","line":282,"in_reply_to":"3f4b6375_e0c60d17","updated":"2017-10-18 22:04:20.000000000","message":"Yeesh.\n\nI guess I shouldn\u0027t be surprised, being used to the five-alternating-quotes thing in bash [1].\n\nThe gabbi doc you referenced would sure benefit from just one more line showing how the example would render.  Is that something we have visibility to?\n\nIn this case, does it render as e.g.:\n\n .allocations\u0027833f0885-f78c-4788-bb2b-3607b0656be7\u0027.generation\n\n?\n\nSo if I\u0027m suggesting \"improvements\" (minimal though they may be):\n- If the extra period doesn\u0027t hurt, include it.  It makes my brain hurt to think that .allocations\u0027uuid...\u0027.generation would match just as well as .allocations.\u0027uuid...\u0027.generation\n- Use double quotes for the outer ones?\n\nBut you could also leave it alone.\n\n[1] https://stackoverflow.com/questions/1250079/how-to-escape-single-quotes-within-single-quoted-strings","commit_id":"f97ad9acefe818c4c46b88115b0600893251c328"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"570e2aa5ac395ba1fc0efae2db7310bd8d1a8ef3","unresolved":false,"context_lines":[{"line_number":279,"context_line":"- name: check allocations by consumer id"},{"line_number":280,"context_line":"  GET: /allocations/833f0885-f78c-4788-bb2b-3607b0656be7"},{"line_number":281,"context_line":"  response_json_paths:"},{"line_number":282,"context_line":"      $.allocations[\u0027$ENVIRON[\u0027RP_UUID\u0027]\u0027].generation: 7"},{"line_number":283,"context_line":"      $.allocations[\u0027$ENVIRON[\u0027RP_UUID\u0027]\u0027].resources.DISK_GB: 20"},{"line_number":284,"context_line":"      $.allocations[\u0027$ENVIRON[\u0027RP_UUID\u0027]\u0027].resources.VCPU: 4"},{"line_number":285,"context_line":""}],"source_content_type":"text/x-yaml","patch_set":2,"id":"3f4b6375_32ab491e","line":282,"in_reply_to":"3f4b6375_f35025d7","updated":"2017-10-19 11:00:04.000000000","message":"Part of the complexity here is we\u0027re going through three layers of transformation:\n\n* First we\u0027ve got yaml, where quotes can be parse as matched pairs so \u0027foo \u0027bar\u0027 zap\u0027 is a string containing a quoted string. I\u0027ll fix that lack of clarity by using \"\" for one of the quotes. The [ and ] have nothing to do with the YAML.\n* gabbi gets the literal string: $.allocations[\u0027$ENVIRON[\u0027RP_UUID\u0027]\u0027].generation as the key of a dict\n* next it matches on $ENVIRON and does that substitutions[1] and we end up with: $.allocations[\u0027ad84701f-1a2c-4e46-a9ba-35e6176f5f00\n\u0027].generation\n* that becomes the JSON path\n* There an attribute on an object is identified in one of two ways, directory, or bounded by [ ]\n* so with simple strings you can have $.allocations.foobar.generation\n* however if there are numerals in the string, and there are arithmetic operators it can be parsed as a numeric expression, quoting it overcomes this\n\nThus\n\n    $[\".allocations.$ENVIRON[\u0027RP_UUID\u0027].generation\"]\n\nwould not work as that\u0027s not valid JSON path syntax at least as far as I know.\n\nI\u0027ll adjust the quoting\n\n[1] https://gabbi.readthedocs.io/en/latest/format.html#substitution","commit_id":"f97ad9acefe818c4c46b88115b0600893251c328"}]}
