github plugin for gerrit build issue

Asked by 6 months ago
I am trying to build a github plugin and ran into issues. This is what I did: # git clone https://gerrit.googlesource.com/plugins/github # cd github # mvn install ... [ERROR] Failed to execute goal on project github-oauth: Could not resolve dependencies for project com.googlesource.gerrit.plugins.github:github-oauth:jar:2.8-SNAPSHOT: The following artifacts could not be resolved: com.google.gerrit:gerrit-plugin-api:jar:2.8-SNAPSHOT, org.kohsuke:github-api:jar:1.44-SNAPSHOT: Failure to find com.google.gerrit:gerrit-plugin-api:jar:2.8-SNAPSHOT in http://repo.jenkins-ci.org/public/ was cached in the local repository, resolution will not be reattempted until the update interval of repo.jenkins-ci.org has elapsed or updates are forced -> [Help 1] Any idea? Seems that gerrit moved from 2.8 development and 2.8-SNAPSHOT and 1.44-SNAPSHOT cannot be resolved. Also, instructions on building singleusergroup are outdated as project switched from mvn to buck.

Your Answer

Name:
Reply:

All Answers

Answer by 6 months ago
You have two unrelated problems: one with gerrit-plugin-api-2.8-SNAPSHOT and one with github-api-1.44-SNAPSHOT. * gerrit-plugin-api: i guess you could replace 2.8-SNPASHOT with 2.8 and try again. * github-api: clone this project and issue mvn clean install, to install it in your local Maven repository. switched from mvn to buck. Well, it's open source, why not to fix the instructions and upload a change for review?
Answer by 6 months ago
Hi Nenad, there are quite some patches on top of master in order to fix some of the issues: https://gerrit-review.googlesource.com/#/projects/plugins/github,dashboards/default:open Have you tried to apply them ? It currently builds and work fine for me on Gerrit 2.9. There is not yet a stable-2.8 branch, will create it today so that I can change the SNAPSHOT to final ;-) Luca.
Answer by 6 months ago
Quoted message by Luca Milanesio 6 months ago
Hi Nenad, there are quite some patches on top of master in order to fix some of the issues: https://gerrit-review.googlesource.com/#/projects/plugins/github,dashboards/default:open Have you tried to apply them ? It currently builds and work fine for me on Gerrit 2.9. There is not yet a stable-2.8 branch, will create it today so that I can change the SNAPSHOT to final ;-) Luca.
If you want to build on Gerrit 2.8 released, I've created a stable-2.8 branch. Try to fetch: git fetch https://gerrit.googlesource.com/plugins/github refs/changes/36/54036/1 && git cherry-pick FETCH_HEAD Luca.
Answer by 6 months ago
Stable-2.8 branch crated :-) Luca.
Answer by 6 months ago
Quoted message by Luca Milanesio 6 months ago
Hi Nenad, there are quite some patches on top of master in order to fix some of the issues: https://gerrit-review.googlesource.com/#/projects/plugins/github,dashboards/default:open Have you tried to apply them ? It currently builds and work fine for me on Gerrit 2.9. There is not yet a stable-2.8 branch, will create it today so that I can change the SNAPSHOT to final ;-) Luca.
Hi Luca, I am trying to build the github plugin and ran into the same issue encountered here so I tried switching to the stable branch you created. However it seems that the same problems still occur: [ERROR] Failed to execute goal on project github-oauth: Could not resolve dependencies for project com.googlesource.gerrit.plugins.github:github-oauth:jar:2.8-SNAPSHOT: The following artifacts could not be resolved: com.google.gerrit:gerrit-plugin-api:jar:2.8-SNAPSHOT, org.kohsuke:github-api:jar:1.44-SNAPSHOT: Failure to find com.google.gerrit:gerrit-plugin-api:jar:2.8-SNAPSHOT in http://repo.jenkins-ci.org/public/ was cached in the local repository, resolution will not be reattempted until the update interval of repo.jenkins-ci.org has elapsed or updates are forced -> [Help 1] I'm not familiar with maven (first time trying to build a project), but it seems that github-plugin/pom.xml and github-oauth/pom.xml still have 2.8-SNAPSHOT listed as the version? I tried changing both to 2.8 but same error as well at any rate. Would love to be able try this plugin out, any stable version would do.
Answer by 6 months ago
Quoted message by Luca Milanesio 6 months ago
Stable-2.8 branch crated :-) Luca.
Hi Kang, I've pushed a further patch [1] for using the GerritForge maven repository. Alternatively you can build Gerrit locally and you would have your dependencies resolved. With regards to the Kohsuke GitHub API, you need to build them from the Kohsuke GitHub repository in [2]. HTH. Luca. [1] https://gerrit-review.googlesource.com/54083 [2] https://github.com/kohsuke/github-api
Answer by 6 months ago
Quoted message by Kang Jin Chia 6 months ago
Hi Luca, I am trying to build the github plugin and ran into the same issue encountered here so I tried switching to the stable branch you created. However it seems that the same problems still occur: [ERROR] Failed to execute goal on project github-oauth: Could not resolve dependencies for project com.googlesource.gerrit.plugins.github:github-oauth:jar:2.8-SNAPSHOT: The following artifacts could not be resolved: com.google.gerrit:gerrit-plugin-api:jar:2.8-SNAPSHOT, org.kohsuke:github-api:jar:1.44-SNAPSHOT: Failure to find com.google.gerrit:gerrit-plugin-api:jar:2.8-SNAPSHOT in http://repo.jenkins-ci.org/public/ was cached in the local repository, resolution will not be reattempted until the update interval of repo.jenkins-ci.org has elapsed or updates are forced -> [Help 1] I'm not familiar with maven (first time trying to build a project), but it seems that github-plugin/pom.xml and github-oauth/pom.xml still have 2.8-SNAPSHOT listed as the version? I tried changing both to 2.8 but same error as well at any rate. Would love to be able try this plugin out, any stable version would do.
The README.md still says to use https://github.com/lucamilanesio/github-api.
Answer by 6 months ago
Quoted message by Luca Milanesio 6 months ago
Hi Kang, I've pushed a further patch [1] for using the GerritForge maven repository. Alternatively you can build Gerrit locally and you would have your dependencies resolved. With regards to the Kohsuke GitHub API, you need to build them from the Kohsuke GitHub repository in [2]. HTH. Luca. [1] https://gerrit-review.googlesource.com/54083 [2] https://github.com/kohsuke/github-api
I tried going through the whole process again, a fairly accurate work log: https://gist.github.com/nnutter/8684238 I had to make several changes: gerrit diff: https://gist.github.com/nnutter/8684271 singleusergroup diff: https://gist.github.com/nnutter/8684277 github diff: https://gist.github.com/nnutter/8684261 And I still ended up with the same error I reported previously (http://j.mp/1fbQyRx): https://gist.github.com/nnutter/8684215 I'll mention that kohsuke github-api 1.44 is *not* compatible because it is missing GHPullRequestCommitDetail (but 1.45 has it). lucamilanesio's fork's pom.xml sets the version as 1.48-SNAPSHOT.
Answer by 6 months ago
Quoted message by Nathan Nutter 6 months ago
The README.md still says to use https://github.com/lucamilanesio/github-api.
Thanks for the log! May be worth back porting this to 2.8 [1]? Can you verify that this fixes buck build plugin_api for you on 2.8? [1] https://gerrit-review.googlesource.com/53911
Answer by 6 months ago
Quoted message by Nathan Nutter 6 months ago
I tried going through the whole process again, a fairly accurate work log: https://gist.github.com/nnutter/8684238 I had to make several changes: gerrit diff: https://gist.github.com/nnutter/8684271 singleusergroup diff: https://gist.github.com/nnutter/8684277 github diff: https://gist.github.com/nnutter/8684261 And I still ended up with the same error I reported previously (http://j.mp/1fbQyRx): https://gist.github.com/nnutter/8684215 I'll mention that kohsuke github-api 1.44 is *not* compatible because it is missing GHPullRequestCommitDetail (but 1.45 has it). lucamilanesio's fork's pom.xml sets the version as 1.48-SNAPSHOT.
Yep that worked. I made a new user (so fresh local maven repo, etc.) and did: $ git clone https://gerrit.googlesource.com/gerrit $ git checkout stable-2.8 $ git cherry-pick dcc48b078f73040f361a8b515342832eba0fc131 $ buck build api ... /home/vagrant2/bin/buck: line 51: 1872 Killed java $BUCK_JAVA_ARGS -classpath $BUCK_JAVA_CLASSPATH com.facebook.buck.cli.Main "$@" $ buck build api [-] PARSING BUILD FILES...FINISHED 2.2s [-] BUILDING...FINISHED 20.6s Log: $ buck build api_install [-] PARSING BUILD FILES...FINISHED 2.2s [-] BUILDING...FINISHED 27.7s I think the first `buck build api` got killed for memory. I'm just using a low memory VM.