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

🐛 Questionnaire validation should tolerate order fields having value 0 #575

Merged
merged 1 commit into from
Dec 7, 2023

Conversation

mansam
Copy link
Collaborator

@mansam mansam commented Dec 6, 2023

The required binding validation can't differentiate an int with value 0 from a value that isn't present. Update order fields on questionnaire structs to be represented as a pointer that must not be nil. Also disable excluded_with validations that don't work on 0 length slices.

@mansam mansam requested a review from jortel December 6, 2023 21:41
Signed-off-by: Sam Lucidi <slucidi@redhat.com>
@mansam mansam force-pushed the fix-questionnaire-order-0-validation branch from 43c1dbd to bd16526 Compare December 6, 2023 21:42
@mansam mansam requested a review from djzager December 6, 2023 21:43
Copy link
Member

@djzager djzager left a comment

Choose a reason for hiding this comment

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

VISACK

@djzager djzager added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 6, 2023
@@ -47,3 +47,7 @@ var (
}
Samples = []api.Questionnaire{Questionnaire1}
)

func uint2ptr(u uint) *uint {
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps we should use https://pkg.go.dev/github.com/gotidy/ptr instead of writing our own?

Copy link
Contributor

@jortel jortel left a comment

Choose a reason for hiding this comment

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

LGTM

@mansam
Copy link
Collaborator Author

mansam commented Dec 7, 2023

Test failures are known to be unrelated to this PR. Merging.

@mansam mansam merged commit 89647a6 into konveyor:main Dec 7, 2023
9 of 11 checks passed
@djzager djzager removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 8, 2023
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.

3 participants