)]}'
{"tools/list_eol_stale_branches.sh":[{"author":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"change_message_id":"6978645fccdb3a8a5f35a26aa4957aaccd5c2176","unresolved":true,"context_lines":[{"line_number":66,"context_line":"function no_open_patches {"},{"line_number":67,"context_line":"    req\u003d\"${GERRIT_URL}/changes/?q\u003dstatus:open+project:${repo}+branch:stable/${em_serie}\""},{"line_number":68,"context_line":"    patches\u003d$(curl -s ${req} | sed 1d | jq --raw-output \u0027.[] | .change_id\u0027)"},{"line_number":69,"context_line":"    [ -z \"${patches}\" ]"},{"line_number":70,"context_line":"    no_opens\u003d$?"},{"line_number":71,"context_line":"    if [[ \"$no_opens\" -eq 1 ]]; then"},{"line_number":72,"context_line":"        echo \"Patches remained open on stale branch (make sure to abandon them):\""}],"source_content_type":"text/x-sh","patch_set":1,"id":"feb2a12e_5c7612cb","line":69,"range":{"start_line":69,"start_character":4,"end_line":69,"end_character":23},"updated":"2021-05-04 08:17:06.000000000","message":"I guess that \"if;then;fi\" isn\u0027t mandatory in this case, correct?\nI\u0027m not a shell expert and I always use \"if/else\" in my condition.\n\nSo in this case I suppose that all the execution will be stopped or do we only skip the line 70?","commit_id":"632b30df6d3bfe5dba93813f087b1e1b7532a486"},{"author":{"_account_id":17685,"name":"Elod Illes","email":"elod.illes@est.tech","username":"elod.illes"},"change_message_id":"56b95683a634345436c9c6124b0a6bfb87089774","unresolved":true,"context_lines":[{"line_number":66,"context_line":"function no_open_patches {"},{"line_number":67,"context_line":"    req\u003d\"${GERRIT_URL}/changes/?q\u003dstatus:open+project:${repo}+branch:stable/${em_serie}\""},{"line_number":68,"context_line":"    patches\u003d$(curl -s ${req} | sed 1d | jq --raw-output \u0027.[] | .change_id\u0027)"},{"line_number":69,"context_line":"    [ -z \"${patches}\" ]"},{"line_number":70,"context_line":"    no_opens\u003d$?"},{"line_number":71,"context_line":"    if [[ \"$no_opens\" -eq 1 ]]; then"},{"line_number":72,"context_line":"        echo \"Patches remained open on stale branch (make sure to abandon them):\""}],"source_content_type":"text/x-sh","patch_set":1,"id":"5891c8b6_efa65e1c","line":69,"range":{"start_line":69,"start_character":4,"end_line":69,"end_character":23},"in_reply_to":"fb2b00fb_da5ac82e","updated":"2021-05-04 13:20:08.000000000","message":"Just as Boyron wrote :) thanks for the explanation. Yes, maybe I could have used \u0027test\u0027 for readability.","commit_id":"632b30df6d3bfe5dba93813f087b1e1b7532a486"},{"author":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"change_message_id":"d8e4df0a22c37f154cb2ab104a134a499b2916d7","unresolved":true,"context_lines":[{"line_number":66,"context_line":"function no_open_patches {"},{"line_number":67,"context_line":"    req\u003d\"${GERRIT_URL}/changes/?q\u003dstatus:open+project:${repo}+branch:stable/${em_serie}\""},{"line_number":68,"context_line":"    patches\u003d$(curl -s ${req} | sed 1d | jq --raw-output \u0027.[] | .change_id\u0027)"},{"line_number":69,"context_line":"    [ -z \"${patches}\" ]"},{"line_number":70,"context_line":"    no_opens\u003d$?"},{"line_number":71,"context_line":"    if [[ \"$no_opens\" -eq 1 ]]; then"},{"line_number":72,"context_line":"        echo \"Patches remained open on stale branch (make sure to abandon them):\""}],"source_content_type":"text/x-sh","patch_set":1,"id":"fb2b00fb_da5ac82e","line":69,"range":{"start_line":69,"start_character":4,"end_line":69,"end_character":23},"in_reply_to":"feb2a12e_5c7612cb","updated":"2021-05-04 12:34:46.000000000","message":"After digging a bit about this kind of test they looks correct to me","commit_id":"632b30df6d3bfe5dba93813f087b1e1b7532a486"},{"author":{"_account_id":27380,"name":"Boyron Sébastien","email":"sboyron@redhat.com","username":"sboyron"},"change_message_id":"47d2fdd5520fd849613232ee93d660a098dfcf27","unresolved":false,"context_lines":[{"line_number":66,"context_line":"function no_open_patches {"},{"line_number":67,"context_line":"    req\u003d\"${GERRIT_URL}/changes/?q\u003dstatus:open+project:${repo}+branch:stable/${em_serie}\""},{"line_number":68,"context_line":"    patches\u003d$(curl -s ${req} | sed 1d | jq --raw-output \u0027.[] | .change_id\u0027)"},{"line_number":69,"context_line":"    [ -z \"${patches}\" ]"},{"line_number":70,"context_line":"    no_opens\u003d$?"},{"line_number":71,"context_line":"    if [[ \"$no_opens\" -eq 1 ]]; then"},{"line_number":72,"context_line":"        echo \"Patches remained open on stale branch (make sure to abandon them):\""}],"source_content_type":"text/x-sh","patch_set":1,"id":"0fd78501_c7195cb7","line":69,"range":{"start_line":69,"start_character":4,"end_line":69,"end_character":23},"in_reply_to":"feb2a12e_5c7612cb","updated":"2021-05-04 12:25:29.000000000","message":"Not using if is correct here, the idea is to save the return if this command to no_opens var. If $patches is empty then no_opens will be 0.\nThe goal is not to execute a command or a block regarding the condition.\n\nThis could also have been written : test -z \"${patches}\" \n\nThis ([ .. ]) is only compatible with bash, but since the shebang is bash, it is valid.\n\n\nThis ensure running only once the -z test to perform the echo and to return the status.","commit_id":"632b30df6d3bfe5dba93813f087b1e1b7532a486"},{"author":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"change_message_id":"6978645fccdb3a8a5f35a26aa4957aaccd5c2176","unresolved":true,"context_lines":[{"line_number":77,"context_line":""},{"line_number":78,"context_line":"function eol_tag_matches_head {"},{"line_number":79,"context_line":"    head\u003d$(git log --oneline --decorate -1)"},{"line_number":80,"context_line":"    [[ \"$head\" \u003d~ \"${em_serie}-eol\" ]] \u0026\u0026 [[ \"$head\" \u003d~ \"origin/stable/${em_serie}\" ]]"},{"line_number":81,"context_line":"    matches\u003d$?"},{"line_number":82,"context_line":"    if [[ \"$matches\" -eq 1 ]] ; then"},{"line_number":83,"context_line":"        echo \"stable/${em_serie} has patches on top of the ${em_serie}-eol tag\""}],"source_content_type":"text/x-sh","patch_set":1,"id":"e810f5db_368eff45","line":80,"range":{"start_line":80,"start_character":4,"end_line":80,"end_character":86},"updated":"2021-05-04 08:17:06.000000000","message":"More or less the same question here","commit_id":"632b30df6d3bfe5dba93813f087b1e1b7532a486"},{"author":{"_account_id":27380,"name":"Boyron Sébastien","email":"sboyron@redhat.com","username":"sboyron"},"change_message_id":"47d2fdd5520fd849613232ee93d660a098dfcf27","unresolved":false,"context_lines":[{"line_number":77,"context_line":""},{"line_number":78,"context_line":"function eol_tag_matches_head {"},{"line_number":79,"context_line":"    head\u003d$(git log --oneline --decorate -1)"},{"line_number":80,"context_line":"    [[ \"$head\" \u003d~ \"${em_serie}-eol\" ]] \u0026\u0026 [[ \"$head\" \u003d~ \"origin/stable/${em_serie}\" ]]"},{"line_number":81,"context_line":"    matches\u003d$?"},{"line_number":82,"context_line":"    if [[ \"$matches\" -eq 1 ]] ; then"},{"line_number":83,"context_line":"        echo \"stable/${em_serie} has patches on top of the ${em_serie}-eol tag\""}],"source_content_type":"text/x-sh","patch_set":1,"id":"adfdbf1b_8da3db47","line":80,"range":{"start_line":80,"start_character":4,"end_line":80,"end_character":86},"in_reply_to":"e810f5db_368eff45","updated":"2021-05-04 12:25:29.000000000","message":"It\u0027s the same here with a bit more complex test.","commit_id":"632b30df6d3bfe5dba93813f087b1e1b7532a486"},{"author":{"_account_id":27380,"name":"Boyron Sébastien","email":"sboyron@redhat.com","username":"sboyron"},"change_message_id":"5e7c7948bcfb13462c969cb37c05f3553775ac69","unresolved":true,"context_lines":[{"line_number":99,"context_line":"                ${TOOLSDIR}/delete_stable_branch.py ${gerrit_username} ${repo} ${em_serie}"},{"line_number":100,"context_line":"            fi"},{"line_number":101,"context_line":"        fi"},{"line_number":102,"context_line":"        cd .."},{"line_number":103,"context_line":"    fi"},{"line_number":104,"context_line":"}"},{"line_number":105,"context_line":""}],"source_content_type":"text/x-sh","patch_set":1,"id":"72b9e65f_ec3fea99","line":102,"range":{"start_line":102,"start_character":12,"end_line":102,"end_character":13},"updated":"2021-05-04 12:41:51.000000000","message":"Is\u0027nt it more relevant to use \"pushd ${repo}\" then \"popd\" to leave the script in the initial dir ? \n\nOr using \"cd -\" instead of \"cd ..\" which is going to parentdir of $repo and this can be a different dir than the original one.","commit_id":"632b30df6d3bfe5dba93813f087b1e1b7532a486"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"e4f738cc4ac4db1a3610aa570905064e6d70299f","unresolved":true,"context_lines":[{"line_number":99,"context_line":"                ${TOOLSDIR}/delete_stable_branch.py ${gerrit_username} ${repo} ${em_serie}"},{"line_number":100,"context_line":"            fi"},{"line_number":101,"context_line":"        fi"},{"line_number":102,"context_line":"        cd .."},{"line_number":103,"context_line":"    fi"},{"line_number":104,"context_line":"}"},{"line_number":105,"context_line":""}],"source_content_type":"text/x-sh","patch_set":1,"id":"6333aa4d_3d9f7f1c","line":102,"range":{"start_line":102,"start_character":12,"end_line":102,"end_character":13},"in_reply_to":"72b9e65f_ec3fea99","updated":"2021-05-04 13:15:07.000000000","message":"I typically use pushd/popd as there\u0027s less chance for things to go wildly wrong. But it looks like things should be safe in this case. Maybe something that can be looked at for a follow up.","commit_id":"632b30df6d3bfe5dba93813f087b1e1b7532a486"},{"author":{"_account_id":17685,"name":"Elod Illes","email":"elod.illes@est.tech","username":"elod.illes"},"change_message_id":"56b95683a634345436c9c6124b0a6bfb87089774","unresolved":true,"context_lines":[{"line_number":99,"context_line":"                ${TOOLSDIR}/delete_stable_branch.py ${gerrit_username} ${repo} ${em_serie}"},{"line_number":100,"context_line":"            fi"},{"line_number":101,"context_line":"        fi"},{"line_number":102,"context_line":"        cd .."},{"line_number":103,"context_line":"    fi"},{"line_number":104,"context_line":"}"},{"line_number":105,"context_line":""}],"source_content_type":"text/x-sh","patch_set":1,"id":"c6349d9f_dcdf6001","line":102,"range":{"start_line":102,"start_character":12,"end_line":102,"end_character":13},"in_reply_to":"72b9e65f_ec3fea99","updated":"2021-05-04 13:20:08.000000000","message":"The thing I don\u0027t like about pushd and popd is that they don\u0027t have a \u0027quiet\u0027 parameter :) otherwise I was thinking about using them. :)\n\nOf course if you still suggest to use pushd-popd, then I can do that (and simply use 2\u003e\u00261 \u003e/dev/null to make them \u0027quiet\u0027 maybe)","commit_id":"632b30df6d3bfe5dba93813f087b1e1b7532a486"}]}
