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

Do not add the feature in UnsupportedFeatures field if there are no objects for it in the JSON report #2110

Merged
merged 8 commits into from
Dec 23, 2024

Conversation

priyanshi-yb
Copy link
Contributor

@priyanshi-yb priyanshi-yb commented Dec 20, 2024

Describe the changes in this pull request

Modified the code to not put the Feature in the UnsupportedFeatures field of the struct in case there are no objects for making JSON report cleaner. This will also help developers not to update the expected files every time we add new feature.

Describe if there are any user-facing changes

Json report will not have feature if there are no objects

How was this pull request tested?

Existing tests
https://jenkins.dev.yugabyte.com/job/users/job/yb-voyager-testing/job/yb-voyager-testing-pipeline/4300/ - 1 intermittent failure
https://jenkins.dev.yugabyte.com/job/users/job/yb-voyager-testing/job/yb-voyager-testing-pipeline/4301

Does your PR have changes that can cause upgrade issues?

Component Breaking changes?
MetaDB No
Name registry json No
Data File Descriptor Json No
Export Snapshot Status Json No
Import Data State No
Export Status Json No
Data .sql files of tables No
Export and import data queue No
Schema Dump No
AssessmentDB No
Sizing DB No
Migration Assessment Report Json No
Callhome Json No
YugabyteD Tables No
TargetDB Metadata Tables No

…there are no object for it in the JSON report
@@ -947,7 +947,7 @@ func areMinVersionsFixedInEqual(m1 map[string]*ybversion.YBVersion, m2 map[strin
return true
}

func getUnsupportedFeaturesFromSchemaAnalysisReport(featureName string, issueReason string, schemaAnalysisReport utils.SchemaReport, displayDDLInHTML bool, description string) UnsupportedFeature {
func getUnsupportedFeaturesFromSchemaAnalysisReport(featureName string, issueReason string, schemaAnalysisReport utils.SchemaReport, displayDDLInHTML bool, description string) *UnsupportedFeature {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of changing it to pointer, how about we keep the return type same.
And define EMPTY_UNSUPPORTED_FEATURE and return that, and later filter that out of the final array.

var EMPTY_UNSUPPORTED_FEATURE = UnsupportedFeature{}

Copy link
Contributor Author

@priyanshi-yb priyanshi-yb Dec 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed the way to not make pointer changes, but just filter at the end if there are objects

@priyanshi-yb priyanshi-yb marked this pull request as ready for review December 23, 2024 05:58
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just thinking out loud after looking at the expected test results.
In case of UnsupportedFeatures it is null if there is nothing,
Whereas in case of migration caveats its a empty list - []

can we have the same behaviour in both cases

@priyanshi-yb priyanshi-yb merged commit ecb4c05 into main Dec 23, 2024
42 checks passed
@priyanshi-yb priyanshi-yb deleted the priyanshi/fix-assess-refac branch December 23, 2024 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants