From 1d4bc12bf043882fb6a58349d6ee99c2b16767b3 Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Thu, 29 Apr 2021 12:21:20 +0200 Subject: [PATCH] remove codacy info from comments Signed-off-by: Andy Scherzinger --- scripts/analysis/analysis-wrapper.sh | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/scripts/analysis/analysis-wrapper.sh b/scripts/analysis/analysis-wrapper.sh index 8456002a1..0e00a29ac 100755 --- a/scripts/analysis/analysis-wrapper.sh +++ b/scripts/analysis/analysis-wrapper.sh @@ -46,8 +46,8 @@ else echo "New findbugs results at https://www.kaminsky.me/nc-dev/$repository-findbugs/$6.html" curl 2>/dev/null -u $4:$5 -X PUT https://nextcloud.kaminsky.me/remote.php/webdav/$repository-findbugs/$6.html --upload-file app/build/reports/spotbugs/spotbugs.html - # delete all old comments, starting with Codacy - oldComments=$(curl 2>/dev/null -u $1:$2 -X GET https://api.github.com/repos/nextcloud/talk-android/issues/$7/comments | jq '.[] | (.id |tostring) + "|" + (.user.login | test("nextcloud-android-bot") | tostring) + "|" + (.body | test("

Codacy.*") | tostring)' | grep "true|true" | tr -d "\"" | cut -f1 -d"|") + # delete all old comments + oldComments=$(curl 2>/dev/null -u $1:$2 -X GET https://api.github.com/repos/nextcloud/talk-android/issues/$7/comments | jq '.[] | (.id |tostring) + "|" + (.user.login | test("nextcloud-android-bot") | tostring) ' | grep true | tr -d "\"" | cut -f1 -d"|") echo $oldComments | while read comment ; do curl 2>/dev/null -u $1:$2 -X DELETE https://api.github.com/repos/nextcloud/talk-android/issues/comments/$comment @@ -87,13 +87,6 @@ else if ( [ -z $lintWarningOld ] ); then lintWarningOld=0 fi - - if [ $stableBranch = "master" ] ; then - codacyValue=$(curl 2>/dev/null https://app.codacy.com/gh/nextcloud/talk-android/dashboard | grep "total issues" | cut -d">" -f3 | cut -d"<" -f1) - codacyResult="

Codacy

$codacyValue" - else - codacyResult="" - fi lintResult="

Lint

Type$stableBranchPR
Warnings"$lintWarningOld""$lintWarningNew"
Errors"$lintErrorOld""$lintErrorNew"
" findbugsResultNew=$(sed -n "/

Summary<\/h1>/,/

Warnings<\/h1>/p" app/build/reports/spotbugs/spotbugs.html |head -n-1 | sed s'/<\/a>//'g | sed s'///'g | sed s"#Summary#SpotBugs (new)#" | tr "\"" "\'" | tr -d "\n") @@ -113,7 +106,7 @@ else notNull="org.jetbrains.annotations.NotNull is used. Please use androidx.annotation.NonNull instead.

" fi - curl -u $1:$2 -X POST https://api.github.com/repos/nextcloud/talk-android/issues/$7/comments -d "{ \"body\" : \"$codacyResult $lintResult $findbugsResultNew $findbugsResultOld $lintMessage $findbugsMessage $notNull\" }" + curl -u $1:$2 -X POST https://api.github.com/repos/nextcloud/talk-android/issues/$7/comments -d "{ \"body\" : \"$lintResult $findbugsResultNew $findbugsResultOld $lintMessage $findbugsMessage $notNull\" }" if [ ! $lintValue -eq 2 ]; then exit $lintValue