Skip to content

Commit 36da13e

Browse files
Regression/Bug fixes in Oracle html report due to recent refactoring (#2248) (#2250)
* Assigning empty value to Impact column for Oracle assessment report - centre-aligned the impact column values * Populate Issue Type for Oracle unsupported object type cases
1 parent e926c6b commit 36da13e

File tree

4 files changed

+46
-20
lines changed

4 files changed

+46
-20
lines changed

yb-voyager/cmd/assessMigrationCommand.go

+36-18
Original file line numberDiff line numberDiff line change
@@ -1080,40 +1080,51 @@ func fetchUnsupportedObjectTypes() ([]UnsupportedFeature, error) {
10801080
unsupportedIndexes = append(unsupportedIndexes, ObjectInfo{
10811081
ObjectName: fmt.Sprintf("Index Name: %s, Index Type=%s", objectName, objectType),
10821082
})
1083-
1083+
// For oracle migration complexity comes from ora2pg, so defining Impact not required right now
10841084
assessmentReport.AppendIssues(AssessmentIssue{
1085-
Category: UNSUPPORTED_FEATURES_CATEGORY,
1086-
Type: "", // TODO
1087-
Name: UNSUPPORTED_INDEXES_FEATURE,
1088-
ObjectType: "INDEX",
1085+
Category: UNSUPPORTED_FEATURES_CATEGORY,
1086+
CategoryDescription: GetCategoryDescription(UNSUPPORTED_FEATURES_CATEGORY),
1087+
Type: UNSUPPORTED_INDEXES_ISSUE_TYPE,
1088+
Name: UNSUPPORTED_INDEXES_FEATURE,
1089+
Description: "", // TODO
1090+
ObjectType: constants.INDEX,
1091+
// TODO: here it should be only ObjectName, to populate Index Type there should be a separate field
10891092
ObjectName: fmt.Sprintf("Index Name: %s, Index Type=%s", objectName, objectType),
10901093
})
10911094
} else if objectType == VIRTUAL_COLUMN {
10921095
virtualColumns = append(virtualColumns, ObjectInfo{ObjectName: objectName})
10931096
assessmentReport.AppendIssues(AssessmentIssue{
1094-
Category: UNSUPPORTED_FEATURES_CATEGORY,
1095-
Type: "", // TODO
1096-
Name: VIRTUAL_COLUMNS_FEATURE,
1097-
ObjectName: objectName,
1097+
Category: UNSUPPORTED_FEATURES_CATEGORY,
1098+
CategoryDescription: GetCategoryDescription(UNSUPPORTED_FEATURES_CATEGORY),
1099+
Type: VIRTUAL_COLUMNS_ISSUE_TYPE,
1100+
Name: VIRTUAL_COLUMNS_FEATURE,
1101+
Description: "", // TODO
1102+
ObjectType: constants.COLUMN,
1103+
ObjectName: objectName,
10981104
})
10991105
} else if objectType == INHERITED_TYPE {
11001106
inheritedTypes = append(inheritedTypes, ObjectInfo{ObjectName: objectName})
11011107
assessmentReport.AppendIssues(AssessmentIssue{
1102-
Category: UNSUPPORTED_FEATURES_CATEGORY,
1103-
Type: "", // TODO
1104-
Name: INHERITED_TYPES_FEATURE,
1105-
ObjectName: objectName,
1108+
Category: UNSUPPORTED_FEATURES_CATEGORY,
1109+
CategoryDescription: GetCategoryDescription(UNSUPPORTED_FEATURES_CATEGORY),
1110+
Type: INHERITED_TYPES_ISSUE_TYPE,
1111+
Name: INHERITED_TYPES_FEATURE,
1112+
Description: "", // TODO
1113+
ObjectType: constants.TYPE,
1114+
ObjectName: objectName,
11061115
})
11071116
} else if objectType == REFERENCE_PARTITION || objectType == SYSTEM_PARTITION {
11081117
referenceOrTablePartitionPresent = true
11091118
unsupportedPartitionTypes = append(unsupportedPartitionTypes, ObjectInfo{ObjectName: fmt.Sprintf("Table Name: %s, Partition Method: %s", objectName, objectType)})
11101119

1111-
// For oracle migration complexity comes from ora2pg, so defining Impact not required right now
11121120
assessmentReport.AppendIssues(AssessmentIssue{
1113-
Category: UNSUPPORTED_FEATURES_CATEGORY,
1114-
Type: "", // TODO
1115-
Name: UNSUPPORTED_PARTITIONING_METHODS_FEATURE,
1116-
ObjectType: "TABLE",
1121+
Category: UNSUPPORTED_FEATURES_CATEGORY,
1122+
CategoryDescription: GetCategoryDescription(UNSUPPORTED_FEATURES_CATEGORY),
1123+
Type: UNSUPPORTED_PARTITIONING_METHODS_ISSUE_TYPE,
1124+
Name: UNSUPPORTED_PARTITIONING_METHODS_FEATURE,
1125+
Description: "", // TODO
1126+
ObjectType: constants.TABLE,
1127+
// TODO: here it should be only ObjectName, to populate Partition Method there should be a separate field
11171128
ObjectName: fmt.Sprintf("Table Name: %s, Partition Method: %s", objectName, objectType),
11181129
})
11191130
}
@@ -1540,6 +1551,13 @@ func postProcessingOfAssessmentReport() {
15401551
assessmentReport.Sizing.SizingRecommendation.ColocatedTables[i] = parts[1]
15411552
}
15421553
}
1554+
1555+
// redact Impact info from the assessment report for Oracle
1556+
// TODO: Remove this processing step in future when supporting Explanation for Oracle
1557+
for i := range assessmentReport.Issues {
1558+
assessmentReport.Issues[i].Impact = "-"
1559+
}
1560+
15431561
}
15441562
}
15451563

yb-voyager/cmd/constants.go

+6
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,12 @@ const (
195195
UNSUPPORTED_PARTITIONING_METHODS_FEATURE = "Unsupported Partitioning Methods"
196196
COMPOUND_TRIGGER_FEATURE = "Compound Triggers"
197197

198+
// Oracle Issue Type
199+
UNSUPPORTED_INDEXES_ISSUE_TYPE = "UNSUPPORTED_INDEXES"
200+
VIRTUAL_COLUMNS_ISSUE_TYPE = "VIRTUAL_COLUMNS"
201+
INHERITED_TYPES_ISSUE_TYPE = "INHERITED_TYPES"
202+
UNSUPPORTED_PARTITIONING_METHODS_ISSUE_TYPE = "UNSUPPORTED_PARTITIONING_METHODS"
203+
198204
//POSTGRESQL
199205
CONSTRAINT_TRIGGERS_FEATURE = "Constraint triggers"
200206
INHERITED_TABLES_FEATURE = "Inherited tables"

yb-voyager/cmd/templates/migration_assessment_report.template

+2-2
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@
309309
Type <span class="sort-indicator">&#8597</span>
310310
</th>
311311
<th>Object/SQL Preview</th>
312-
<th style="cursor: pointer;" onclick="sortTableBy('impact')">
312+
<th style="cursor: pointer; text-align: center;" onclick="sortTableBy('impact')">
313313
Impact <span class="sort-indicator">&#8597</span>
314314
</th>
315315
</tr>
@@ -337,7 +337,7 @@
337337
{{ end }}
338338
</td>
339339

340-
<td>{{ snakeCaseToTitleCase $issue.Impact }}</td>
340+
<td style="text-align: center;">{{ snakeCaseToTitleCase $issue.Impact }}</td>
341341
</tr>
342342

343343
<!-- Hidden Details of the Row -->

yb-voyager/src/constants/constants.go

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ const (
2020
TABLE = "TABLE"
2121
FUNCTION = "FUNCTION"
2222
COLUMN = "COLUMN"
23+
INDEX = "INDEX"
24+
TYPE = "TYPE"
2325

2426
// Source DB Types
2527
YUGABYTEDB = "yugabytedb"

0 commit comments

Comments
 (0)