Skip to content

Commit

Permalink
minor cleanup and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sanyamsinghal committed Jan 6, 2025
1 parent 72a0b16 commit 397d645
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 10 deletions.
21 changes: 17 additions & 4 deletions migtests/scripts/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -877,18 +877,31 @@ normalize_json() {
# Normalize JSON with jq; use --sort-keys to avoid the need to keep the same sequence of keys in expected vs actual json
jq --sort-keys 'walk(
if type == "object" then
.ObjectNames? |= (if type == "string" then split(", ") | sort | join(", ") else . end) |
.ObjectNames? |= (
if type == "string" then
split(", ") | sort | join(", ")
else
.
end
) |
.VoyagerVersion? = "IGNORED" |
.TargetDBVersion? = "IGNORED" |
.DbVersion? = "IGNORED" |
.FilePath? = "IGNORED" |
.OptimalSelectConnectionsPerNode? = "IGNORED" |
.OptimalInsertConnectionsPerNode? = "IGNORED" |
.RowCount? = "IGNORED" |
.SqlStatement? |= (if type == "string" then gsub("\\n"; " ") else . end)
# Replace newline characters in SqlStatement with spaces
.SqlStatement? |= (
if type == "string" then
gsub("\\n"; " ")
else
.
end
)
elif type == "array" then
sort_by(tostring)
else
sort_by(tostring)
else
.
end
)' "$input_file" > "$temp_file"
Expand Down
9 changes: 5 additions & 4 deletions yb-voyager/cmd/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -1195,13 +1195,14 @@ type AssessmentReport struct {
MigrationCaveats []UnsupportedFeature `json:"MigrationCaveats"`
}

// Fields apart from Category, CategoryDescription, TypeName and Impact will be populated only if/when available
type AssessmentIssue struct {
Category string
Category string // Feature, query_constrcuts, migration_caveats
CategoryDescription string
TypeName string
TypeName string // GIN Indexes, Security Invoker View
TypeDescription string
Impact string
ObjectType string
Impact string // Level-1, Level-2, Level-3 (default: Level-1 ??)
ObjectType string // For datatype category, ObjectType will be datatype (for eg "geometry")
ObjectName string
SqlStatement string
DocsLink string
Expand Down
4 changes: 2 additions & 2 deletions yb-voyager/src/utils/commonVariables.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@ type DBObject struct {
type AnalyzeSchemaIssue struct {
// TODO: rename IssueType to Category
IssueType string `json:"IssueType"` //category: unsupported_features, unsupported_plpgsql_objects, etc
ObjectType string `json:"ObjectType"`
ObjectName string `json:"ObjectName"`
Reason string `json:"Reason"`
Type string `json:"-" xml:"-"` // identifier for issue type ADVISORY_LOCKS, SYSTEM_COLUMNS, etc
Impact string `json:"-" xml:"-"`
ObjectType string `json:"ObjectType"`
ObjectName string `json:"ObjectName"`
SqlStatement string `json:"SqlStatement,omitempty"`
FilePath string `json:"FilePath"`
Suggestion string `json:"Suggestion"`
Expand Down

0 comments on commit 397d645

Please sign in to comment.