Open lauyoo46 opened 5 years ago
When you say returned by HTTP what do you mean? Is it an HTTP variant of stream-events like a websocket or is it the format of the web hook or something else? Seeing as you are talking about the querry handler I'm guessing the something else :)
I think alternative 1 would be OK. But leave the original methods as is to retain binary backwards compatibility and behaviour.
The original querry handler should likewise also stay and behave like it used to. Maybe adding a static factory method to create an http or ssh version would work?
Hello!
We want to add a functionality where gerrit events plugin retrieves data both through ssh and http.
We have 2 possible solutions for this:
Transform fromJson function in GerritJsonDTO into fromJsonSSH and fromJsonHTTP Modify Account, Approval, Change, Comment, PatchSet, Provider, RefUpdate classes accordingly Transform GerritQueryHandler class to GerritQueryHandlerSSH and add GerritQueryHandlerHTTP class (with a common QueryHandler interface) Adapt the remaining necessary changes
Leave gerrit events as it is and make a converter for http json to ssh json (the json returned by the rest api is very different in structure to the one returned by ssh)
Here is an example of a json returned by ssh
And here is an example of a json containing the same information, returned by http
Let us know what is your feedback on this idea, and which one is more likely to get merged into the repo :)
PS: I saw the issue w/r/t the new architecture proposal, but we don't want to do something that big yet (https://github.com/sonyxperiadev/gerrit-events/issues/10)