)]}'
{"logscraper/logscraper.py":[{"author":{"_account_id":6889,"name":"Fabien Boucher","email":"fboucher@redhat.com","username":"fabien-boucher"},"change_message_id":"4ca5a19247cfe3547e6aba86f0bfc68e7b290217","unresolved":true,"context_lines":[{"line_number":107,"context_line":"        resp \u003d requests_get(url, verify)"},{"line_number":108,"context_line":"        return resp.status_code \u003c 400"},{"line_number":109,"context_line":"    except requests.exceptions.HTTPError:"},{"line_number":110,"context_line":"        logging.warning(\"Zuul host is not available!\")"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"###############################################################################"}],"source_content_type":"text/x-python","patch_set":1,"id":"f3e52052_52eb2e95","line":110,"updated":"2022-10-25 14:12:01.000000000","message":"Maybe the log is not needed here ?","commit_id":"934c5e9b4a8da6c0605a47be76c282e73717c896"},{"author":{"_account_id":20676,"name":"daniel.pawlik","display_name":"Daniel Pawlik","email":"dpawlik@redhat.com","username":"daniel.pawlik"},"change_message_id":"3a620be852a2b65a13cac6aaa247f658a7c3cb11","unresolved":false,"context_lines":[{"line_number":107,"context_line":"        resp \u003d requests_get(url, verify)"},{"line_number":108,"context_line":"        return resp.status_code \u003c 400"},{"line_number":109,"context_line":"    except requests.exceptions.HTTPError:"},{"line_number":110,"context_line":"        logging.warning(\"Zuul host is not available!\")"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"###############################################################################"}],"source_content_type":"text/x-python","patch_set":1,"id":"941ef755_dde36905","line":110,"in_reply_to":"f3e52052_52eb2e95","updated":"2022-10-28 12:49:37.000000000","message":"Done","commit_id":"934c5e9b4a8da6c0605a47be76c282e73717c896"},{"author":{"_account_id":6889,"name":"Fabien Boucher","email":"fboucher@redhat.com","username":"fabien-boucher"},"change_message_id":"4ca5a19247cfe3547e6aba86f0bfc68e7b290217","unresolved":true,"context_lines":[{"line_number":731,"context_line":"        if not is_zuul_host_up(zuul_api_url, validate_ca):"},{"line_number":732,"context_line":"            logging.warning(\"Zuul seems not to be reachable. \""},{"line_number":733,"context_line":"                            \"Postponing pulling logs...\")"},{"line_number":734,"context_line":"            continue"},{"line_number":735,"context_line":""},{"line_number":736,"context_line":"        if args.job_name:"},{"line_number":737,"context_line":"            jobs_in_zuul \u003d filter_available_jobs(zuul_api_url, args.job_name,"}],"source_content_type":"text/x-python","patch_set":1,"id":"7080794a_00b6f766","line":734,"updated":"2022-10-25 14:12:01.000000000","message":"- Perhaps add the url in the log message ?\n- Probably you\u0027d like to add a retry delay to avoid an infernal loop here ?","commit_id":"934c5e9b4a8da6c0605a47be76c282e73717c896"},{"author":{"_account_id":20676,"name":"daniel.pawlik","display_name":"Daniel Pawlik","email":"dpawlik@redhat.com","username":"daniel.pawlik"},"change_message_id":"3a620be852a2b65a13cac6aaa247f658a7c3cb11","unresolved":false,"context_lines":[{"line_number":731,"context_line":"        if not is_zuul_host_up(zuul_api_url, validate_ca):"},{"line_number":732,"context_line":"            logging.warning(\"Zuul seems not to be reachable. \""},{"line_number":733,"context_line":"                            \"Postponing pulling logs...\")"},{"line_number":734,"context_line":"            continue"},{"line_number":735,"context_line":""},{"line_number":736,"context_line":"        if args.job_name:"},{"line_number":737,"context_line":"            jobs_in_zuul \u003d filter_available_jobs(zuul_api_url, args.job_name,"}],"source_content_type":"text/x-python","patch_set":1,"id":"9d8f7998_58ff4ea1","line":734,"in_reply_to":"7080794a_00b6f766","updated":"2022-10-28 12:49:37.000000000","message":"delay is done in main function in while loop. If one endpoint is not reachable, it should goes to next one. Of only one is set, it should come back to main function where is sleep.","commit_id":"934c5e9b4a8da6c0605a47be76c282e73717c896"},{"author":{"_account_id":30674,"name":"Lukas Piwowarski","email":"lpiwowar@redhat.com","username":"lukas-piwowarski"},"change_message_id":"3c08015cdfe4b2c86ff4222d05a9f36dbf25e822","unresolved":true,"context_lines":[{"line_number":106,"context_line":"    try:"},{"line_number":107,"context_line":"        resp \u003d requests_get(url, verify)"},{"line_number":108,"context_line":"        return resp.status_code \u003c 400"},{"line_number":109,"context_line":"    except requests.exceptions.HTTPError:"},{"line_number":110,"context_line":"        pass"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"2c125d95_4154f402","line":109,"range":{"start_line":109,"start_character":4,"end_line":109,"end_character":41},"updated":"2022-10-26 09:52:23.000000000","message":"I\u0027m not 100 % sure about this but it looks like that the requests.get() does not raise the HTTPError exception by itself [1][2] (?)\n\nMaybe something like this might be better?\n```\ntry:\n  resp \u003d requests_get(url, verify)\n  resp.raise_for_status()\n  return True\nexcept requests.exceptions.HTTPError:\n  return False\n```\n\n[1] https://requests.readthedocs.io/en/latest/user/quickstart/#errors-and-exceptions\n[2] https://requests.readthedocs.io/en/latest/api/#requests.Response.raise_for_status","commit_id":"340fa9701240f6eae5751eef87f27260d62522e7"},{"author":{"_account_id":20676,"name":"daniel.pawlik","display_name":"Daniel Pawlik","email":"dpawlik@redhat.com","username":"daniel.pawlik"},"change_message_id":"98e3f1a7d6e139b167ae8d18456c56a7e8c958c6","unresolved":false,"context_lines":[{"line_number":106,"context_line":"    try:"},{"line_number":107,"context_line":"        resp \u003d requests_get(url, verify)"},{"line_number":108,"context_line":"        return resp.status_code \u003c 400"},{"line_number":109,"context_line":"    except requests.exceptions.HTTPError:"},{"line_number":110,"context_line":"        pass"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"56256c9d_7604c174","line":109,"range":{"start_line":109,"start_character":4,"end_line":109,"end_character":41},"in_reply_to":"2c125d95_4154f402","updated":"2022-10-28 12:51:20.000000000","message":"I took the exception from the log message.\nReturn True or false is not needed. If the condition will come to the exception, function will return None, so it will also raise an error that API is not reachable.","commit_id":"340fa9701240f6eae5751eef87f27260d62522e7"},{"author":{"_account_id":30674,"name":"Lukas Piwowarski","email":"lpiwowar@redhat.com","username":"lukas-piwowarski"},"change_message_id":"a06316fc242aa3a2b8acef5677562acf49cca4e1","unresolved":false,"context_lines":[{"line_number":106,"context_line":"    try:"},{"line_number":107,"context_line":"        resp \u003d requests_get(url, verify)"},{"line_number":108,"context_line":"        return resp.status_code \u003c 400"},{"line_number":109,"context_line":"    except requests.exceptions.HTTPError:"},{"line_number":110,"context_line":"        pass"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"6cc04484_2d755448","line":109,"range":{"start_line":109,"start_character":4,"end_line":109,"end_character":41},"in_reply_to":"56256c9d_7604c174","updated":"2022-11-02 13:39:30.000000000","message":"Ok, if you think it is ok I am ok with it too. \n\nJust wanted to point out that it might be possible that the request_get() function will never raise the HTTPError. \n\nI would prefer \"return False\" instead of \"pass\" but this is just my personal preference.","commit_id":"340fa9701240f6eae5751eef87f27260d62522e7"},{"author":{"_account_id":6889,"name":"Fabien Boucher","email":"fboucher@redhat.com","username":"fabien-boucher"},"change_message_id":"8d0bafe5e5e33d50f59bdb080da9d1268772e0fd","unresolved":true,"context_lines":[{"line_number":731,"context_line":"        if not is_zuul_host_up(zuul_api_url, validate_ca):"},{"line_number":732,"context_line":"            logging.warning(\"Zuul %s seems not to be reachable. \""},{"line_number":733,"context_line":"                            \"Postponing pulling logs...\" % zuul_api_url)"},{"line_number":734,"context_line":"            continue"},{"line_number":735,"context_line":""},{"line_number":736,"context_line":"        if args.job_name:"},{"line_number":737,"context_line":"            jobs_in_zuul \u003d filter_available_jobs(zuul_api_url, args.job_name,"}],"source_content_type":"text/x-python","patch_set":2,"id":"36b2eeb9_ba5f6655","line":734,"updated":"2022-10-28 08:03:57.000000000","message":"You should add a sleep delay here.","commit_id":"340fa9701240f6eae5751eef87f27260d62522e7"},{"author":{"_account_id":20676,"name":"daniel.pawlik","display_name":"Daniel Pawlik","email":"dpawlik@redhat.com","username":"daniel.pawlik"},"change_message_id":"3a620be852a2b65a13cac6aaa247f658a7c3cb11","unresolved":true,"context_lines":[{"line_number":731,"context_line":"        if not is_zuul_host_up(zuul_api_url, validate_ca):"},{"line_number":732,"context_line":"            logging.warning(\"Zuul %s seems not to be reachable. \""},{"line_number":733,"context_line":"                            \"Postponing pulling logs...\" % zuul_api_url)"},{"line_number":734,"context_line":"            continue"},{"line_number":735,"context_line":""},{"line_number":736,"context_line":"        if args.job_name:"},{"line_number":737,"context_line":"            jobs_in_zuul \u003d filter_available_jobs(zuul_api_url, args.job_name,"}],"source_content_type":"text/x-python","patch_set":2,"id":"6ed81c10_18328996","line":734,"in_reply_to":"36b2eeb9_ba5f6655","updated":"2022-10-28 12:49:37.000000000","message":"Why? It will finish the loop and go to the main function, which is including the sleep. Why one zuul api that is not reachable should block another apis?","commit_id":"340fa9701240f6eae5751eef87f27260d62522e7"},{"author":{"_account_id":20676,"name":"daniel.pawlik","display_name":"Daniel Pawlik","email":"dpawlik@redhat.com","username":"daniel.pawlik"},"change_message_id":"b8fb0d6b9a31812ca89e195b5719c88ef35ba542","unresolved":false,"context_lines":[{"line_number":731,"context_line":"        if not is_zuul_host_up(zuul_api_url, validate_ca):"},{"line_number":732,"context_line":"            logging.warning(\"Zuul %s seems not to be reachable. \""},{"line_number":733,"context_line":"                            \"Postponing pulling logs...\" % zuul_api_url)"},{"line_number":734,"context_line":"            continue"},{"line_number":735,"context_line":""},{"line_number":736,"context_line":"        if args.job_name:"},{"line_number":737,"context_line":"            jobs_in_zuul \u003d filter_available_jobs(zuul_api_url, args.job_name,"}],"source_content_type":"text/x-python","patch_set":2,"id":"272fa120_e7e2e68a","line":734,"in_reply_to":"6ed81c10_18328996","updated":"2022-11-03 12:27:43.000000000","message":"Done","commit_id":"340fa9701240f6eae5751eef87f27260d62522e7"}]}
