andygrunwald / go-gerrit

Go client/library for Gerrit Code Review
https://godoc.org/github.com/andygrunwald/go-gerrit
MIT License
96 stars 40 forks source link

labels should not be pre-escaped #71

Open flokli opened 5 years ago

flokli commented 5 years ago

Gerrit syntax allows to query for approval scores, so something like the following is possible:

status:open label:verified=+1,user=jenkins

For all open changesets that were +1'd by a user named jenkins.

Due to https://github.com/andygrunwald/go-gerrit/commit/8adc2df24e0bb558be35851e39414a0114f6e6ff, it however currently is impossible construct such a query - the + inside label:verified=+1 gets escaped wrongly.

andygrunwald commented 5 years ago

Thank you for the report. Would you be able to construct a failing unit test for this?

@opalmer Any thoughts on this?

opalmer commented 5 years ago

Hmm, the escaping that's being done now is probably correct either in older version or when there are multiple queries separated with ,. I don't have access to a recent version of Gerrit to test with so if there's a way to construct a failing test case that could be used to test a fix against that would help.

flokli commented 5 years ago

@opalmer what about review.coreboot.org? It's on the latest gerrit version, and I can query the following: label:Verified=+1,user=jenkins status:open

Link: https://review.coreboot.org/q/label:Verified%253D%252B1%252Cuser%253Djenkins+status:open