You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GET /changes/?q=is:open**+**owner:self&q=is:open+reviewer:self+-owner:self&q=is:closed+owner:self+limit:5&o=LABELS HTTP/1.0
Notice that the + is a literal + ascii.
However, when performing a query using the go-gerrit API, the + is translated into %2B
However, the Gerrit API does not recognise this and returns an empty result set.
Note that the query parameters sent in, are unrelated independent queries. They are not added together. I suspect this causes further confusion - potentially that is a separate bug, since I assumed something different and got some Json un-marshalling bugs ...
I think this needs a cleanup. Personally I would prefer a simpler interface and focus on just one query, but of course the question is how to model the query language. Is each query an AND or an OR etc.
Hope this makes sense to you.
The text was updated successfully, but these errors were encountered:
So I've done some research on this, looks like this might be an issue with google/go-querystring/query which is doing the url encoding for us. Either that or we're using it wrong. Still looking into exactly how to fix it without breaking stuff.
For my own notes, this works perfectly fine so it's definitely an issue with the encoding:
This however fails like go-gerrit does which seems to validate the initial problem:
> curl 'https://gerrit-review.googlesource.com/changes/?n=2&o=LABELS&q=status:open%2Btopic:checkstyle-cleanup' --fail
curl: (22) The requested URL returned error: 400 Bad Request
I think there is a defect in QueryChanges or in the Gerrit REST API.
Consider a query that is constructed with multiple filters such as the one documented in the REST API:
https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#list-changes
In an example there under Request we find:
GET /changes/?q=is:open**+**owner:self&q=is:open+reviewer:self+-owner:self&q=is:closed+owner:self+limit:5&o=LABELS HTTP/1.0
Notice that the + is a literal + ascii.
However, when performing a query using the go-gerrit API, the + is translated into %2B
However, the Gerrit API does not recognise this and returns an empty result set.
Note that the query parameters sent in, are unrelated independent queries. They are not added together. I suspect this causes further confusion - potentially that is a separate bug, since I assumed something different and got some Json un-marshalling bugs ...
I think this needs a cleanup. Personally I would prefer a simpler interface and focus on just one query, but of course the question is how to model the query language. Is each query an AND or an OR etc.
Hope this makes sense to you.
The text was updated successfully, but these errors were encountered: