Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression/Bug fixes in Oracle html report due to recent refactoring #2248

Merged
merged 3 commits into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 36 additions & 18 deletions yb-voyager/cmd/assessMigrationCommand.go
Original file line number Diff line number Diff line change
Expand Up @@ -1080,40 +1080,51 @@ func fetchUnsupportedObjectTypes() ([]UnsupportedFeature, error) {
unsupportedIndexes = append(unsupportedIndexes, ObjectInfo{
ObjectName: fmt.Sprintf("Index Name: %s, Index Type=%s", objectName, objectType),
})

// For oracle migration complexity comes from ora2pg, so defining Impact not required right now
assessmentReport.AppendIssues(AssessmentIssue{
Category: UNSUPPORTED_FEATURES_CATEGORY,
Type: "", // TODO
Name: UNSUPPORTED_INDEXES_FEATURE,
ObjectType: "INDEX",
Category: UNSUPPORTED_FEATURES_CATEGORY,
CategoryDescription: GetCategoryDescription(UNSUPPORTED_FEATURES_CATEGORY),
Type: UNSUPPORTED_INDEXES_ISSUE_TYPE,
Name: UNSUPPORTED_INDEXES_FEATURE,
Description: "", // TODO
ObjectType: constants.INDEX,
// TODO: here it should be only ObjectName, to populate Index Type there should be a separate field
ObjectName: fmt.Sprintf("Index Name: %s, Index Type=%s", objectName, objectType),
})
} else if objectType == VIRTUAL_COLUMN {
virtualColumns = append(virtualColumns, ObjectInfo{ObjectName: objectName})
assessmentReport.AppendIssues(AssessmentIssue{
Category: UNSUPPORTED_FEATURES_CATEGORY,
Type: "", // TODO
Name: VIRTUAL_COLUMNS_FEATURE,
ObjectName: objectName,
Category: UNSUPPORTED_FEATURES_CATEGORY,
CategoryDescription: GetCategoryDescription(UNSUPPORTED_FEATURES_CATEGORY),
Type: VIRTUAL_COLUMNS_ISSUE_TYPE,
Name: VIRTUAL_COLUMNS_FEATURE,
Description: "", // TODO
ObjectType: constants.COLUMN,
ObjectName: objectName,
})
} else if objectType == INHERITED_TYPE {
inheritedTypes = append(inheritedTypes, ObjectInfo{ObjectName: objectName})
assessmentReport.AppendIssues(AssessmentIssue{
Category: UNSUPPORTED_FEATURES_CATEGORY,
Type: "", // TODO
Name: INHERITED_TYPES_FEATURE,
ObjectName: objectName,
Category: UNSUPPORTED_FEATURES_CATEGORY,
CategoryDescription: GetCategoryDescription(UNSUPPORTED_FEATURES_CATEGORY),
Type: INHERITED_TYPES_ISSUE_TYPE,
Name: INHERITED_TYPES_FEATURE,
Description: "", // TODO
ObjectType: constants.TYPE,
ObjectName: objectName,
})
} else if objectType == REFERENCE_PARTITION || objectType == SYSTEM_PARTITION {
referenceOrTablePartitionPresent = true
unsupportedPartitionTypes = append(unsupportedPartitionTypes, ObjectInfo{ObjectName: fmt.Sprintf("Table Name: %s, Partition Method: %s", objectName, objectType)})

// For oracle migration complexity comes from ora2pg, so defining Impact not required right now
assessmentReport.AppendIssues(AssessmentIssue{
Category: UNSUPPORTED_FEATURES_CATEGORY,
Type: "", // TODO
Name: UNSUPPORTED_PARTITIONING_METHODS_FEATURE,
ObjectType: "TABLE",
Category: UNSUPPORTED_FEATURES_CATEGORY,
CategoryDescription: GetCategoryDescription(UNSUPPORTED_FEATURES_CATEGORY),
Type: UNSUPPORTED_PARTITIONING_METHODS_ISSUE_TYPE,
Name: UNSUPPORTED_PARTITIONING_METHODS_FEATURE,
Description: "", // TODO
ObjectType: constants.TABLE,
// TODO: here it should be only ObjectName, to populate Partition Method there should be a separate field
ObjectName: fmt.Sprintf("Table Name: %s, Partition Method: %s", objectName, objectType),
})
}
Expand Down Expand Up @@ -1540,6 +1551,13 @@ func postProcessingOfAssessmentReport() {
assessmentReport.Sizing.SizingRecommendation.ColocatedTables[i] = parts[1]
}
}

// redact Impact info from the assessment report for Oracle
// TODO: Remove this processing step in future when supporting Explanation for Oracle
for i := range assessmentReport.Issues {
assessmentReport.Issues[i].Impact = "-"
}

}
}

Expand Down
6 changes: 6 additions & 0 deletions yb-voyager/cmd/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,12 @@ const (
UNSUPPORTED_PARTITIONING_METHODS_FEATURE = "Unsupported Partitioning Methods"
COMPOUND_TRIGGER_FEATURE = "Compound Triggers"

// Oracle Issue Type
UNSUPPORTED_INDEXES_ISSUE_TYPE = "UNSUPPORTED_INDEXES"
VIRTUAL_COLUMNS_ISSUE_TYPE = "VIRTUAL_COLUMNS"
INHERITED_TYPES_ISSUE_TYPE = "INHERITED_TYPES"
UNSUPPORTED_PARTITIONING_METHODS_ISSUE_TYPE = "UNSUPPORTED_PARTITIONING_METHODS"

//POSTGRESQL
CONSTRAINT_TRIGGERS_FEATURE = "Constraint triggers"
INHERITED_TABLES_FEATURE = "Inherited tables"
Expand Down
4 changes: 2 additions & 2 deletions yb-voyager/cmd/templates/migration_assessment_report.template
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@
Type <span class="sort-indicator">&#8597</span>
</th>
<th>Object/SQL Preview</th>
<th style="cursor: pointer;" onclick="sortTableBy('impact')">
<th style="cursor: pointer; text-align: center;" onclick="sortTableBy('impact')">
Impact <span class="sort-indicator">&#8597</span>
</th>
</tr>
Expand Down Expand Up @@ -337,7 +337,7 @@
{{ end }}
</td>

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

<!-- Hidden Details of the Row -->
Expand Down
2 changes: 2 additions & 0 deletions yb-voyager/src/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ const (
TABLE = "TABLE"
FUNCTION = "FUNCTION"
COLUMN = "COLUMN"
INDEX = "INDEX"
TYPE = "TYPE"

// Source DB Types
YUGABYTEDB = "yugabytedb"
Expand Down