search: achieve validation parity with existing queries
Created by: rvantonder
Stacked on #9752. This PR validates and/or queries in essentially the same way as our existing query logic. The main addition is function validateField
, which does basically all the work of our existing searchquery.go
definition constraints and check logic in check.go
. The rest of the PR is basically just set up.
I have migrated validation tests from search_query.go
where it makes sense, and added my own additional ones. See linked issue for further description.
Merge request reports
Activity
Created by: codecov[bot]
Codecov Report
Merging #9757 into master will increase coverage by
0.08%
. The diff coverage is63.79%
.@@ Coverage Diff @@ ## master #9757 +/- ## ========================================== + Coverage 41.87% 41.96% +0.08% ========================================== Files 1339 1339 Lines 73512 73593 +81 Branches 6626 6626 ========================================== + Hits 30782 30880 +98 + Misses 39888 39869 -19 - Partials 2842 2844 +2
Flag Coverage Δ #unit 41.96% <63.79%> (+0.08%)
Impacted Files Coverage Δ cmd/frontend/graphqlbackend/search.go 62.87% <0.00%> (-0.12%)
internal/search/query/types.go 34.86% <31.81%> (+29.73%)
internal/search/query/parser.go 92.68% <71.42%> (+0.09%)
internal/search/query/validate.go 81.95% <73.80%> (-13.97%)
Please register or sign in to reply