Skip to content

Commit

Permalink
Ensure all the required fields are populated in the html report for n…
Browse files Browse the repository at this point in the history
…ew flattened issues approach (#2190)

This PR includes:

- Having relevant value based on Issue field
- Populating Description and Name in all query issues
- Replacing AnalyzeSchemaIssue.Reason field to be equivalent QueryIssue.Description instead of QueryIssue.Name field
- QueryIssue.Description will only contain dynamic information, rest all fields mostly will be static.
- Detection issue in Callhome whose description have object info.
- Fixed all the automation tests based on the new strings(reason/description etc)
  • Loading branch information
sanyamsinghal authored Jan 21, 2025
1 parent ae2a72f commit d2aa0ad
Show file tree
Hide file tree
Showing 26 changed files with 1,036 additions and 878 deletions.
1 change: 1 addition & 0 deletions migtests/scripts/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -892,6 +892,7 @@ normalize_json() {
.OptimalSelectConnectionsPerNode? = "IGNORED" |
.OptimalInsertConnectionsPerNode? = "IGNORED" |
.RowCount? = "IGNORED" |
.FeatureDescription? = "IGNORED" | # Ignore FeatureDescription instead of fixing it in all tests since it will be removed soon
.MigrationComplexityExplanation?= "IGNORED" |
# Replace newline characters in SqlStatement with spaces
.SqlStatement? |= (
Expand Down
2 changes: 1 addition & 1 deletion migtests/scripts/run-schema-migration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ main() {

step "Analyze schema."
analyze_schema --output-format json
compare_json_reports "${EXPORT_DIR}/reports/schema_analysis_report.json" "${TEST_DIR}/expected_files/expected_schema_analysis_report.json"
compare_json_reports "${TEST_DIR}/expected_files/expected_schema_analysis_report.json" "${EXPORT_DIR}/reports/schema_analysis_report.json"

step "Create target database."
run_ysql yugabyte "DROP DATABASE IF EXISTS ${TARGET_DB_NAME};"
Expand Down
316 changes: 158 additions & 158 deletions migtests/tests/analyze-schema/expected_issues.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2902,7 +2902,7 @@
"MinimumVersionsFixedIn": null
},
{
"FeatureName": "Referenced type declaration of variables",
"FeatureName": "Referencing type declaration of variables",
"Objects": [
{
"ObjectType": "FUNCTION",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13420,7 +13420,7 @@
"UnsupportedQueryConstructs": null,
"UnsupportedPlPgSqlObjects": [
{
"FeatureName": "Referenced type declaration of variables",
"FeatureName": "Referencing type declaration of variables",
"Objects": [
{
"ObjectType": "FUNCTION",
Expand Down
214 changes: 107 additions & 107 deletions migtests/tests/pg/mgi/expected_files/expected_schema_analysis_report.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"IssueType": "unsupported_datatypes",
"ObjectType": "TABLE",
"ObjectName": "public.osm_changeset",
"Reason": "Unsupported datatype - geometry on column - geom",
"Reason": "PostGIS datatypes are not yet supported in YugabyteDB. Affected column: geom and type: geometry.",
"SqlStatement": "CREATE TABLE public.osm_changeset (id bigint NOT NULL, user_id bigint, created_at timestamp, min_lat numeric(10, 7), max_lat numeric(10, 7), min_lon numeric(10, 7), max_lon numeric(10, 7), closed_at timestamp, open boolean, num_changes int, user_name varchar(255), tags public.hstore, geom public.geometry(polygon, 4326)) WITH (colocation=false);",
"FilePath": "/Users/priyanshigupta/Documents/voyager/yb-voyager/migtests/tests/pg/osm/export-dir/schema/tables/table.sql",
"Suggestion": "",
Expand All @@ -70,7 +70,7 @@
"IssueType": "migration_caveats",
"ObjectType": "TABLE",
"ObjectName": "public.osm_changeset",
"Reason": "Unsupported datatype for Live migration with fall-forward/fallback - public.hstore on column - tags",
"Reason": "Datatype not yet supported by voyager in live migration with fall-forward/fallback. Affected column: tags and type: public.hstore. These columns will be excluded when exporting and importing data in live migration workflows.",
"SqlStatement": "CREATE TABLE public.osm_changeset (id bigint NOT NULL, user_id bigint, created_at timestamp, min_lat numeric(10, 7), max_lat numeric(10, 7), min_lon numeric(10, 7), max_lon numeric(10, 7), closed_at timestamp, open boolean, num_changes int, user_name varchar(255), tags public.hstore, geom public.geometry(polygon, 4326)) WITH (colocation=false);",
"FilePath": "/Users/priyanshigupta/Documents/voyager/yb-voyager/migtests/tests/pg/osm/export-dir/schema/tables/table.sql",
"Suggestion": "",
Expand All @@ -82,7 +82,7 @@
"IssueType": "unsupported_features",
"ObjectType": "INDEX",
"ObjectName": "changeset_geom_gist ON public.osm_changeset",
"Reason": "Schema contains GIST index which is not supported.",
"Reason": "The schema contains an index with an access method 'GIST' which is not supported in YugabyteDB.",
"SqlStatement": "CREATE INDEX changeset_geom_gist ON public.osm_changeset USING gist (geom);",
"FilePath": "/home/ubuntu/yb-voyager/migtests/tests/pg/osm/export-dir/schema/tables/INDEXES_table.sql",
"Suggestion": "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"IssueType": "migration_caveats",
"ObjectType": "FOREIGN TABLE",
"ObjectName": "public.f_c",
"Reason": "Foreign tables require manual intervention.",
"Reason": "Foreign table creation fails as SERVER and USER MAPPING objects are not exported by voyager. These should be manually created to make the foreign tables work.",
"SqlStatement": "CREATE FOREIGN TABLE public.f_c ( i integer NOT NULL, t integer, x text ) SERVER p10 OPTIONS ( table_name 'c' );",
"FilePath": "/home/ubuntu/yb-voyager/migtests/tests/pg/pgtbrus/export-dir/schema/tables/foreign_table.sql",
"Suggestion": "SERVER 'p10', and USER MAPPING should be created manually on the target to create and use the foreign table",
Expand All @@ -75,7 +75,7 @@
"IssueType": "migration_caveats",
"ObjectType": "FOREIGN TABLE",
"ObjectName": "public.f_t",
"Reason": "Foreign tables require manual intervention.",
"Reason": "Foreign table creation fails as SERVER and USER MAPPING objects are not exported by voyager. These should be manually created to make the foreign tables work.",
"SqlStatement": "CREATE FOREIGN TABLE public.f_t ( i integer NOT NULL, ts timestamp(0) with time zone DEFAULT now(), j json, t text, e public.myenum, c public.mycomposit ) SERVER p10 OPTIONS ( table_name 't' );",
"FilePath": "/home/ubuntu/yb-voyager/migtests/tests/pg/pgtbrus/export-dir/schema/tables/foreign_table.sql",
"Suggestion": "SERVER 'p10', and USER MAPPING should be created manually on the target to create and use the foreign table",
Expand All @@ -87,7 +87,7 @@
"IssueType": "migration_caveats",
"ObjectType": "TABLE",
"ObjectName": "public.t",
"Reason": "Unsupported datatype for Live migration with fall-forward/fallback - public.mycomposit on column - c",
"Reason": "Datatype not yet supported by voyager in live migration with fall-forward/fallback. Affected column: c and type: public.mycomposit. These columns will be excluded when exporting and importing data in live migration workflows.",
"SqlStatement": "CREATE TABLE public.t (\n i integer NOT NULL,\n ts timestamp(0) with time zone DEFAULT now(),\n j json,\n t text,\n e public.myenum,\n c public.mycomposit\n);",
"FilePath": "/Users/priyanshigupta/Documents/voyager/yb-voyager/migtests/tests/pg/pgtbrus/export-dir/schema/tables/table.sql",
"Suggestion": "",
Expand Down
Loading

0 comments on commit d2aa0ad

Please sign in to comment.