Skip to content

Commit

Permalink
change from string to *ybversion.YBVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
makalaaneesh committed Dec 9, 2024
1 parent ea6f6e5 commit e17b81d
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 20 deletions.
2 changes: 1 addition & 1 deletion yb-voyager/cmd/analyzeSchema.go
Original file line number Diff line number Diff line change
Expand Up @@ -1218,7 +1218,7 @@ func packAndSendAnalyzeSchemaPayload(status string) {
}

analyzePayload := callhome.AnalyzePhasePayload{
TargetDbVersion: schemaAnalysisReport.TargetDBVersion.String(),
TargetDbVersion: schemaAnalysisReport.TargetDBVersion,
Issues: callhome.MarshalledJsonString(callhomeIssues),
DatabaseObjects: callhome.MarshalledJsonString(lo.Map(schemaAnalysisReport.SchemaSummary.DBObjects, func(dbObject utils.DBObject, _ int) utils.DBObject {
dbObject.ObjectNames = ""
Expand Down
4 changes: 2 additions & 2 deletions yb-voyager/cmd/assessMigrationCommand.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func packAndSendAssessMigrationPayload(status string, errMsg string) {
})

assessPayload := callhome.AssessMigrationPhasePayload{
TargetDbVersion: assessmentReport.TargetDBVersion.String(),
TargetDbVersion: assessmentReport.TargetDBVersion,
MigrationComplexity: assessmentReport.MigrationComplexity,
UnsupportedFeatures: callhome.MarshalledJsonString(lo.Map(assessmentReport.UnsupportedFeatures, func(feature UnsupportedFeature, _ int) callhome.UnsupportedFeature {
var objects []string
Expand Down Expand Up @@ -474,7 +474,7 @@ func createMigrationAssessmentCompletedEvent() *cp.MigrationAssessmentCompletedE
payload := AssessMigrationPayload{
PayloadVersion: ASSESS_MIGRATION_PAYLOAD_VERSION,
VoyagerVersion: assessmentReport.VoyagerVersion,
TargetDbVersion: assessmentReport.TargetDBVersion.String(),
TargetDbVersion: assessmentReport.TargetDBVersion,
MigrationComplexity: assessmentReport.MigrationComplexity,
SchemaSummary: assessmentReport.SchemaSummary,
AssessmentIssues: assessmentIssues,
Expand Down
2 changes: 1 addition & 1 deletion yb-voyager/cmd/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -1224,7 +1224,7 @@ type AssessMigrationDBConfig struct {
type AssessMigrationPayload struct {
PayloadVersion string
VoyagerVersion string
TargetDbVersion string
TargetDbVersion *ybversion.YBVersion
MigrationComplexity string
SchemaSummary utils.SchemaSummary
AssessmentIssues []AssessmentIssuePayload
Expand Down
33 changes: 17 additions & 16 deletions yb-voyager/src/callhome/diagnostics.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
log "github.com/sirupsen/logrus"

"github.com/yugabyte/yb-voyager/yb-voyager/src/utils"
"github.com/yugabyte/yb-voyager/yb-voyager/src/ybversion"
)

// call-home json formats
Expand Down Expand Up @@ -103,19 +104,19 @@ type UnsupportedFeature struct {
}

type AssessMigrationPhasePayload struct {
TargetDbVersion string `json:"target_db_version"`
MigrationComplexity string `json:"migration_complexity"`
UnsupportedFeatures string `json:"unsupported_features"`
UnsupportedDatatypes string `json:"unsupported_datatypes"`
UnsupportedQueryConstructs string `json:"unsupported_query_constructs"`
MigrationCaveats string `json:"migration_caveats"`
UnsupportedPlPgSqlObjects string `json:"unsupported_plpgsql_objects"`
Error string `json:"error,omitempty"` // Removed it for now, TODO
TableSizingStats string `json:"table_sizing_stats"`
IndexSizingStats string `json:"index_sizing_stats"`
SchemaSummary string `json:"schema_summary"`
SourceConnectivity bool `json:"source_connectivity"`
IopsInterval int64 `json:"iops_interval"`
TargetDbVersion *ybversion.YBVersion `json:"target_db_version"`
MigrationComplexity string `json:"migration_complexity"`
UnsupportedFeatures string `json:"unsupported_features"`
UnsupportedDatatypes string `json:"unsupported_datatypes"`
UnsupportedQueryConstructs string `json:"unsupported_query_constructs"`
MigrationCaveats string `json:"migration_caveats"`
UnsupportedPlPgSqlObjects string `json:"unsupported_plpgsql_objects"`
Error string `json:"error,omitempty"` // Removed it for now, TODO
TableSizingStats string `json:"table_sizing_stats"`
IndexSizingStats string `json:"index_sizing_stats"`
SchemaSummary string `json:"schema_summary"`
SourceConnectivity bool `json:"source_connectivity"`
IopsInterval int64 `json:"iops_interval"`
}

type AssessMigrationBulkPhasePayload struct {
Expand All @@ -140,9 +141,9 @@ type ExportSchemaPhasePayload struct {
// SHOULD NOT REMOVE THESE TWO (issues, database_objects) FIELDS of AnalyzePhasePayload as parsing these specifically here
// https://github.com/yugabyte/yugabyte-growth/blob/ad5df306c50c05136df77cd6548a1091ae577046/diagnostics_v2/main.py#L563
type AnalyzePhasePayload struct {
TargetDbVersion string `json:"target_db_version"`
Issues string `json:"issues"`
DatabaseObjects string `json:"database_objects"`
TargetDbVersion *ybversion.YBVersion `json:"target_db_version"`
Issues string `json:"issues"`
DatabaseObjects string `json:"database_objects"`
}
type ExportDataPhasePayload struct {
ParallelJobs int64 `json:"parallel_jobs"`
Expand Down

0 comments on commit e17b81d

Please sign in to comment.