Skip to content

Commit

Permalink
separate item for each extension
Browse files Browse the repository at this point in the history
  • Loading branch information
makalaaneesh committed Dec 30, 2024
1 parent fa542b7 commit 21badf9
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions yb-voyager/cmd/assessMigrationCommand.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,24 +163,38 @@ func packAndSendAssessMigrationPayload(status string, errMsg string) {
return len(constructs)
})

assessPayload := callhome.AssessMigrationPhasePayload{
TargetDBVersion: assessmentReport.TargetDBVersion,
MigrationComplexity: assessmentReport.MigrationComplexity,
UnsupportedFeatures: callhome.MarshalledJsonString(lo.Map(assessmentReport.UnsupportedFeatures, func(feature UnsupportedFeature, _ int) callhome.UnsupportedFeature {
var unsupportedFeatures []callhome.UnsupportedFeature
for _, feature := range assessmentReport.UnsupportedFeatures {
if feature.FeatureName == EXTENSION_FEATURE {
// For extensions, we need to send the extension name in the feature name
// for better categorization in callhome
for _, object := range feature.Objects {
unsupportedFeatures = append(unsupportedFeatures, callhome.UnsupportedFeature{
FeatureName: fmt.Sprintf("%s - %s", feature.FeatureName, object.ObjectName),
ObjectCount: 1,
TotalOccurrences: 1,
})
}
} else {
var objects []string
if slices.Contains(featuresToSendObjectsToCallhome, feature.FeatureName) {
objects = lo.Map(feature.Objects, func(o ObjectInfo, _ int) string {
return o.ObjectName
})
}
res := callhome.UnsupportedFeature{
unsupportedFeatures = append(unsupportedFeatures, callhome.UnsupportedFeature{
FeatureName: feature.FeatureName,
ObjectCount: len(feature.Objects),
Objects: objects,
TotalOccurrences: len(feature.Objects),
}
return res
})),
})
}
}

assessPayload := callhome.AssessMigrationPhasePayload{
TargetDBVersion: assessmentReport.TargetDBVersion,
MigrationComplexity: assessmentReport.MigrationComplexity,
UnsupportedFeatures: callhome.MarshalledJsonString(unsupportedFeatures),
UnsupportedQueryConstructs: callhome.MarshalledJsonString(countByConstructType),
UnsupportedDatatypes: callhome.MarshalledJsonString(unsupportedDatatypesList),
MigrationCaveats: callhome.MarshalledJsonString(lo.Map(assessmentReport.MigrationCaveats, func(feature UnsupportedFeature, _ int) callhome.UnsupportedFeature {
Expand Down

0 comments on commit 21badf9

Please sign in to comment.