From: Laura Flores Date: Mon, 26 Jan 2026 21:46:13 +0000 (-0600) Subject: script: improve qa-summary.sh script X-Git-Tag: testing/wip-vshankar-testing-20260226.041846~9^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4a9afd77c5aad9a0a629545f1d4c853324996408;p=ceph-ci.git script: improve qa-summary.sh script This commit improves performance by reducing the number of redmine API calls. It also adds an option to generate more detail about each ticket. Signed-off-by: Laura Flores --- diff --git a/src/script/qa-summary.sh b/src/script/qa-summary.sh index 3d11d1c4202..bd68bb10db8 100755 --- a/src/script/qa-summary.sh +++ b/src/script/qa-summary.sh @@ -15,7 +15,7 @@ Help: qa-summary.sh --help Usage: - qa-summary.sh < test_failure_tickets.txt + qa-summary.sh < test_failure_tickets.txt {--detail} Before running the script, prep a 'test_failure_tickets.txt' file (name is subjective) containing links to all the tracker tickets @@ -31,21 +31,18 @@ $ cat test_failure_tickets.txt https://tracker.ceph.com/issues/71506 https://tracker.ceph.com/issues/71182 +To print more detail about assignee, priority, and status +for each ticket, append the "--detail" flag to your command. + EOM } -function extract_tracker_project { - redmine_url=$1 - remote_api_output="$(curl --silent "${redmine_url}.json")" - project="$(echo "$remote_api_output" | jq -r '.issue.project.name')" - echo "$project" -} +DETAIL=false -function extract_tracker_subject { - redmine_url=$1 - remote_api_output="$(curl --silent "${redmine_url}.json")" - subject="$(echo "$remote_api_output" | jq -r '.issue.subject')" - echo "$subject" +function extract_json { + redmine_url=$1 + json_output="$(curl --silent "${redmine_url}.json")" + echo "$json_output" } @@ -54,6 +51,10 @@ if [ "$1" == "--help" ]; then exit fi +if [ "$1" == "--detail" ]; then + DETAIL=true +fi + # Check for std input if [[ -t 0 ]] then @@ -65,8 +66,12 @@ fi printf "\nFailures, unrelated:\n\n" failure_num=1 while IFS= read -r arg || [ -n "$arg" ]; do - project="$(extract_tracker_project $arg)" - subject="$(extract_tracker_subject $arg)" + json_output="$(extract_json $arg)" + project="$(echo "$json_output" | jq -r '.issue.project.name')" + subject="$(echo "$json_output" | jq -r '.issue.subject')" + assignee="$(echo "$json_output" | jq -r '.issue.assigned_to.name')" + priority="$(echo "$json_output" | jq -r '.issue.priority.name')" + stat="$(echo "$json_output" | jq -r '.issue.status.name')" if [ -z "${project}" ]; then echo "Could not find a project for the following ticket: $arg" exit @@ -75,7 +80,20 @@ while IFS= read -r arg || [ -n "$arg" ]; do echo "Could not find a subject for the following ticket: $arg" exit fi + if [ -z "${priority}" ]; then + echo "Could not find a priority for the following ticket: $arg" + exit + fi + if [ -z "${stat}" ]; then + echo "Could not find a status for the following ticket: $arg" + exit + fi echo "$failure_num. $arg - $subject - ($project)" + if $DETAIL; then + echo " Priority: $priority" + echo " Assignee: $assignee" + echo " Status: $stat" + fi ((failure_num++)) done