Skip to content
This repository was archived by the owner on Jul 6, 2021. It is now read-only.

Commit 6c91ebf

Browse files
committed
Merge branch 'dmius-prerelease-fixes' into 'master'
Prerelease fixes See merge request postgres-ai/postgres-checkup!321
2 parents bb88838 + 01ec607 commit 6c91ebf

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

pghrep/src/checkup/a002/a002messages.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ const MSG_ALL_VERSIONS_SAME_CONCLUSION string = "All nodes have the same Postgre
2929

3030
const MSG_NOT_LAST_MINOR_VERSION_RECOMMENDATION string = "[P2] Consider performing upgrade to the newest minor version: `%s`. \n"
3131
const MSG_NO_RECOMMENDATION string = "No recommendations. \n"
32-
const MSG_GENERAL_RECOMMENDATION_1 string = " \n" +
33-
"For more information about minor and major upgrades see: \n" +
32+
const MSG_GENERAL_RECOMMENDATION_1 string = "For more information about minor and major upgrades see: \n" +
3433
" - Official documentation: https://www.postgresql.org/docs/current/upgrading.html \n"
3534

3635
const MSG_GENERAL_RECOMMENDATION_2 string = " - [Major-version upgrading with minimal downtime](https://www.depesz.com/2016/11/08/major-version-upgrading-with-minimal-downtime/) (depesz.com) \n" +

pghrep/src/checkup/checkuputil.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ import (
1313

1414
// General for all reports
1515

16+
const MSG_ALL_GOOD_CONCLUSION string = "Hooray, all good. Keep this up!"
17+
const MSG_NO_RECOMMENDATION string = "No recommendations."
18+
1619
type ReportHost struct {
1720
InternalAlias string `json:"internal_alias"`
1821
Index string `json:"index"`
@@ -99,6 +102,12 @@ func SaveJsonConclusionsRecommendations(data map[string]interface{}, conclusions
99102

100103
func SaveConclusionsRecommendations(data map[string]interface{},
101104
result ReportOutcome) map[string]interface{} {
105+
if len(result.Conclusions) == 0 {
106+
result.AppendConclusion(MSG_ALL_GOOD_CONCLUSION)
107+
}
108+
if len(result.Recommendations) == 0 {
109+
result.AppendRecommendation(MSG_NO_RECOMMENDATION)
110+
}
102111
data["conclusions"] = result.Conclusions
103112
data["recommendations"] = result.Recommendations
104113
data["p1"] = result.P1

0 commit comments

Comments
 (0)