From b5e654ec45b2cc24ccd857271b5e59a8f25636ef Mon Sep 17 00:00:00 2001 From: Feny Mehta Date: Mon, 20 Jan 2025 16:12:15 +0530 Subject: [PATCH 01/11] KUBESAW-174: Print error output for repos where verification failed Signed-off-by: Feny Mehta --- scripts/verify-replace.sh | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/scripts/verify-replace.sh b/scripts/verify-replace.sh index 1df85273..ef68d5a9 100755 --- a/scripts/verify-replace.sh +++ b/scripts/verify-replace.sh @@ -5,7 +5,10 @@ GH_BASE_URL_KS=https://github.com/kubesaw/ GH_BASE_URL_CRT=https://github.com/codeready-toolchain/ declare -a REPOS=("${GH_BASE_URL_KS}ksctl" "${GH_BASE_URL_CRT}host-operator" "${GH_BASE_URL_CRT}member-operator" "${GH_BASE_URL_CRT}registration-service" "${GH_BASE_URL_CRT}toolchain-e2e" "${GH_BASE_URL_CRT}toolchain-common") C_PATH=${PWD} -ERRORLIST=() +ERRORREPOLIST=() +ERRORFILELIST=() +GOLINTREGEX="[\s\w.\/]*:[0-9]*:[0-9]*:[\s\w]*[:]*[\s\w\">.-]*[\w\s)(*.]*" +ERRORREGEX="Error[:]*" echo Initiating verify-replace on dependent repos for repo in "${REPOS[@]}" @@ -16,27 +19,45 @@ do echo echo ========================================================================================= repo_path=${BASE_REPO_PATH}/$(basename ${repo}) + ERRFILE=$(mktemp ${TMP_DIR}$(basename ${repo}).XXX) echo "Cloning repo in /tmp" git clone --depth=1 ${repo} ${repo_path} echo "Repo cloned successfully" cd ${repo_path} if ! make pre-verify; then - ERRORLIST+="($(basename ${repo}))" + ERRORREPOLIST+="($(basename ${repo}))" continue fi echo "Initiating 'go mod replace' of current api version in dependent repos" go mod edit -replace github.com/codeready-toolchain/api=${C_PATH} - make verify-dependencies || ERRORLIST+="($(basename ${repo}))" + make verify-dependencies &> ${ERRFILE} + rc=$? + if [ ${rc} -ne 0 ]; then + ERRORREPOLIST+="($(basename ${repo}))" + ERRORFILELIST+="${ERRFILE} " + fi echo echo ========================================================================================= echo done -if [ ${#ERRORLIST[@]} -ne 0 ]; then +echo "Summary" +if [ ${#ERRORREPOLIST[@]} -ne 0 ]; then echo "Below are the repos with error: " - for e in ${ERRORLIST[*]} + for e in ${ERRORREPOLIST[*]} do echo "${e}" done + for c in ${ERRORFILELIST[*]} + do + echo + echo ========================================================================================= + echo + echo "${c} has the following errors " + echo + echo ========================================================================================= + echo + cat "${c}" | grep "${GOLINTREGEX}\|${ERRORREGEX}" + done exit 1 else echo "No errors detected" From 699a0f5c4b4417b1bf81a4b7cd2bfecd08dcd9cb Mon Sep 17 00:00:00 2001 From: Feny Mehta Date: Wed, 22 Jan 2025 12:04:28 +0530 Subject: [PATCH 02/11] Review comments for regex Signed-off-by: Feny Mehta --- scripts/verify-replace.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/verify-replace.sh b/scripts/verify-replace.sh index ef68d5a9..f8c6053c 100755 --- a/scripts/verify-replace.sh +++ b/scripts/verify-replace.sh @@ -7,7 +7,7 @@ declare -a REPOS=("${GH_BASE_URL_KS}ksctl" "${GH_BASE_URL_CRT}host-operator" "${ C_PATH=${PWD} ERRORREPOLIST=() ERRORFILELIST=() -GOLINTREGEX="[\s\w.\/]*:[0-9]*:[0-9]*:[\s\w]*[:]*[\s\w\">.-]*[\w\s)(*.]*" +GOLINTREGEX="[\s\w.\/]*:[0-9]*:[0-9]*:[\w\s)(*.\`]*" ERRORREGEX="Error[:]*" echo Initiating verify-replace on dependent repos @@ -19,13 +19,13 @@ do echo echo ========================================================================================= repo_path=${BASE_REPO_PATH}/$(basename ${repo}) - ERRFILE=$(mktemp ${TMP_DIR}$(basename ${repo}).XXX) + ERRFILE=$(mktemp ${TMP_DIR}$(basename ${repo})-error.XXX) echo "Cloning repo in /tmp" git clone --depth=1 ${repo} ${repo_path} echo "Repo cloned successfully" cd ${repo_path} if ! make pre-verify; then - ERRORREPOLIST+="($(basename ${repo}))" + ERRORREPOLIST+="$(basename ${repo}) " continue fi echo "Initiating 'go mod replace' of current api version in dependent repos" @@ -33,14 +33,14 @@ do make verify-dependencies &> ${ERRFILE} rc=$? if [ ${rc} -ne 0 ]; then - ERRORREPOLIST+="($(basename ${repo}))" + ERRORREPOLIST+="$(basename ${repo}) " ERRORFILELIST+="${ERRFILE} " fi echo echo ========================================================================================= echo done -echo "Summary" +echo "Summary" if [ ${#ERRORREPOLIST[@]} -ne 0 ]; then echo "Below are the repos with error: " for e in ${ERRORREPOLIST[*]} @@ -52,7 +52,7 @@ if [ ${#ERRORREPOLIST[@]} -ne 0 ]; then echo echo ========================================================================================= echo - echo "${c} has the following errors " + echo "${c} has the following errors " echo echo ========================================================================================= echo From 2f3711b767618a9bf04028c9209faac0e5f26f0c Mon Sep 17 00:00:00 2001 From: Feny Mehta Date: Thu, 23 Jan 2025 17:16:16 +0530 Subject: [PATCH 03/11] review comments on stderr,stdoutput Signed-off-by: Feny Mehta --- scripts/verify-replace.sh | 46 +++++++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/scripts/verify-replace.sh b/scripts/verify-replace.sh index f8c6053c..de368f81 100755 --- a/scripts/verify-replace.sh +++ b/scripts/verify-replace.sh @@ -7,8 +7,9 @@ declare -a REPOS=("${GH_BASE_URL_KS}ksctl" "${GH_BASE_URL_CRT}host-operator" "${ C_PATH=${PWD} ERRORREPOLIST=() ERRORFILELIST=() +STDOUTFILELIST=() GOLINTREGEX="[\s\w.\/]*:[0-9]*:[0-9]*:[\w\s)(*.\`]*" -ERRORREGEX="Error[:]*" +LINTERERRORFILE=$(mktemp ${TMP_DIR}LinterError.XXX) echo Initiating verify-replace on dependent repos for repo in "${REPOS[@]}" @@ -17,9 +18,10 @@ do echo echo "$(basename ${repo})" echo - echo ========================================================================================= + echo ========================================================================================= repo_path=${BASE_REPO_PATH}/$(basename ${repo}) ERRFILE=$(mktemp ${TMP_DIR}$(basename ${repo})-error.XXX) + STDOUTFILE=$(mktemp ${TMP_DIR}$(basename ${repo})-output.XXX) echo "Cloning repo in /tmp" git clone --depth=1 ${repo} ${repo_path} echo "Repo cloned successfully" @@ -30,33 +32,45 @@ do fi echo "Initiating 'go mod replace' of current api version in dependent repos" go mod edit -replace github.com/codeready-toolchain/api=${C_PATH} - make verify-dependencies &> ${ERRFILE} + make verify-dependencies 2> ${ERRFILE} 1> ${STDOUTFILE} rc=$? if [ ${rc} -ne 0 ]; then ERRORREPOLIST+="$(basename ${repo}) " ERRORFILELIST+="${ERRFILE} " + STDOUTFILELIST="${STDOUTFILE} " fi echo echo ========================================================================================= - echo + echo done echo "Summary" if [ ${#ERRORREPOLIST[@]} -ne 0 ]; then echo "Below are the repos with error: " for e in ${ERRORREPOLIST[*]} do - echo "${e}" - done - for c in ${ERRORFILELIST[*]} - do - echo - echo ========================================================================================= - echo - echo "${c} has the following errors " - echo - echo ========================================================================================= - echo - cat "${c}" | grep "${GOLINTREGEX}\|${ERRORREGEX}" + for c in ${ERRORFILELIST[*]} + do + if [[ ${c} =~ ${e} ]]; then + echo + echo ========================================================================================= + echo + echo "${e} has the following errors " + echo + echo ========================================================================================= + echo + cat "${c}" + else + for s in ${STDOUTFILELIST[*]} + do + if [[ ${s} =~ ${e} ]]; then + cat "${s}" | grep -E ${GOLINTREGEX} > lintererror + if ! [ -s "lintererror" ]; then + cat lintererror + fi + fi + done + fi + done done exit 1 else From f29353b446701ece37e2e5554fed2c339500b558 Mon Sep 17 00:00:00 2001 From: Feny Mehta Date: Mon, 27 Jan 2025 16:21:25 +0530 Subject: [PATCH 04/11] rc Signed-off-by: Feny Mehta --- scripts/verify-replace.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/verify-replace.sh b/scripts/verify-replace.sh index de368f81..2d180071 100755 --- a/scripts/verify-replace.sh +++ b/scripts/verify-replace.sh @@ -63,9 +63,9 @@ if [ ${#ERRORREPOLIST[@]} -ne 0 ]; then for s in ${STDOUTFILELIST[*]} do if [[ ${s} =~ ${e} ]]; then - cat "${s}" | grep -E ${GOLINTREGEX} > lintererror - if ! [ -s "lintererror" ]; then - cat lintererror + cat "${s}" | grep -E ${GOLINTREGEX} > LINTERERRORFILE + if ! [ -s "LINTERERRORFILE" ]; then + cat LINTERERRORFILE fi fi done From 91d17fc2713863e7e6596f41b8f6a479b78ebc02 Mon Sep 17 00:00:00 2001 From: Feny Mehta Date: Mon, 27 Jan 2025 17:43:58 +0530 Subject: [PATCH 05/11] a silly mis of $ sign Signed-off-by: Feny Mehta --- scripts/verify-replace.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/verify-replace.sh b/scripts/verify-replace.sh index 2d180071..493badb1 100755 --- a/scripts/verify-replace.sh +++ b/scripts/verify-replace.sh @@ -63,9 +63,9 @@ if [ ${#ERRORREPOLIST[@]} -ne 0 ]; then for s in ${STDOUTFILELIST[*]} do if [[ ${s} =~ ${e} ]]; then - cat "${s}" | grep -E ${GOLINTREGEX} > LINTERERRORFILE - if ! [ -s "LINTERERRORFILE" ]; then - cat LINTERERRORFILE + cat "${s}" | grep -E ${GOLINTREGEX} > ${LINTERERRORFILE} + if ! [ -s "${LINTERERRORFILE}" ]; then + cat "${LINTERERRORFILE}" fi fi done From facea7aefd511689dc53cff06373413f2dc43986 Mon Sep 17 00:00:00 2001 From: Feny Mehta Date: Thu, 30 Jan 2025 11:19:35 +0530 Subject: [PATCH 06/11] extra loops removed Signed-off-by: Feny Mehta --- scripts/verify-replace.sh | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/scripts/verify-replace.sh b/scripts/verify-replace.sh index 493badb1..0ef44b46 100755 --- a/scripts/verify-replace.sh +++ b/scripts/verify-replace.sh @@ -9,7 +9,6 @@ ERRORREPOLIST=() ERRORFILELIST=() STDOUTFILELIST=() GOLINTREGEX="[\s\w.\/]*:[0-9]*:[0-9]*:[\w\s)(*.\`]*" -LINTERERRORFILE=$(mktemp ${TMP_DIR}LinterError.XXX) echo Initiating verify-replace on dependent repos for repo in "${REPOS[@]}" @@ -20,8 +19,10 @@ do echo echo ========================================================================================= repo_path=${BASE_REPO_PATH}/$(basename ${repo}) - ERRFILE=$(mktemp ${TMP_DIR}$(basename ${repo})-error.XXX) - STDOUTFILE=$(mktemp ${TMP_DIR}$(basename ${repo})-output.XXX) + err_file=$(mktemp ${BASE_REPO_PATH}/$(basename ${repo})-error.XXX) + echo "error output file : ${err_file}" + stdout_file=$(mktemp ${BASE_REPO_PATH}/$(basename ${repo})-output.XXX) + echo "std output file : ${stdout_file}" echo "Cloning repo in /tmp" git clone --depth=1 ${repo} ${repo_path} echo "Repo cloned successfully" @@ -32,41 +33,43 @@ do fi echo "Initiating 'go mod replace' of current api version in dependent repos" go mod edit -replace github.com/codeready-toolchain/api=${C_PATH} - make verify-dependencies 2> ${ERRFILE} 1> ${STDOUTFILE} + make verify-dependencies 2> >(tee ${err_file}) 1> >(tee ${stdout_file}) rc=$? if [ ${rc} -ne 0 ]; then ERRORREPOLIST+="$(basename ${repo}) " - ERRORFILELIST+="${ERRFILE} " - STDOUTFILELIST="${STDOUTFILE} " + ERRORFILELIST+="${err_file} " + STDOUTFILELIST+="${stdout_file} " fi echo echo ========================================================================================= - echo + echo done echo "Summary" if [ ${#ERRORREPOLIST[@]} -ne 0 ]; then echo "Below are the repos with error: " - for e in ${ERRORREPOLIST[*]} + for errorreponame in ${ERRORREPOLIST[*]} do - for c in ${ERRORFILELIST[*]} + for errorfilename in ${ERRORFILELIST[*]} do - if [[ ${c} =~ ${e} ]]; then + if [[ ${errorfilename} =~ ${errorreponame} ]]; then echo echo ========================================================================================= echo - echo "${e} has the following errors " + echo "${errorreponame} has the following errors " echo echo ========================================================================================= echo - cat "${c}" + cat "${errorfilename}" else - for s in ${STDOUTFILELIST[*]} + # Since golint check is the only check for which we parse the error from the standard-ouput + # and is checked at last after all the other checks are done. But if there is any error in the previous checks, + # the script won't go ahead to check golint, and hence this check is seperated and put into else + # Meaning if the other checks have passed then only it wil proceed to check golint and we would parse + # golint errors from std files if any. + for stdoutfilename in ${STDOUTFILELIST[*]} do - if [[ ${s} =~ ${e} ]]; then - cat "${s}" | grep -E ${GOLINTREGEX} > ${LINTERERRORFILE} - if ! [ -s "${LINTERERRORFILE}" ]; then - cat "${LINTERERRORFILE}" - fi + if [[ ${stdoutfilename} =~ ${errorreponame} ]]; then + cat "${stdoutfilename}" | grep -E ${GOLINTREGEX} fi done fi From 0802c7ac264863768963f08e91b067a3bc69652d Mon Sep 17 00:00:00 2001 From: Feny Mehta Date: Thu, 30 Jan 2025 18:07:10 +0530 Subject: [PATCH 07/11] error regex addition and some cosmetic changes Signed-off-by: Feny Mehta --- scripts/verify-replace.sh | 59 +++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/scripts/verify-replace.sh b/scripts/verify-replace.sh index 0ef44b46..b9b44e65 100755 --- a/scripts/verify-replace.sh +++ b/scripts/verify-replace.sh @@ -5,10 +5,12 @@ GH_BASE_URL_KS=https://github.com/kubesaw/ GH_BASE_URL_CRT=https://github.com/codeready-toolchain/ declare -a REPOS=("${GH_BASE_URL_KS}ksctl" "${GH_BASE_URL_CRT}host-operator" "${GH_BASE_URL_CRT}member-operator" "${GH_BASE_URL_CRT}registration-service" "${GH_BASE_URL_CRT}toolchain-e2e" "${GH_BASE_URL_CRT}toolchain-common") C_PATH=${PWD} -ERRORREPOLIST=() -ERRORFILELIST=() -STDOUTFILELIST=() -GOLINTREGEX="[\s\w.\/]*:[0-9]*:[0-9]*:[\w\s)(*.\`]*" +ERROR_REPO_LIST=() +ERROR_FILE_LIST=() +STD_OUT_FILE_LIST=() +GO_LINT_REGEX="[\s\w.\/]*:[0-9]*:[0-9]*:[\w\s)(*.\`]*" +ERROR_REGEX="Error[:]*" #unit test or any other failure we log goes into stdoutput, hence making that regex too to fetch the error +FAIL_REGEX="FAIL[:]*" #unit test or any other failure we log goes into stdoutput, hence making that regex too to fetch the error echo Initiating verify-replace on dependent repos for repo in "${REPOS[@]}" @@ -21,59 +23,56 @@ do repo_path=${BASE_REPO_PATH}/$(basename ${repo}) err_file=$(mktemp ${BASE_REPO_PATH}/$(basename ${repo})-error.XXX) echo "error output file : ${err_file}" - stdout_file=$(mktemp ${BASE_REPO_PATH}/$(basename ${repo})-output.XXX) - echo "std output file : ${stdout_file}" + std_out_file=$(mktemp ${BASE_REPO_PATH}/$(basename ${repo})-output.XXX) + echo "std output file : ${std_out_file}" echo "Cloning repo in /tmp" git clone --depth=1 ${repo} ${repo_path} echo "Repo cloned successfully" cd ${repo_path} - if ! make pre-verify; then - ERRORREPOLIST+="$(basename ${repo}) " + make pre-verify 2> >(tee ${err_file}) + rc=$? + if [ ${rc} -ne 0 ]; then + ERROR_REPO_LIST+="$(basename ${repo}) " + ERROR_FILE_LIST+="${err_file} " continue fi echo "Initiating 'go mod replace' of current api version in dependent repos" go mod edit -replace github.com/codeready-toolchain/api=${C_PATH} - make verify-dependencies 2> >(tee ${err_file}) 1> >(tee ${stdout_file}) + make verify-dependencies 2> >(tee ${err_file}) 1> >(tee ${std_out_file}) rc=$? if [ ${rc} -ne 0 ]; then - ERRORREPOLIST+="$(basename ${repo}) " - ERRORFILELIST+="${err_file} " - STDOUTFILELIST+="${stdout_file} " + ERROR_REPO_LIST+="$(basename ${repo}) " + ERROR_FILE_LIST+="${err_file} " + STD_OUT_FILE_LIST+="${std_out_file} " fi echo echo ========================================================================================= echo done echo "Summary" -if [ ${#ERRORREPOLIST[@]} -ne 0 ]; then +if [ ${#ERROR_REPO_LIST[@]} -ne 0 ]; then echo "Below are the repos with error: " - for errorreponame in ${ERRORREPOLIST[*]} + for error_repo_name in ${ERROR_REPO_LIST[*]} do - for errorfilename in ${ERRORFILELIST[*]} + for error_file_name in ${ERROR_FILE_LIST[*]} do - if [[ ${errorfilename} =~ ${errorreponame} ]]; then + if [[ ${error_file_name} =~ ${error_repo_name} ]]; then echo echo ========================================================================================= echo - echo "${errorreponame} has the following errors " + echo "${error_repo_name} has the following errors " echo echo ========================================================================================= echo - cat "${errorfilename}" - else - # Since golint check is the only check for which we parse the error from the standard-ouput - # and is checked at last after all the other checks are done. But if there is any error in the previous checks, - # the script won't go ahead to check golint, and hence this check is seperated and put into else - # Meaning if the other checks have passed then only it wil proceed to check golint and we would parse - # golint errors from std files if any. - for stdoutfilename in ${STDOUTFILELIST[*]} - do - if [[ ${stdoutfilename} =~ ${errorreponame} ]]; then - cat "${stdoutfilename}" | grep -E ${GOLINTREGEX} - fi - done + cat "${error_file_name}" fi done + for std_out_file_name in ${STD_OUT_FILE_LIST[*]} + do + if [[ ${std_out_file_name} =~ ${error_repo_name} ]]; then + cat "${std_out_file_name}" | grep -E ${GO_LINT_REGEX}|${ERROR_REGEX}|${FAIL_REGEX} + fi + done done exit 1 else From 081eef79a385b43e999f8b759cbb07f9b0f3bcf0 Mon Sep 17 00:00:00 2001 From: Feny Mehta Date: Thu, 30 Jan 2025 19:10:15 +0530 Subject: [PATCH 08/11] improving readability Signed-off-by: Feny Mehta --- scripts/verify-replace.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/verify-replace.sh b/scripts/verify-replace.sh index b9b44e65..1bf09f49 100755 --- a/scripts/verify-replace.sh +++ b/scripts/verify-replace.sh @@ -9,8 +9,7 @@ ERROR_REPO_LIST=() ERROR_FILE_LIST=() STD_OUT_FILE_LIST=() GO_LINT_REGEX="[\s\w.\/]*:[0-9]*:[0-9]*:[\w\s)(*.\`]*" -ERROR_REGEX="Error[:]*" #unit test or any other failure we log goes into stdoutput, hence making that regex too to fetch the error -FAIL_REGEX="FAIL[:]*" #unit test or any other failure we log goes into stdoutput, hence making that regex too to fetch the error +ERROR_REGEX="Error[:]*/|FAIL[:]*" #unit test or any other failure we log from our controllers other places goes into stdoutput, hence making that regex too, to fetch the error more precisely echo Initiating verify-replace on dependent repos for repo in "${REPOS[@]}" @@ -70,7 +69,7 @@ if [ ${#ERROR_REPO_LIST[@]} -ne 0 ]; then for std_out_file_name in ${STD_OUT_FILE_LIST[*]} do if [[ ${std_out_file_name} =~ ${error_repo_name} ]]; then - cat "${std_out_file_name}" | grep -E ${GO_LINT_REGEX}|${ERROR_REGEX}|${FAIL_REGEX} + cat "${std_out_file_name}" | grep -E ${GO_LINT_REGEX}|${ERROR_REGEX} fi done done From 80921aa20db93dbf98ff1a6f9358969a233681ff Mon Sep 17 00:00:00 2001 From: Feny Mehta Date: Fri, 31 Jan 2025 12:03:38 +0530 Subject: [PATCH 09/11] regex update Signed-off-by: Feny Mehta --- scripts/verify-replace.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/verify-replace.sh b/scripts/verify-replace.sh index 1bf09f49..96914bbd 100755 --- a/scripts/verify-replace.sh +++ b/scripts/verify-replace.sh @@ -9,7 +9,9 @@ ERROR_REPO_LIST=() ERROR_FILE_LIST=() STD_OUT_FILE_LIST=() GO_LINT_REGEX="[\s\w.\/]*:[0-9]*:[0-9]*:[\w\s)(*.\`]*" -ERROR_REGEX="Error[:]*/|FAIL[:]*" #unit test or any other failure we log from our controllers other places goes into stdoutput, hence making that regex too, to fetch the error more precisely +ERROR_REGEX="[E\|e][R\|r][R\|r][O\|o][R\|r][:]*\|[F\|f][A\|a][I\|i][l\|L][:]*\|expected[:]*\|actual[:]*" #unit test or any other failure we log from our controllers or other places goes into stdoutput + #(since we log it and its not a failure in running the command or dependency check), + #hence making that regex too, to fetch the error more precisely echo Initiating verify-replace on dependent repos for repo in "${REPOS[@]}" From a3c9f032bec9a239b7d83d1aa5d6ef9fb7ea1eac Mon Sep 17 00:00:00 2001 From: Feny Mehta Date: Fri, 31 Jan 2025 12:58:35 +0530 Subject: [PATCH 10/11] grep _E not working using quotes Signed-off-by: Feny Mehta --- scripts/verify-replace.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/verify-replace.sh b/scripts/verify-replace.sh index 96914bbd..1dc86899 100755 --- a/scripts/verify-replace.sh +++ b/scripts/verify-replace.sh @@ -71,7 +71,7 @@ if [ ${#ERROR_REPO_LIST[@]} -ne 0 ]; then for std_out_file_name in ${STD_OUT_FILE_LIST[*]} do if [[ ${std_out_file_name} =~ ${error_repo_name} ]]; then - cat "${std_out_file_name}" | grep -E ${GO_LINT_REGEX}|${ERROR_REGEX} + cat "${std_out_file_name}" | grep "${GO_LINT_REGEX}\|${ERROR_REGEX}" fi done done From 18f8aba9bf6b015bc8787667cfcc8c8fff9780cf Mon Sep 17 00:00:00 2001 From: Feny Mehta Date: Fri, 31 Jan 2025 15:54:55 +0530 Subject: [PATCH 11/11] cosmetic changes Signed-off-by: Feny Mehta --- scripts/verify-replace.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/verify-replace.sh b/scripts/verify-replace.sh index 1dc86899..0fe65767 100755 --- a/scripts/verify-replace.sh +++ b/scripts/verify-replace.sh @@ -55,23 +55,23 @@ if [ ${#ERROR_REPO_LIST[@]} -ne 0 ]; then echo "Below are the repos with error: " for error_repo_name in ${ERROR_REPO_LIST[*]} do + echo + echo ========================================================================================= + echo + echo "${error_repo_name} has the following errors " + echo + echo ========================================================================================= + echo for error_file_name in ${ERROR_FILE_LIST[*]} do if [[ ${error_file_name} =~ ${error_repo_name} ]]; then - echo - echo ========================================================================================= - echo - echo "${error_repo_name} has the following errors " - echo - echo ========================================================================================= - echo cat "${error_file_name}" fi done for std_out_file_name in ${STD_OUT_FILE_LIST[*]} do if [[ ${std_out_file_name} =~ ${error_repo_name} ]]; then - cat "${std_out_file_name}" | grep "${GO_LINT_REGEX}\|${ERROR_REGEX}" + cat "${std_out_file_name}" | grep -C 5 "${GO_LINT_REGEX}\|${ERROR_REGEX}" fi done done