)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"b0c73469bfb7e4a3a29cb17b8b48c9184fe65aa3","unresolved":true,"context_lines":[{"line_number":12,"context_line":"When we try to generate code for various tools query parameters are"},{"line_number":13,"context_line":"becoming a tricky point due to absence of pretty much any information"},{"line_number":14,"context_line":"right now. We can try to make it working for us by:"},{"line_number":15,"context_line":"- use \"x-\" extension of the OpenAPI schema that allows us adding extra"},{"line_number":16,"context_line":"  information in various places like \"x-min-microversion\","},{"line_number":17,"context_line":"  \"x-max_microversion\""},{"line_number":18,"context_line":"- since in OpenAPI url+method build the unique identifier of the"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"10cf8f0a_9f9850a0","line":15,"range":{"start_line":15,"start_character":7,"end_line":15,"end_character":9},"updated":"2023-08-25 10:03:26.000000000","message":"Can we prefix everything with `x-openstack-` instead of just `x-`? Heck, even just `x-os-` would be preferable to avoid conflicts","commit_id":"1afa0006c66becbcc24f46ff3c3f051a18f4c6b2"},{"author":{"_account_id":27900,"name":"Artem Goncharov","email":"artem.goncharov@gmail.com","username":"gtema"},"change_message_id":"ce26bfe1180e65b202e16e99ee842636b02a1791","unresolved":true,"context_lines":[{"line_number":12,"context_line":"When we try to generate code for various tools query parameters are"},{"line_number":13,"context_line":"becoming a tricky point due to absence of pretty much any information"},{"line_number":14,"context_line":"right now. We can try to make it working for us by:"},{"line_number":15,"context_line":"- use \"x-\" extension of the OpenAPI schema that allows us adding extra"},{"line_number":16,"context_line":"  information in various places like \"x-min-microversion\","},{"line_number":17,"context_line":"  \"x-max_microversion\""},{"line_number":18,"context_line":"- since in OpenAPI url+method build the unique identifier of the"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"70dea177_ab30a5cd","line":15,"range":{"start_line":15,"start_character":7,"end_line":15,"end_character":9},"in_reply_to":"10cf8f0a_9f9850a0","updated":"2023-08-25 10:17:35.000000000","message":"Not a problem at all. Makes totally sense","commit_id":"1afa0006c66becbcc24f46ff3c3f051a18f4c6b2"}],"/PATCHSET_LEVEL":[{"author":{"_account_id":27900,"name":"Artem Goncharov","email":"artem.goncharov@gmail.com","username":"gtema"},"change_message_id":"ba3397dfe7d910f7f9cf41c67a204308e2036d15","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"28202ef4_b28aa41d","updated":"2023-08-22 09:08:32.000000000","message":"the schema is now passing openapi validation","commit_id":"ec1c4953f2797b2ecd3835b3cccf9d8db7664a90"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"b0c73469bfb7e4a3a29cb17b8b48c9184fe65aa3","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"89d3a304_23ae2c3f","updated":"2023-08-25 10:03:26.000000000","message":"This is very cool but I worry about the practicality of such an effort. We have sooo many APIs and ensuring we generate robust API representation while layering on OpenAPI and everything it brings sounds torturous. I need to look through this further...","commit_id":"14cb0924c34b78dac342fea61ad4413da4b6ae7e"},{"author":{"_account_id":27900,"name":"Artem Goncharov","email":"artem.goncharov@gmail.com","username":"gtema"},"change_message_id":"ce26bfe1180e65b202e16e99ee842636b02a1791","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"2c340780_c0e136ce","in_reply_to":"89d3a304_23ae2c3f","updated":"2023-08-25 10:17:35.000000000","message":"Yes, you are right - a lot of work. However:\n- part of the convertor there is also now implementation for schema generation (definitely not the complete, but that can be still used as a help for transition)\n- transition can be done slowly, since now I try to add a new interface and not to tweak the existing one\n- fixing specs can be a great work for students - learning openapi, learning OpenStack apis, messing around, ...\n- this obsoletes another approach with extending resource object, since all the info is natively in openapi\n- something like this is anyway a mandatory requirement to continue with code generation\n- fakes would be even easier with that\n- documenting the API can become a much easier thing and we could have a broad discussion on starting using it widely in the community. Imaging we can use schemas on server side and the client side with no double effort","commit_id":"14cb0924c34b78dac342fea61ad4413da4b6ae7e"},{"author":{"_account_id":27900,"name":"Artem Goncharov","email":"artem.goncharov@gmail.com","username":"gtema"},"change_message_id":"8cc441809289322e5d6bb7a9f5066219cfcab4a3","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":15,"id":"87a14351_775c68b0","updated":"2023-08-28 15:45:41.000000000","message":"review guide:\n\nopenstack/openapi.py - a central wrapper for OpenAPI specs\n\nopenstack/proxy.py - got additional methods to invoke openapi wrapper to perform operation and process result. Same Resource class is reused which just gets all fields from openapi processed response. In future we could rework Resource and get rid of the complexity.\n\nopenstack/\u003cSERVICE\u003e/schemas/**py - openapi specs mostly as independent modules in dict format (generated from current code with some tweaks)\n\nopenstack/\u003cSERVICE\u003e/_proxy.py gets _openapi_specs and _openapi_operations. For supported openapi operations it invokes self.perform_openapi_operation method and processes results","commit_id":"9ef21e604c12d22d5559303c6e9a2389bd1f82ff"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"8caa8c43e7ed5512a0a570158f5c2a5c4c690fa4","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":27,"id":"809b27fb_528996a9","updated":"2023-09-11 11:40:53.000000000","message":"I gave this a thorough look over this weekend. I must admit, I\u0027m really uncomfortable with the idea of adding reams of YAML or JSON to our code base 🙈 Effectively this feels like a proposal to rewrite the SDK yet again, at a point where we\u0027re finally close to achieving 100% API coverage for many services. That by itself is a huge ask but on top of this the chosen solution, OpenAPI, is exactly zero fun to write. I speak from experience having written plenty of it in the past and the fact that we\u0027ve resorted to generating the JSON schemas in the next change from our existing resource definitions suggests you think the same.\n\nThere are a couple of issues with our current `Resource` model and I\u0027d really like to try solve these via improvements to the Python code rather than rewriting SDK again. For example, the main issue we seem to be addressing in this WIP series is that many of our \"action\" APIs (like the server actions API in nova) aren\u0027t currently specified declaratively, meaning we don\u0027t have a definition we can use for generating clients in other languages. Instead of introducing OpenAPI schemas, I\u0027d like to solve this with e.g. a new `Action` class that is similar to the `Resource` class but provides a mechanism for inspecting and pulling out information from the action. Likewise, for the issue with missing type information about `Resource` fields, pydantic provides a good mechanism for declaring type information as well as validation/transformation of types. There\u0027s no reason we couldn\u0027t do something similar here (or even pull pydantic in: the core of v2 is written in Rust iirc, so it\u0027s pretty fast). Crucially, we\u0027d be doing this stuff in Python rather than blobs of YAML and JSON.\n\nI don\u0027t know if you\u0027ve looked at these approaches beyond https://review.opendev.org/c/openstack/openstacksdk/+/884909. I\u0027ve started work on a few things locally but none of them are even close to complete. I figured it was better to start discussing this now though before you go even further down this road. I\u0027m not saying no, but I\u0027d *really* like to explore our other options first before we do this.\n\nPS: If we wanted to add a `to_openapi` function to `Resource` and `Action` (or whatever we settle on), I\u0027d be a-okay with that.","commit_id":"d105b60832748643409320972164d1234bab8a76"}],"openstack/compute/v2/server.py":[{"author":{"_account_id":27900,"name":"Artem Goncharov","email":"artem.goncharov@gmail.com","username":"gtema"},"change_message_id":"634398f948abaf22cfaaddc146997ffd3b34271a","unresolved":true,"context_lines":[{"line_number":51,"context_line":"    _schemas \u003d {\"Servers\": server_list_schema.SCHEMA}"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    # Construct query mappings from OpenAPI schema"},{"line_number":54,"context_line":"    _query_mapping \u003d resource.QueryParameters.from_schema(_schemas[\"Servers\"])"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"    max_microversion \u003d \u00272.91\u0027"},{"line_number":57,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"7fff2e67_bf6edd25","line":54,"updated":"2023-08-22 08:46:50.000000000","message":"We load mapping from schema and existing unittests verify it is still working fine","commit_id":"bc0839f7bf5a8963a01adcbfbac53bf098edce9d"}],"openstack/compute/v2/server_list_schema.py":[{"author":{"_account_id":27900,"name":"Artem Goncharov","email":"artem.goncharov@gmail.com","username":"gtema"},"change_message_id":"8d543851c2a2e64964bdc85e37c203283c70085b","unresolved":true,"context_lines":[{"line_number":14,"context_line":"# ATTENTION: this file is generated by the code generator"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"SERVER_LIST_SCHEMA \u003d {"},{"line_number":17,"context_line":"    \"parameters\": ["},{"line_number":18,"context_line":"        {\"location\": \"query\", \"name\": \"limit\", \"schema\": {\"type\": \"string\"}},"},{"line_number":19,"context_line":"        {\"location\": \"query\", \"name\": \"marker\", \"schema\": {\"type\": \"string\"}},"},{"line_number":20,"context_line":"        {"}],"source_content_type":"text/x-python","patch_set":1,"id":"2572c1f2_5b8e6b2c","line":17,"updated":"2023-08-21 16:23:46.000000000","message":"parameters currently is the only key, but we can add more from OpenAPI side","commit_id":"5778006fe36d35a525d3bca22b42e785c51193b5"},{"author":{"_account_id":27900,"name":"Artem Goncharov","email":"artem.goncharov@gmail.com","username":"gtema"},"change_message_id":"6af0d84034d05d557f0a0c4684fe36a4c5b7894b","unresolved":true,"context_lines":[{"line_number":20,"context_line":"        {"},{"line_number":21,"context_line":"            \"location\": \"query\","},{"line_number":22,"context_line":"            \"name\": \"auto_disk_config\","},{"line_number":23,"context_line":"            \"schema\": {\"type\": \"string\"},"},{"line_number":24,"context_line":"        },"},{"line_number":25,"context_line":"        {"},{"line_number":26,"context_line":"            \"location\": \"query\","}],"source_content_type":"text/x-python","patch_set":1,"id":"36631d97_1486eaaa","line":23,"updated":"2023-08-21 16:21:46.000000000","message":"we can add also description, but for now it is missing as source information to include it into the generation","commit_id":"5778006fe36d35a525d3bca22b42e785c51193b5"},{"author":{"_account_id":27900,"name":"Artem Goncharov","email":"artem.goncharov@gmail.com","username":"gtema"},"change_message_id":"6af0d84034d05d557f0a0c4684fe36a4c5b7894b","unresolved":true,"context_lines":[{"line_number":205,"context_line":"            \"name\": \"tags\","},{"line_number":206,"context_line":"            \"schema\": {\"type\": \"array\", \"items\": {\"type\": \"string\"}},"},{"line_number":207,"context_line":"            \"style\": \"form\","},{"line_number":208,"context_line":"            \"explode\": False,"},{"line_number":209,"context_line":"        },"},{"line_number":210,"context_line":"        {"},{"line_number":211,"context_line":"            \"location\": \"query\","}],"source_content_type":"text/x-python","patch_set":1,"id":"9d4806b4_ddd6f663","line":208,"updated":"2023-08-21 16:21:46.000000000","message":"Here we would add min_version information","commit_id":"5778006fe36d35a525d3bca22b42e785c51193b5"}],"openstack/utils.py":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"8caa8c43e7ed5512a0a570158f5c2a5c4c690fa4","unresolved":true,"context_lines":[{"line_number":718,"context_line":"def deprecated(message: str):"},{"line_number":719,"context_line":"    \"\"\"Decorate function with a deprecation warning\"\"\""},{"line_number":720,"context_line":"    # NOTE(gtema): there are few deprecation decorator libs out there, but"},{"line_number":721,"context_line":"    # none of them is currently included in the global requirements."},{"line_number":722,"context_line":"    # Necessary code is too small to justify effort to pull that in. In"},{"line_number":723,"context_line":"    # addition there is https://peps.python.org/pep-0702/."},{"line_number":724,"context_line":"    # Keep this very simple for now"}],"source_content_type":"text/x-python","patch_set":26,"id":"51d38169_532748b5","line":721,"updated":"2023-09-11 11:40:53.000000000","message":"This isn\u0027t true: [`debtcollector`](https://pypi.org/project/debtcollector/) does this for us. There\u0027s nothing necessarily wrong with doing this, but we should say why we\u0027re not using debtcollector rather than pretend it doesn\u0027t exist.","commit_id":"230deef3ad8974f80d04006969bcfecc60794414"},{"author":{"_account_id":27900,"name":"Artem Goncharov","email":"artem.goncharov@gmail.com","username":"gtema"},"change_message_id":"a5d800f0ef1f41f6dc6361553ba66dea2d57339a","unresolved":true,"context_lines":[{"line_number":718,"context_line":"def deprecated(message: str):"},{"line_number":719,"context_line":"    \"\"\"Decorate function with a deprecation warning\"\"\""},{"line_number":720,"context_line":"    # NOTE(gtema): there are few deprecation decorator libs out there, but"},{"line_number":721,"context_line":"    # none of them is currently included in the global requirements."},{"line_number":722,"context_line":"    # Necessary code is too small to justify effort to pull that in. In"},{"line_number":723,"context_line":"    # addition there is https://peps.python.org/pep-0702/."},{"line_number":724,"context_line":"    # Keep this very simple for now"}],"source_content_type":"text/x-python","patch_set":26,"id":"e38e61ad_5833273f","line":721,"in_reply_to":"51d38169_532748b5","updated":"2023-09-11 15:34:20.000000000","message":"well, changes you will find debtcollector without knowing it is there and doing similar things are small. At least I have not found on few first pages searching for deprecation decorator.\nI dropped this change in favor of debtcollector","commit_id":"230deef3ad8974f80d04006969bcfecc60794414"}]}
