)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"5bb526868de857fc6004edb10d25009d29a86632","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"bec039e6_da320132","updated":"2026-10-06 22:00:33.000000000","message":"Thanks Stephen. This is good for verification!","commit_id":"8441edbb7de6b2ab49ca1a30b58049b6cc8a06ba"},{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"61e703c97b5e9eaa51cf4a7cca44748fa79641a6","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"e7f53a4e_7bc52631","updated":"2026-10-06 22:00:39.000000000","message":"some comments inline","commit_id":"8441edbb7de6b2ab49ca1a30b58049b6cc8a06ba"},{"author":{"_account_id":29632,"name":"Carlos Eduardo","email":"ces.eduardo98@gmail.com","username":"silvacarlos"},"change_message_id":"552aab2540bea7c07762b9599e549556634c79e3","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"baaf22b3_5a2f5e25","updated":"2026-10-08 15:34:16.000000000","message":"LGTM, thank you Stephen","commit_id":"222a4e89a11f7d64e2a5ec058729541010047b4a"},{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"38a65d03694b3d68f4be4d8d1626e5a63bb81976","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"c32e79d2_c06e1e99","updated":"2026-10-07 14:42:55.000000000","message":"lovely, thank you @stephenfin@redhat.com!","commit_id":"222a4e89a11f7d64e2a5ec058729541010047b4a"}],"manila/tests/db/sqlalchemy/test_models.py":[{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"5bb526868de857fc6004edb10d25009d29a86632","unresolved":true,"context_lines":[{"line_number":35,"context_line":"        self.assertIn(\"host\u003d\u0027fake-host\u0027\", r)"},{"line_number":36,"context_line":"        self.assertIn(\"binary\u003d\u0027manila-share\u0027\", r)"},{"line_number":37,"context_line":"        self.assertIn(\"id\u003d\u003cnot loaded\u003e\", r)"},{"line_number":38,"context_line":"        self.assertIn(\"topic\u003d\u003cnot loaded\u003e\", r)"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def test_repr_model_persistent(self):"},{"line_number":41,"context_line":"        ctxt \u003d context.get_admin_context()"}],"source_content_type":"text/x-python","patch_set":1,"id":"d9f95e83_899e7d72","line":38,"updated":"2026-10-06 22:00:33.000000000","message":"let\u0027s add:\n\n\n`self.assertTrue(inspect(service).transient)`\n\nto be explicit","commit_id":"8441edbb7de6b2ab49ca1a30b58049b6cc8a06ba"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"d8199ade6457daa6af09b85d7f67045ee0560751","unresolved":false,"context_lines":[{"line_number":35,"context_line":"        self.assertIn(\"host\u003d\u0027fake-host\u0027\", r)"},{"line_number":36,"context_line":"        self.assertIn(\"binary\u003d\u0027manila-share\u0027\", r)"},{"line_number":37,"context_line":"        self.assertIn(\"id\u003d\u003cnot loaded\u003e\", r)"},{"line_number":38,"context_line":"        self.assertIn(\"topic\u003d\u003cnot loaded\u003e\", r)"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def test_repr_model_persistent(self):"},{"line_number":41,"context_line":"        ctxt \u003d context.get_admin_context()"}],"source_content_type":"text/x-python","patch_set":1,"id":"36b6781a_3f01601b","line":38,"in_reply_to":"d9f95e83_899e7d72","updated":"2026-10-07 12:15:37.000000000","message":"Good idea. Done.","commit_id":"8441edbb7de6b2ab49ca1a30b58049b6cc8a06ba"},{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"5bb526868de857fc6004edb10d25009d29a86632","unresolved":true,"context_lines":[{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def test_repr_model_persistent(self):"},{"line_number":41,"context_line":"        ctxt \u003d context.get_admin_context()"},{"line_number":42,"context_line":"        service_ref \u003d db_api.service_create("},{"line_number":43,"context_line":"            ctxt,"},{"line_number":44,"context_line":"            {"},{"line_number":45,"context_line":"                \u0027host\u0027: \u0027fake-host\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"037575fd_0cb9cef3","line":42,"range":{"start_line":42,"start_character":7,"end_line":42,"end_character":44},"updated":"2026-10-06 22:00:33.000000000","message":"this wouldn\u0027t return a persistent object [1], as you state in lines 69-70 below; technically none of the model returns from the public DB API are persistent.. all of them are detached.\n\nSo functionally, this is the same as the detached test below... One way could be writing our own query here:\n\n```\n with db_api.context_manager.writer.using(ctxt):\n        service_ref \u003d db_api.service_create(\n            ctxt,\n            {\n                \u0027host\u0027: \u0027fake-host\u0027,\n                \u0027binary\u0027: \u0027manila-share\u0027,\n                \u0027topic\u0027: \u0027share\u0027,\n                \u0027availability_zone\u0027: \u0027fake_az\u0027,\n            },\n        )\n        state \u003d inspect(service_ref)\n        self.assertTrue(state.persistent)\n        self.assertIn(\u0027state\u0027, state.unloaded)\n\n        r \u003d repr(service_ref)\n\n        self.assertTrue(r.startswith(\u0027Service(\u0027))\n        self.assertIn(\"host\u003d\u0027fake-host\u0027\", r)\n        self.assertIn(\"binary\u003d\u0027manila-share\u0027\", r)\n        self.assertIn(\"topic\u003d\u0027share\u0027\", r)\n        self.assertIn(f\"id\u003d{service_ref.id}\", r)\n        self.assertIn(\"state\u003d\u003cnot loaded\u003e\", r)\n        # Confirm repr() did not trigger a lazy load.\n        self.assertIn(\u0027state\u0027, state.unloaded)\n\n```\n\n\n\n\n\n\n\n [1] https://opendev.org/openstack/manila/src/commit/20b721293904f59ae429539fb70dc1343c68dc3b/manila/db/sqlalchemy/api.py#L724-L732\n^ the query detaches.","commit_id":"8441edbb7de6b2ab49ca1a30b58049b6cc8a06ba"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"d8199ade6457daa6af09b85d7f67045ee0560751","unresolved":false,"context_lines":[{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def test_repr_model_persistent(self):"},{"line_number":41,"context_line":"        ctxt \u003d context.get_admin_context()"},{"line_number":42,"context_line":"        service_ref \u003d db_api.service_create("},{"line_number":43,"context_line":"            ctxt,"},{"line_number":44,"context_line":"            {"},{"line_number":45,"context_line":"                \u0027host\u0027: \u0027fake-host\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a0a4d4f_675a7a7b","line":42,"range":{"start_line":42,"start_character":7,"end_line":42,"end_character":44},"in_reply_to":"037575fd_0cb9cef3","updated":"2026-10-07 12:15:37.000000000","message":"🤦 I originally had something similar in here and \"simplified\" it.","commit_id":"8441edbb7de6b2ab49ca1a30b58049b6cc8a06ba"},{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"5bb526868de857fc6004edb10d25009d29a86632","unresolved":true,"context_lines":[{"line_number":69,"context_line":"        # Model returned from DB API is already detached; unloaded fields"},{"line_number":70,"context_line":"        # are shown as \u0027\u003cnot loaded\u003e\u0027 without triggering lazy loads or errors."},{"line_number":71,"context_line":"        r \u003d repr(service_ref)"},{"line_number":72,"context_line":"        self.assertTrue(r.startswith(\u0027Service(\u0027))"},{"line_number":73,"context_line":"        self.assertIn(\"host\u003d\u0027fake-host\u0027\", r)"},{"line_number":74,"context_line":"        self.assertIn(\"state\u003d\u003cnot loaded\u003e\", r)"},{"line_number":75,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"46dd2577_9a489f9d","line":72,"updated":"2026-10-06 22:00:33.000000000","message":"let\u0027s add:\n\n`self.assertTrue(inspect(service_ref).detached)` to be explicit","commit_id":"8441edbb7de6b2ab49ca1a30b58049b6cc8a06ba"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"d8199ade6457daa6af09b85d7f67045ee0560751","unresolved":false,"context_lines":[{"line_number":69,"context_line":"        # Model returned from DB API is already detached; unloaded fields"},{"line_number":70,"context_line":"        # are shown as \u0027\u003cnot loaded\u003e\u0027 without triggering lazy loads or errors."},{"line_number":71,"context_line":"        r \u003d repr(service_ref)"},{"line_number":72,"context_line":"        self.assertTrue(r.startswith(\u0027Service(\u0027))"},{"line_number":73,"context_line":"        self.assertIn(\"host\u003d\u0027fake-host\u0027\", r)"},{"line_number":74,"context_line":"        self.assertIn(\"state\u003d\u003cnot loaded\u003e\", r)"},{"line_number":75,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"ccea99a1_4951f224","line":72,"in_reply_to":"46dd2577_9a489f9d","updated":"2026-10-07 12:15:37.000000000","message":"Done","commit_id":"8441edbb7de6b2ab49ca1a30b58049b6cc8a06ba"},{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"38a65d03694b3d68f4be4d8d1626e5a63bb81976","unresolved":true,"context_lines":[{"line_number":15,"context_line":"\"\"\"Testing of SQLAlchemy model classes.\"\"\""},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"import ddt"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"import sqlalchemy as sa"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"from manila.common import constants"}],"source_content_type":"text/x-python","patch_set":2,"id":"bbb25972_f4dff290","line":18,"updated":"2026-10-07 14:42:55.000000000","message":"nit: blank line","commit_id":"222a4e89a11f7d64e2a5ec058729541010047b4a"}]}
