)]}'
{"images/airflow/script/airflow_logrotate.sh":[{"author":{"_account_id":28628,"name":"Michael Beaver","email":"mibeaver@microsoft.com","username":"MichaelBeaver"},"change_message_id":"12d92771ee5223b7b01a91c6b01c372f1580d3ef","unresolved":false,"context_lines":[{"line_number":25,"context_line":""},{"line_number":26,"context_line":"    # Delete oldest logs and empty directories when"},{"line_number":27,"context_line":"    # the Airflow log path filesystem reaches max usage"},{"line_number":28,"context_line":"    CURR_USAGE\u003d$(df -P ${LOGROTATE_PATH} | sed -rn \u0027/%/s///p\u0027 | xargs -r -l1  sh -c \u0027echo $4\u0027)"},{"line_number":29,"context_line":"    if [ $CURR_USAGE -gt ${PERCENT_MAX_LOG_FS_USAGE} ]; then"},{"line_number":30,"context_line":"      while [ $CURR_USAGE -gt ${PERCENT_MAX_LOG_FS_USAGE} ]; do"},{"line_number":31,"context_line":"        find ${LOGROTATE_PATH} \\( -type f -name \u0027*.log\u0027 -o -type d -empty \\) -printf \u0027%T+ %p\\n\u0027 | sort | head -n 1 | xargs -r -l1 sh -c \u0027rm -rf $1\u0027"}],"source_content_type":"text/x-sh","patch_set":5,"id":"dfbec78f_1e358ff7","line":28,"range":{"start_line":28,"start_character":17,"end_line":28,"end_character":93},"updated":"2019-05-09 22:25:45.000000000","message":"I think this could be simplified to\n\ndf /usr/local/airflow/dags/ --output\u003d\u0027pcent\u0027 | grep -o \u0027[0-9]*\u0027\n\nthe --output flag can minimize the output to only the field that you are looking for here and at that point we can just grep for the numbers.","commit_id":"9580d94938b78c5e9d915c1af313c9fe4be41560"},{"author":{"_account_id":24816,"name":"Anthony Bellino","email":"ab2434@att.com","username":"anthony.bellino"},"change_message_id":"345b5b2748e7d6bbcb127ff889fedfc99432a63b","unresolved":false,"context_lines":[{"line_number":25,"context_line":""},{"line_number":26,"context_line":"    # Delete oldest logs and empty directories when"},{"line_number":27,"context_line":"    # the Airflow log path filesystem reaches max usage"},{"line_number":28,"context_line":"    CURR_USAGE\u003d$(df -P ${LOGROTATE_PATH} | sed -rn \u0027/%/s///p\u0027 | xargs -r -l1  sh -c \u0027echo $4\u0027)"},{"line_number":29,"context_line":"    if [ $CURR_USAGE -gt ${PERCENT_MAX_LOG_FS_USAGE} ]; then"},{"line_number":30,"context_line":"      while [ $CURR_USAGE -gt ${PERCENT_MAX_LOG_FS_USAGE} ]; do"},{"line_number":31,"context_line":"        find ${LOGROTATE_PATH} \\( -type f -name \u0027*.log\u0027 -o -type d -empty \\) -printf \u0027%T+ %p\\n\u0027 | sort | head -n 1 | xargs -r -l1 sh -c \u0027rm -rf $1\u0027"}],"source_content_type":"text/x-sh","patch_set":5,"id":"dfbec78f_e2000c04","line":28,"range":{"start_line":28,"start_character":17,"end_line":28,"end_character":93},"in_reply_to":"dfbec78f_1e358ff7","updated":"2019-05-10 16:29:20.000000000","message":"Done","commit_id":"9580d94938b78c5e9d915c1af313c9fe4be41560"},{"author":{"_account_id":30106,"name":"Matt Carter","email":"matt.coach.carter@gmail.com","username":"MattCarter"},"change_message_id":"ab00e4ccbe9303358134254d8e5a42897c2e751d","unresolved":false,"context_lines":[{"line_number":25,"context_line":""},{"line_number":26,"context_line":"    # Delete oldest logs and empty directories when"},{"line_number":27,"context_line":"    # the Airflow log path filesystem reaches max usage"},{"line_number":28,"context_line":"    CURR_USAGE\u003d$(df ${LOGROTATE_PATH} --output\u003d\u0027pcent\u0027 | grep -o \u0027[0-9]*\u0027)"},{"line_number":29,"context_line":"    if [ $CURR_USAGE -gt ${PERCENT_MAX_LOG_FS_USAGE} ]; then"},{"line_number":30,"context_line":"      while [ $CURR_USAGE -gt ${PERCENT_MAX_LOG_FS_USAGE} ]; do"},{"line_number":31,"context_line":"        find ${LOGROTATE_PATH} \\( -type f -name \u0027*.log\u0027 -o -type d -empty \\) -printf \u0027%T+ %p\\n\u0027 | sort | head -n 1 | xargs -r -l1 sh -c \u0027rm -rf $1\u0027"}],"source_content_type":"text/x-sh","patch_set":6,"id":"dfbec78f_fc7f55dd","line":28,"updated":"2019-05-10 15:34:45.000000000","message":"good simplification","commit_id":"e595843cadf14737c9d8172708e8662fd8ead744"},{"author":{"_account_id":23781,"name":"Stanislav Egorov","email":"realsystem@gmail.com","username":"StasEgorov"},"change_message_id":"755a15a0d88383593859e02749222c096c9a19c7","unresolved":false,"context_lines":[{"line_number":29,"context_line":"    if [ $CURR_USAGE -gt ${PERCENT_MAX_LOG_FS_USAGE} ]; then"},{"line_number":30,"context_line":"      while [ $CURR_USAGE -gt ${PERCENT_MAX_LOG_FS_USAGE} ]; do"},{"line_number":31,"context_line":"        find ${LOGROTATE_PATH} \\( -type f -name \u0027*.log\u0027 -o -type d -empty \\) -printf \u0027%T+ %p\\n\u0027 | sort | head -n 1 | xargs -r -l1 sh -c \u0027rm -rf $1\u0027"},{"line_number":32,"context_line":"        CURR_USAGE\u003d$(df ${LOGROTATE_PATH} --output\u003d\u0027pcent\u0027 | grep -o \u0027[0-9]*\u0027)"},{"line_number":33,"context_line":"      done"},{"line_number":34,"context_line":"    fi"},{"line_number":35,"context_line":""}],"source_content_type":"text/x-sh","patch_set":8,"id":"9fb8cfa7_9e21b650","line":32,"range":{"start_line":32,"start_character":8,"end_line":32,"end_character":18},"updated":"2019-06-04 21:25:52.000000000","message":"Code duplication on lines 28 and 32. It\u0027s better to use function.","commit_id":"0184fcbc13a232b493c1b82b28be91132a77ecd7"},{"author":{"_account_id":24816,"name":"Anthony Bellino","email":"ab2434@att.com","username":"anthony.bellino"},"change_message_id":"b125d881dd9ac31438b6e1da4d94fcbe7c874791","unresolved":false,"context_lines":[{"line_number":29,"context_line":"    if [ $CURR_USAGE -gt ${PERCENT_MAX_LOG_FS_USAGE} ]; then"},{"line_number":30,"context_line":"      while [ $CURR_USAGE -gt ${PERCENT_MAX_LOG_FS_USAGE} ]; do"},{"line_number":31,"context_line":"        find ${LOGROTATE_PATH} \\( -type f -name \u0027*.log\u0027 -o -type d -empty \\) -printf \u0027%T+ %p\\n\u0027 | sort | head -n 1 | xargs -r -l1 sh -c \u0027rm -rf $1\u0027"},{"line_number":32,"context_line":"        CURR_USAGE\u003d$(df ${LOGROTATE_PATH} --output\u003d\u0027pcent\u0027 | grep -o \u0027[0-9]*\u0027)"},{"line_number":33,"context_line":"      done"},{"line_number":34,"context_line":"    fi"},{"line_number":35,"context_line":""}],"source_content_type":"text/x-sh","patch_set":8,"id":"9fb8cfa7_410a83d2","line":32,"range":{"start_line":32,"start_character":8,"end_line":32,"end_character":18},"in_reply_to":"9fb8cfa7_9e21b650","updated":"2019-06-04 22:32:21.000000000","message":"Done","commit_id":"0184fcbc13a232b493c1b82b28be91132a77ecd7"},{"author":{"_account_id":23781,"name":"Stanislav Egorov","email":"realsystem@gmail.com","username":"StasEgorov"},"change_message_id":"dfdc07731d10653cd609654f9cd3d2742e1ca4d1","unresolved":false,"context_lines":[{"line_number":17,"context_line":"set -ex"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"get_usage() {"},{"line_number":20,"context_line":"    df -P ${LOGROTATE_PATH} | sed -rn \u0027/%/s///p\u0027 | xargs -r -l1  sh -c \u0027echo $4\u0027"},{"line_number":21,"context_line":"}"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"while true; do"}],"source_content_type":"text/x-sh","patch_set":9,"id":"9fb8cfa7_218f4f24","line":20,"range":{"start_line":20,"start_character":0,"end_line":20,"end_character":80},"updated":"2019-06-04 22:46:38.000000000","message":"Why so complex? Some special case covered?\n\nI would do more readable:\nusage\u003d$(df -P ${LOGROTATE_PATH} | grep -v Use | awk \u0027{print $5}\u0027)\necho ${res%?}\n\nBut it\u0027s just a note from my side.","commit_id":"66a7876e85967b9112eee7c61359c78299788ec2"},{"author":{"_account_id":24816,"name":"Anthony Bellino","email":"ab2434@att.com","username":"anthony.bellino"},"change_message_id":"0104cbc182e115639916023811fda5ab63ee4eed","unresolved":false,"context_lines":[{"line_number":17,"context_line":"set -ex"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"get_usage() {"},{"line_number":20,"context_line":"    df -P ${LOGROTATE_PATH} | sed -rn \u0027/%/s///p\u0027 | xargs -r -l1  sh -c \u0027echo $4\u0027"},{"line_number":21,"context_line":"}"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"while true; do"}],"source_content_type":"text/x-sh","patch_set":9,"id":"9fb8cfa7_893e55d8","line":20,"range":{"start_line":20,"start_character":0,"end_line":20,"end_character":80},"in_reply_to":"9fb8cfa7_218f4f24","updated":"2019-06-05 13:53:46.000000000","message":"Done. Thanks for pointing this out.","commit_id":"66a7876e85967b9112eee7c61359c78299788ec2"},{"author":{"_account_id":27715,"name":"Sean Eagan","email":"seaneagan@microsoft.com","username":"seaneagan"},"change_message_id":"13b33e86b26ab18d276572121d4d625d15fd79a5","unresolved":false,"context_lines":[{"line_number":30,"context_line":"    # Delete oldest logs and empty directories when"},{"line_number":31,"context_line":"    # the Airflow log path filesystem reaches max usage"},{"line_number":32,"context_line":"    CURR_USAGE\u003d$(get_usage)"},{"line_number":33,"context_line":"    if [ $CURR_USAGE -gt ${PERCENT_MAX_LOG_FS_USAGE} ]; then"},{"line_number":34,"context_line":"      while [ $CURR_USAGE -gt ${PERCENT_MAX_LOG_FS_USAGE} ]; do"},{"line_number":35,"context_line":"        find ${LOGROTATE_PATH} \\( -type f -name \u0027*.log\u0027 -o -type d -empty \\) -printf \u0027%T+ %p\\n\u0027 | sort | head -n 1 | xargs -r -l1 sh -c \u0027rm -rf $1\u0027"},{"line_number":36,"context_line":"        CURR_USAGE\u003d$(get_usage)"}],"source_content_type":"text/x-sh","patch_set":10,"id":"9fb8cfa7_7f1d9c0d","line":33,"range":{"start_line":33,"start_character":4,"end_line":33,"end_character":60},"updated":"2019-06-07 19:13:03.000000000","message":"nit: do we need this if? seems like the while should be sufficient.","commit_id":"f594455f58dda8f0a2900e5c5841c66d54864f71"},{"author":{"_account_id":24816,"name":"Anthony Bellino","email":"ab2434@att.com","username":"anthony.bellino"},"change_message_id":"c5c073addd566538b387235bf3271b4dd310708e","unresolved":false,"context_lines":[{"line_number":30,"context_line":"    # Delete oldest logs and empty directories when"},{"line_number":31,"context_line":"    # the Airflow log path filesystem reaches max usage"},{"line_number":32,"context_line":"    CURR_USAGE\u003d$(get_usage)"},{"line_number":33,"context_line":"    if [ $CURR_USAGE -gt ${PERCENT_MAX_LOG_FS_USAGE} ]; then"},{"line_number":34,"context_line":"      while [ $CURR_USAGE -gt ${PERCENT_MAX_LOG_FS_USAGE} ]; do"},{"line_number":35,"context_line":"        find ${LOGROTATE_PATH} \\( -type f -name \u0027*.log\u0027 -o -type d -empty \\) -printf \u0027%T+ %p\\n\u0027 | sort | head -n 1 | xargs -r -l1 sh -c \u0027rm -rf $1\u0027"},{"line_number":36,"context_line":"        CURR_USAGE\u003d$(get_usage)"}],"source_content_type":"text/x-sh","patch_set":10,"id":"9fb8cfa7_5a6d4630","line":33,"range":{"start_line":33,"start_character":4,"end_line":33,"end_character":60},"in_reply_to":"9fb8cfa7_7a1daa0d","updated":"2019-06-07 20:03:02.000000000","message":"Done. Thanks for the reviews.","commit_id":"f594455f58dda8f0a2900e5c5841c66d54864f71"},{"author":{"_account_id":28618,"name":"Drew Walters","email":"drewwalters@microsoft.com","username":"drewwalters96"},"change_message_id":"f4c7bc831554150c6448a9341babc2f4631aec84","unresolved":false,"context_lines":[{"line_number":30,"context_line":"    # Delete oldest logs and empty directories when"},{"line_number":31,"context_line":"    # the Airflow log path filesystem reaches max usage"},{"line_number":32,"context_line":"    CURR_USAGE\u003d$(get_usage)"},{"line_number":33,"context_line":"    if [ $CURR_USAGE -gt ${PERCENT_MAX_LOG_FS_USAGE} ]; then"},{"line_number":34,"context_line":"      while [ $CURR_USAGE -gt ${PERCENT_MAX_LOG_FS_USAGE} ]; do"},{"line_number":35,"context_line":"        find ${LOGROTATE_PATH} \\( -type f -name \u0027*.log\u0027 -o -type d -empty \\) -printf \u0027%T+ %p\\n\u0027 | sort | head -n 1 | xargs -r -l1 sh -c \u0027rm -rf $1\u0027"},{"line_number":36,"context_line":"        CURR_USAGE\u003d$(get_usage)"}],"source_content_type":"text/x-sh","patch_set":10,"id":"9fb8cfa7_7a1daa0d","line":33,"range":{"start_line":33,"start_character":4,"end_line":33,"end_character":60},"in_reply_to":"9fb8cfa7_7f1d9c0d","updated":"2019-06-07 19:44:40.000000000","message":"\u003e nit: do we need this if? seems like the while should be sufficient.\n\nI agree.","commit_id":"f594455f58dda8f0a2900e5c5841c66d54864f71"}]}
