Skip to content

Commit

Permalink
Misc changes: variable names, spacing, comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sanyamsinghal committed Jan 14, 2025
1 parent 6fc877e commit 14ca806
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 19 deletions.
8 changes: 3 additions & 5 deletions yb-voyager/cmd/analyzeSchema.go
Original file line number Diff line number Diff line change
Expand Up @@ -663,10 +663,8 @@ func convertIssueInstanceToAnalyzeIssue(issueInstance queryissue.QueryIssue, fil
// 2. Keep it in issue.Details and write logic in UI layer to construct display name.
*/
displayObjectName := issueInstance.ObjectName

constraintName, ok := issueInstance.Details[queryissue.CONSTRAINT_NAME]
if slices.Contains(constraintIssues, issueInstance.Type) && ok {
//In case of constraint issues we add constraint name to the object name as well
if constraintName, ok := issueInstance.Details[queryissue.CONSTRAINT_NAME]; slices.Contains(constraintIssues, issueInstance.Type) && ok {
//In case of constraint issues we add constraint name to the object name to achieve the uniqueness
displayObjectName = fmt.Sprintf("%s, constraint: (%s)", issueInstance.ObjectName, constraintName)
}

Expand All @@ -676,8 +674,8 @@ func convertIssueInstanceToAnalyzeIssue(issueInstance queryissue.QueryIssue, fil
IssueType: issueType,
ObjectType: issueInstance.ObjectType,
ObjectName: displayObjectName,
Reason: issueInstance.Name,
Type: issueInstance.Type,
Reason: issueInstance.Name,
Impact: issueInstance.Impact,
SqlStatement: issueInstance.SqlStatement,
DocsLink: issueInstance.DocsLink,
Expand Down
2 changes: 1 addition & 1 deletion yb-voyager/cmd/assessMigrationCommand.go
Original file line number Diff line number Diff line change
Expand Up @@ -1019,7 +1019,7 @@ func convertAnalyzeSchemaIssueToAssessmentIssue(analyzeSchemaIssue utils.Analyze
Category: analyzeSchemaIssue.IssueType,
CategoryDescription: GetCategoryDescription(analyzeSchemaIssue.IssueType),
Type: analyzeSchemaIssue.Type,
Name: analyzeSchemaIssue.Reason, // in convertIssueInstanceToAnalyzeIssue() we assign IssueType to Reason field
Name: analyzeSchemaIssue.Reason, // in convertIssueInstanceToAnalyzeIssue() we assign Issue.Name to AnalyzeSchemaIssue.Reason field
Description: issueDescription, // TODO: verify
Impact: analyzeSchemaIssue.Impact,
ObjectType: analyzeSchemaIssue.ObjectType,
Expand Down
4 changes: 2 additions & 2 deletions yb-voyager/cmd/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -1073,12 +1073,12 @@ type AssessmentReport struct {

// Fields apart from Category, CategoryDescription, TypeName and Impact will be populated only if/when available
type AssessmentIssue struct {
Category string // expected values: feature, query_constructs, migration_caveats, plpgsql_objects, datatype
Category string // expected values: unsupported_features, unsupported_query_constructs, migration_caveats, unsupported_plpgsql_objects, unsupported_datatype
CategoryDescription string
Type string // Ex: GIN_INDEXES, SECURITY_INVOKER_VIEWS, STORED_GENERATED_COLUMNS
Name string // Ex: "Stored generated columns are not supported."
Description string
Impact string // Level-1, Level-2, Level-3 (default: Level-1 ??)
Impact string // Level-1, Level-2, Level-3 (no default: need to be assigned for each issue)
ObjectType string // For datatype category, ObjectType will be datatype (for eg "geometry")
ObjectName string
SqlStatement string
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 @@ -250,8 +250,8 @@
</div>
<!-- Right area: buttons -->
<div class="buttons">
<button class="rounded-button" onclick="expandAllIssues()">Expand All Issues</button>
<button class="rounded-button" onclick="collapseAllIssues()">Collapse All Issues</button>
<button class="rounded-button" onclick="expandAllIssues()">Expand All</button>
<button class="rounded-button" onclick="collapseAllIssues()">Collapse All</button>
</div>
</div>
<table class="table-highlight">
Expand Down
18 changes: 9 additions & 9 deletions yb-voyager/src/query/queryissue/issues_ddl.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var generatedColumnsIssue = issue.Issue{
Name: "Stored generated columns are not supported.",
Impact: constants.IMPACT_LEVEL_1,
GH: "https://github.com/yugabyte/yugabyte-db/issues/10695",
Suggestion: "Using Triggers to update the generated columns is one way to work around this issue, refer docs link for more details.",
Suggestion: "Use Triggers to update the generated columns is one way to work around this issue, refer docs link for more details.",
DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#generated-always-as-stored-type-column-is-not-supported",
}

Expand Down Expand Up @@ -477,8 +477,8 @@ var multiRangeDatatypeIssue = issue.Issue{
Name: "Unsupported datatype",
Impact: constants.IMPACT_LEVEL_1,
Suggestion: "Multirange data type is not yet supported in YugabyteDB, no workaround available currently",
GH: "https://github.com/yugabyte/yugabyte-db/issues/25575",
DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features",
GH: "https://github.com/yugabyte/yugabyte-db/issues/25575",
DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features",
}

func NewMultiRangeDatatypeIssue(objectType string, objectName string, sqlStatement string, typeName string, colName string) QueryIssue {
Expand All @@ -492,8 +492,8 @@ var securityInvokerViewIssue = issue.Issue{
Name: "Security Invoker Views not supported yet",
Impact: constants.IMPACT_LEVEL_1,
Suggestion: "Security Invoker Views are not yet supported in YugabyteDB, no workaround available currently",
GH: "https://github.com/yugabyte/yugabyte-db/issues/25575",
DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features",
GH: "https://github.com/yugabyte/yugabyte-db/issues/25575",
DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features",
}

func NewSecurityInvokerViewIssue(objectType string, objectName string, SqlStatement string) QueryIssue {
Expand All @@ -505,8 +505,8 @@ var deterministicOptionCollationIssue = issue.Issue{
Name: DETERMINISTIC_OPTION_WITH_COLLATION_NAME,
Impact: constants.IMPACT_LEVEL_1,
Suggestion: "This feature is not supported in YugabyteDB yet",
GH: "https://github.com/yugabyte/yugabyte-db/issues/25575",
DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features",
GH: "https://github.com/yugabyte/yugabyte-db/issues/25575",
DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features",
}

func NewDeterministicOptionCollationIssue(objectType string, objectName string, SqlStatement string) QueryIssue {
Expand All @@ -518,8 +518,8 @@ var foreignKeyReferencesPartitionedTableIssue = issue.Issue{
Name: FOREIGN_KEY_REFERENCES_PARTITIONED_TABLE_NAME,
Impact: constants.IMPACT_LEVEL_1,
Suggestion: "No workaround available ",
GH: "https://github.com/yugabyte/yugabyte-db/issues/25575",
DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features",
GH: "https://github.com/yugabyte/yugabyte-db/issues/25575",
DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features",
}

func NewForeignKeyReferencesPartitionedTableIssue(objectType string, objectName string, SqlStatement string, constraintName string) QueryIssue {
Expand Down

0 comments on commit 14ca806

Please sign in to comment.