fabric8-services / fabric8-wit

wit stands for Work Item Tracker
http://devdoc.almighty.io/
Apache License 2.0
45 stars 86 forks source link

Do not throw 500 on invalid value type in search API #2321

Closed jarifibrahim closed 5 years ago

jarifibrahim commented 5 years ago

The search API uses values in the query to generate the SQL query. The backend throws internal server error if a query like foo:123 is sent where foo is of type bool. This PR fixes this issue.

With this PR

Fixes https://github.com/openshiftio/openshift.io/issues/4429 Depends on https://github.com/fabric8-services/fabric8-wit/pull/2322

Todo

codecov[bot] commented 5 years ago

Codecov Report

Merging #2321 into master will increase coverage by 0.02%. The diff coverage is 75%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2321      +/-   ##
==========================================
+ Coverage   70.13%   70.15%   +0.02%     
==========================================
  Files         171      171              
  Lines       16621    16629       +8     
==========================================
+ Hits        11657    11666       +9     
+ Misses       3832     3831       -1     
  Partials     1132     1132
Impacted Files Coverage Δ
search/search_repository.go 77.57% <100%> (+1.13%) :arrow_up:
gormsupport/postgres.go 42.42% <60%> (+3.13%) :arrow_up:
workitem/workitem_repository.go 67.79% <0%> (-0.23%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 3d163c7...8ec44e1. Read the comment docs.