Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
chore: update vcs sql review result order (#6830)
ecmadao63e67f84f86d
diff --git a/backend/server/webhook.go b/backend/server/webhook.goindex a01640e874..6894c0bd1e 100644--- a/backend/server/webhook.go+++ b/backend/server/webhook.go@@ -1795,12 +1795,7 @@ func convertSQLAdviceToGitLabCIResult(adviceMap map[string][]advisor.Advice) *aptestsuiteList := []string{}status := advisor.Success- fileList := []string{}- for filePath := range adviceMap {- fileList = append(fileList, filePath)- }- sort.Strings(fileList)-+ fileList := getSQLAdviceFileList(adviceMap)for _, filePath := range fileList {adviceList := adviceMap[filePath]testcaseList := []string{}@@ -1866,12 +1861,7 @@ func convertSQLAdviceToGitHubActionResult(adviceMap map[string][]advisor.Advice)messageList := []string{}status := advisor.Success- fileList := []string{}- for filePath := range adviceMap {- fileList = append(fileList, filePath)- }- sort.Strings(fileList)-+ fileList := getSQLAdviceFileList(adviceMap)for _, filePath := range fileList {adviceList := adviceMap[filePath]for _, advice := range adviceList {@@ -1916,6 +1906,27 @@ func convertSQLAdviceToGitHubActionResult(adviceMap map[string][]advisor.Advice)}}+func getSQLAdviceFileList(adviceMap map[string][]advisor.Advice) []string {+ fileList := []string{}+ fileToErrorCount := map[string]int{}+ for filePath, adviceList := range adviceMap {+ fileList = append(fileList, filePath)++ errorCount := 0+ for _, advice := range adviceList {+ if advice.Status == advisor.Error {+ errorCount+++ }+ }+ fileToErrorCount[filePath] = errorCount+ }+ sort.Slice(fileList, func(i int, j int) bool {+ return fileToErrorCount[fileList[i]] > fileToErrorCount[fileList[j]]+ })++ return fileList+}+func filterGitHubBytebaseCommit(list []github.WebhookCommit) []github.WebhookCommit {var result []github.WebhookCommitfor _, commit := range list {