--CheersPhilipp
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Did you use the new Gerrit REST API ?
Am Samstag, 19. April 2014 15:25:41 UTC+2 schrieb Urs Wolfer:See my answers to your questions below.> 1. Is it okay to add API (interfaces) for REST endpoints like Accounts in GerritApi? If I add that interfaces, would it require to implement / change things in the Gerrit codebase?I think we want to have the same child interfaces in GerritApi as the current REST endpoints:rest-api-accessrest-api-accountsrest-api-changesrest-api-configrest-api-groupsrest-api-pluginsrest-api-projectsCurrently only two are implemented Changes and Projects. Just add new interface Accounts in the package:com.google.gerrit.extensions.api.accounts in gerrit-extension-api project.
> 2. How to list (all) changes, projects? I have added to Changes List<ChangeInfo> list()" (see example above).Well you probably want to limit the result and provide some kind of paging or quering.Otherwise you are going to get hundreds of thousands of changes, that is probably not what you want.
> 3. At the moment, all the code is in a GitHub repository together with the IntelliJ plugin. Do you have any suggestions for taking it over to gerrit-review?I looked into the code on refactor-rest-client branch. Great job, thanks!I think to import it in one or another form in gerrit-review, the package names must be aligned with gerrit review, socom.urswolfer.gerrit.client.rest.http.GerritRestClientbecomes:com.google.gerrit.client.rest.http.GerritRestClientor some such. And the package com.urswolfer.gerrit.client.rest.bean should be dropped in favor of Gerrit own classes.
I would suggest to create sub-project under gerrit repository: gerrit-rest-clientand put the code under this sub-project. If you want i could create an initial commit and implement BUCK build that produces new (mavenizeable) artifact:gerrit-rest-client.jarI would suggest to start small and only import generic stuff and may be implement only two interfaces Changes and Projects that are already there,and add new stuff as the interfaces are added to the Gerrit Plugin API itself.
On Monday, April 21, 2014 6:43:43 PM UTC+2, David Ostrovsky wrote:Am Samstag, 19. April 2014 15:25:41 UTC+2 schrieb Urs Wolfer:See my answers to your questions below.> 1. Is it okay to add API (interfaces) for REST endpoints like Accounts in GerritApi? If I add that interfaces, would it require to implement / change things in the Gerrit codebase?I think we want to have the same child interfaces in GerritApi as the current REST endpoints:rest-api-accessrest-api-accountsrest-api-changesrest-api-configrest-api-groupsrest-api-pluginsrest-api-projectsCurrently only two are implemented Changes and Projects. Just add new interface Accounts in the package:com.google.gerrit.extensions.api.accounts in gerrit-extension-api project.That's what I have done so far. One problem is that adding API requires changes in GerritApiImpl. What's about adding a "default" implementation for every interface (in form of an abstract class in the interface which throws an UnsupportedOperationException)?
Then the Impl can extend that abstract class. That would require minimal changes to existing code in com.google.gerrit.server.api and allow better source compatibility for further changes.What's about adding a "Tools" API also? I need that in my plugin to fetch the commit-msg hook. I know this is not a "real" REST endpoint...
> 2. How to list (all) changes, projects? I have added to Changes List<ChangeInfo> list()" (see example above).Well you probably want to limit the result and provide some kind of paging or quering.Otherwise you are going to get hundreds of thousands of changes, that is probably not what you want.Probably better call it #query with an optional argument QueryParameter which allows specifying a query string, number of results, ...
> 3. At the moment, all the code is in a GitHub repository together with the IntelliJ plugin. Do you have any suggestions for taking it over to gerrit-review?I looked into the code on refactor-rest-client branch. Great job, thanks!I think to import it in one or another form in gerrit-review, the package names must be aligned with gerrit review, socom.urswolfer.gerrit.client.rest.http.GerritRestClientbecomes:com.google.gerrit.client.rest.http.GerritRestClientor some such. And the package com.urswolfer.gerrit.client.rest.bean should be dropped in favor of Gerrit own classes.The bean package got dropped in the meantime.
I would suggest to create sub-project under gerrit repository: gerrit-rest-clientand put the code under this sub-project. If you want i could create an initial commit and implement BUCK build that produces new (mavenizeable) artifact:gerrit-rest-client.jarI would suggest to start small and only import generic stuff and may be implement only two interfaces Changes and Projects that are already there,and add new stuff as the interfaces are added to the Gerrit Plugin API itself.I'll try to extend the extensions-api first.