WebUI: Fix quoted filter strings#658
Conversation
6451734 to
1cbf0cd
Compare
|
Okey the counter on the open/close filters for quoted (multi : strings) is fixed. |
MichaelMure
left a comment
There was a problem hiding this comment.
Looks good but could you add the two extra tests?
But for the future, the WebUI must find a better solution to the current query handling.
Agree on that. The lexer/parser in go are 100 (simple) lines each. Re-implementing that in js would 1) ensure feature parity and 2) allow for simpler query manipulation (dedup, reordering, simplification, quote transformation ...).
|
@MichaelMure I have nothing to add. If you are fine with this changes, this can be merged. :-) |
| }); | ||
|
|
||
| it('should not escape nested quotes', () => { | ||
| expect(parse(`foo:'do not escape this ->'<- quote'`)).toEqual({ |
There was a problem hiding this comment.
This behavior is also different in the go parse I believe. The first corresponding quote would terminate the quoted section. It looks like the regex based parser is too greedy and try to match as much as possible?
There was a problem hiding this comment.
It's fine for now if the JS parser is not matching exactly the go one, just write the correct test and comment the ones that don't pass. That way it's explicit were the mismatch are and we don't have tests that mislead the reader into thinking that the code is correct.
There was a problem hiding this comment.
Should be fixed. Added also additional test cases to catch greediness.
Let me now if something is missing and before you merge, so that I can get rid of the eslint hotfixes. :-)
The parse function dropped user given quotes. This resulted into a wrong query to the backend, which lead to an error. This error prevented the webui from displaying the proper bug count.
Key:Value parsing test for quoated colon. E.g. label:"foo:bar" Key:Value:Value parsing test. E.g. metadata:key:"https://www.example.com/"
2b01d64 to
7446a20
Compare
|
Rebased, to get rid of the fix-eslint commits and a fix-typo commit. |
|
good to go! |
Fix #655 (comment)
The parse function dropped user given quotes. This resulted into a wrong formated query to the backend, which further lead to an error. This error then prevented the WebUI from displaying the proper bug count.