)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"bb30cf4ca61ce22a7d9c27b5246123e9144b288f","unresolved":true,"context_lines":[{"line_number":17,"context_line":"of the schema files. This is tedious and error prone."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"This patch offers an alternative approach where each schema definition"},{"line_number":20,"context_line":"module only links to to the module defining the previous version. But"},{"line_number":21,"context_line":"the schema piece level fallback is automatic based on that."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"This allows to remove a lot of clutter from the schema definition files"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"9c8a9e3a_c772152e","line":20,"range":{"start_line":20,"start_character":21,"end_line":20,"end_character":23},"updated":"2021-10-14 08:11:19.000000000","message":"nit: - to","commit_id":"646a40a7859185f8414b3db9e37e4254d4849558"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"f956db26154ae60b133e695ccbe44936283fcedf","unresolved":true,"context_lines":[{"line_number":17,"context_line":"of the schema files. This is tedious and error prone."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"This patch offers an alternative approach where each schema definition"},{"line_number":20,"context_line":"module only links to to the module defining the previous version. But"},{"line_number":21,"context_line":"the schema piece level fallback is automatic based on that."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"This allows to remove a lot of clutter from the schema definition files"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"c8379ec8_099b45e4","line":20,"range":{"start_line":20,"start_character":21,"end_line":20,"end_character":23},"in_reply_to":"9c8a9e3a_c772152e","updated":"2021-11-10 16:39:33.000000000","message":"I will fix if I have to respin this","commit_id":"646a40a7859185f8414b3db9e37e4254d4849558"}],"/PATCHSET_LEVEL":[{"author":{"_account_id":11075,"name":"Benny Kopilov","email":"bkopilov@redhat.com","username":"bkopilov"},"change_message_id":"6d07e0c1dc3c3cf3db9cbd70c97d67c50b315bb1","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"2b7d0aef_6297df44","updated":"2022-07-05 15:41:02.000000000","message":"-1 because i am not sure here 😊","commit_id":"646a40a7859185f8414b3db9e37e4254d4849558"},{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"bb30cf4ca61ce22a7d9c27b5246123e9144b288f","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"e31a08b9_a99d4235","updated":"2021-10-14 08:11:19.000000000","message":"Makes things easier","commit_id":"646a40a7859185f8414b3db9e37e4254d4849558"},{"author":{"_account_id":11075,"name":"Benny Kopilov","email":"bkopilov@redhat.com","username":"bkopilov"},"change_message_id":"e973a80f507ad5435fc27fa64bede16109751c78","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"ff941f36_15ddd607","updated":"2022-06-24 12:02:17.000000000","message":"Nice solution...","commit_id":"646a40a7859185f8414b3db9e37e4254d4849558"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"7b55e38ecd803724d96889e95e7b3e9608614f35","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"d57d44b9_e471b86b","updated":"2021-10-15 15:05:18.000000000","message":"ack, looks interesting to me. I will try to review it during PTG or after that.","commit_id":"646a40a7859185f8414b3db9e37e4254d4849558"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"bcfe42d4f172186c66db1b3ccb140ce26323ed30","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"0c1c3137_66a8dbef","updated":"2021-10-12 10:56:52.000000000","message":"recheck 1) cover failure seems to be an unstable test as I cannot reproduce it locally 2) the tempest-full-py3 is failed due to ssh timeout to the guest so that is highly unrelated 3) the tempest-multinode-full-py3  failed due to kernel panic in the guest which also unrelated.","commit_id":"646a40a7859185f8414b3db9e37e4254d4849558"}],"tempest/lib/api_schema/response/compute/v2_9/servers.py":[{"author":{"_account_id":11075,"name":"Benny Kopilov","email":"bkopilov@redhat.com","username":"bkopilov"},"change_message_id":"6d07e0c1dc3c3cf3db9cbd70c97d67c50b315bb1","unresolved":true,"context_lines":[{"line_number":52,"context_line":""},{"line_number":53,"context_line":"# this replaces the module definition with a Schema object that wraps the"},{"line_number":54,"context_line":"# module. This *has to be the last instruction* in the module definition."},{"line_number":55,"context_line":"sys.modules[__name__] \u003d compute.Schema("},{"line_number":56,"context_line":"    previous_schema_module\u003dservers28, schema_module\u003dsys.modules[__name__])"}],"source_content_type":"text/x-python","patch_set":1,"id":"2e47dba0_2ed9e52d","line":55,"updated":"2022-07-05 15:41:02.000000000","message":"So in the previous code all the info was shown under globals() which part of the module . for example: list_server is found in the module globals().\n\nSo we call to:\nsys.module[\u0027tempest.lib.api_schema.response.compute.v2_79.servers\u0027] and initialize it directly which is action that done by the python code ... and  the lookup is actually  a chain ... means that we run lookup till the previous_schema is None if something not found\n\nMy problem with the code here is that we access directly to sys.modules and modify it and i think that its something problematic.\n\n\nI know that the code looks cleaner but hooking stuff from sys.modules ....\n\nHonestly , i dont know ... \n\nWhy do you add the code to __init__.py ? \n\nCould you explain the meaning for something that we remove from globals() while it was before  and deep copy .\n\nThanks a lot for your code , its a case study for me !\n\nBenny","commit_id":"646a40a7859185f8414b3db9e37e4254d4849558"},{"author":{"_account_id":11075,"name":"Benny Kopilov","email":"bkopilov@redhat.com","username":"bkopilov"},"change_message_id":"88133bc97d40e1737fe869426c8f56b64899aab0","unresolved":true,"context_lines":[{"line_number":52,"context_line":""},{"line_number":53,"context_line":"# this replaces the module definition with a Schema object that wraps the"},{"line_number":54,"context_line":"# module. This *has to be the last instruction* in the module definition."},{"line_number":55,"context_line":"sys.modules[__name__] \u003d compute.Schema("},{"line_number":56,"context_line":"    previous_schema_module\u003dservers28, schema_module\u003dsys.modules[__name__])"}],"source_content_type":"text/x-python","patch_set":1,"id":"fbb4c4d9_52779077","line":55,"in_reply_to":"2e47dba0_2ed9e52d","updated":"2022-07-05 18:02:25.000000000","message":"What i am trying to point here is that the sys.modules already created when we reach to the code with updating the module name as i understand , so it has a reference id . and i guess that  some code import the module py he has a reference to it. globals() and sys.modules should have the same id. now we come and change the sys.module file to orher location , means new id. is it possible that we have code for the same module which points to old sys.module id ???\n\nExample:\nDuring the run we have a full view of the resources sys.modules with full view , each module with its own id .\n\nNow we should be aware to the risk of someone reffering (import) from current module in other places in the code.\n\nand our code comes in and change the sys,modules[xxx] id to new one ... means we may have cached info that its not updated.","commit_id":"646a40a7859185f8414b3db9e37e4254d4849558"},{"author":{"_account_id":11075,"name":"Benny Kopilov","email":"bkopilov@redhat.com","username":"bkopilov"},"change_message_id":"ddffa07d66ca3522fe5017cb2fc61bf15bca9391","unresolved":true,"context_lines":[{"line_number":52,"context_line":""},{"line_number":53,"context_line":"# this replaces the module definition with a Schema object that wraps the"},{"line_number":54,"context_line":"# module. This *has to be the last instruction* in the module definition."},{"line_number":55,"context_line":"sys.modules[__name__] \u003d compute.Schema("},{"line_number":56,"context_line":"    previous_schema_module\u003dservers28, schema_module\u003dsys.modules[__name__])"}],"source_content_type":"text/x-python","patch_set":1,"id":"90c31e6c_810097a5","line":55,"in_reply_to":"fbb4c4d9_52779077","updated":"2022-07-05 19:27:27.000000000","message":"Example for POC:\n\nimport sys\nprint(f\"Before: sys {id(sys.modules[\u0027math\u0027])}\")\nimport math\nprint(f\"Before global: {id(globals()[\u0027math\u0027])}\")\nsys.modules[\u0027math\u0027] \u003d \"DDDD\"\nprint(f\"After: sys {id(sys.modules[\u0027math\u0027])}\")\nprint(f\"After global: {id(globals()[\u0027math\u0027])}\")","commit_id":"646a40a7859185f8414b3db9e37e4254d4849558"}]}
