)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":34975,"name":"Jaromír Wysoglad","email":"jwysogla@redhat.com","username":"jwysogla"},"change_message_id":"2b8a5c8ed07f668c7719a6ec66d9bc05459a4945","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"cf1910e4_00f1373a","updated":"2025-04-11 14:11:05.000000000","message":"Checking the usage of the enrich_query and append_rbac functions, it seems like they\u0027re used only from within the observabilityclient itself, so it should be quite safe to rename them and to move the rbac file: \nhttps://github.com/search?q\u003dorg%3Aopenstack%20enrich_query\u0026type\u003dcode\nhttps://github.com/search?q\u003dorg%3Aopenstack%20append_rbac\u0026type\u003dcode","commit_id":"1f895f5a5b622960cada726335a89bd0dbafd680"},{"author":{"_account_id":34975,"name":"Jaromír Wysoglad","email":"jwysogla@redhat.com","username":"jwysogla"},"change_message_id":"2b8a5c8ed07f668c7719a6ec66d9bc05459a4945","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"e7da5326_3db4a090","updated":"2025-04-11 14:11:05.000000000","message":"Checking the usage of the enrich_query and append_rbac functions, it seems like they\u0027re used only from within the observabilityclient itself, so it should be quite safe to rename them and to move the rbac file: \nhttps://github.com/search?q\u003dorg%3Aopenstack%20enrich_query\u0026type\u003dcode\nhttps://github.com/search?q\u003dorg%3Aopenstack%20append_rbac\u0026type\u003dcode","commit_id":"1f895f5a5b622960cada726335a89bd0dbafd680"},{"author":{"_account_id":34975,"name":"Jaromír Wysoglad","email":"jwysogla@redhat.com","username":"jwysogla"},"change_message_id":"40bb6fb77c52746a57e7dbe82ce5baf26c530709","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"3ea4dfc2_ce9b6b64","updated":"2025-04-11 14:12:14.000000000","message":"I left some comments inline explaining my reason for some of the changes.","commit_id":"1f895f5a5b622960cada726335a89bd0dbafd680"}],"observabilityclient/rbac.py":[{"author":{"_account_id":34975,"name":"Jaromír Wysoglad","email":"jwysogla@redhat.com","username":"jwysogla"},"change_message_id":"2b8a5c8ed07f668c7719a6ec66d9bc05459a4945","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"3a424464_8b67cd58","side":"PARENT","line":27,"updated":"2025-04-11 14:11:05.000000000","message":"Let\u0027s move the disable_rbac logic out of this code. This can be easily handled by an if / else as seen in the python_api.py. Having it here as well causes unnecessary added complexity as seen in the recent issue I discovered in the unit tests.","commit_id":"eab78d03a4805462a81f562ef4d2f2146174e1b9"},{"author":{"_account_id":34975,"name":"Jaromír Wysoglad","email":"jwysogla@redhat.com","username":"jwysogla"},"change_message_id":"2b8a5c8ed07f668c7719a6ec66d9bc05459a4945","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"ef20cbcb_be58c2d7","side":"PARENT","line":42,"updated":"2025-04-11 14:11:05.000000000","message":"This actually wasn\u0027t used anywhere.","commit_id":"eab78d03a4805462a81f562ef4d2f2146174e1b9"},{"author":{"_account_id":34975,"name":"Jaromír Wysoglad","email":"jwysogla@redhat.com","username":"jwysogla"},"change_message_id":"2b8a5c8ed07f668c7719a6ec66d9bc05459a4945","unresolved":false,"context_lines":[{"line_number":17,"context_line":"from observabilityclient.utils.metric_utils import format_labels"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"class PromQLRbac(object):"},{"line_number":21,"context_line":"    def __init__(self, prom_api_client, project_id):"},{"line_number":22,"context_line":"        self.client \u003d prom_api_client"},{"line_number":23,"context_line":"        self.labels \u003d {"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a8e43f0_4c4e4378","line":20,"updated":"2025-04-11 14:11:05.000000000","message":"This name seems a bit more descriptive if the module is to be included from some other project","commit_id":"1f895f5a5b622960cada726335a89bd0dbafd680"},{"author":{"_account_id":34975,"name":"Jaromír Wysoglad","email":"jwysogla@redhat.com","username":"jwysogla"},"change_message_id":"2b8a5c8ed07f668c7719a6ec66d9bc05459a4945","unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"class PromQLRbac(object):"},{"line_number":21,"context_line":"    def __init__(self, prom_api_client, project_id):"},{"line_number":22,"context_line":"        self.client \u003d prom_api_client"},{"line_number":23,"context_line":"        self.labels \u003d {"},{"line_number":24,"context_line":"            \"project\": project_id"}],"source_content_type":"text/x-python","patch_set":1,"id":"2080521a_3d975087","line":21,"updated":"2025-04-11 14:11:05.000000000","message":"Other services often don\u0027t have access to the user\u0027s session (for example to a session of a user who created an alarm), but they should know to which project a given resource (e.g. alarm) belongs, so let\u0027s just use project_id directly instead of getting it from the session.\n\nPrometheusAPIClient is used to get list of metrics later in the code. We don\u0027t really need an instance of the observabilityclient for anything. PrometheusAPIClient is retrievable from observabilityclient instance if needed.","commit_id":"1f895f5a5b622960cada726335a89bd0dbafd680"},{"author":{"_account_id":34975,"name":"Jaromír Wysoglad","email":"jwysogla@redhat.com","username":"jwysogla"},"change_message_id":"2b8a5c8ed07f668c7719a6ec66d9bc05459a4945","unresolved":false,"context_lines":[{"line_number":69,"context_line":"            start \u003d pair_end"},{"line_number":70,"context_line":"        return -1"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    def modify_query(self, query):"},{"line_number":73,"context_line":"        \"\"\"Add rbac labels to a query."},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"        :param query: The query to modify"}],"source_content_type":"text/x-python","patch_set":1,"id":"a35416e3_582b65ed","line":72,"updated":"2025-04-11 14:11:05.000000000","message":"I didn\u0027t like \"enrich_query\" very much. I think \"modify_query\" is a much better name.","commit_id":"1f895f5a5b622960cada726335a89bd0dbafd680"},{"author":{"_account_id":34975,"name":"Jaromír Wysoglad","email":"jwysogla@redhat.com","username":"jwysogla"},"change_message_id":"2b8a5c8ed07f668c7719a6ec66d9bc05459a4945","unresolved":false,"context_lines":[{"line_number":76,"context_line":"        :type query: str"},{"line_number":77,"context_line":"        \"\"\""},{"line_number":78,"context_line":"        # We need to get all metric names, no matter the rbac"},{"line_number":79,"context_line":"        metric_names \u003d self.client.label_values(\"__name__\")"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"        # We need to detect the locations of metric names"},{"line_number":82,"context_line":"        # inside the query"}],"source_content_type":"text/x-python","patch_set":1,"id":"037b5f80_3d70ec96","line":79,"updated":"2025-04-11 14:11:05.000000000","message":"This is basically the same as before, it just needed to be adjusted to work with PrometheusAPIClient instead of obseravbilityclient.","commit_id":"1f895f5a5b622960cada726335a89bd0dbafd680"}]}
