Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to Gerrit fetch for cherry-picked reviews #210

Open
vitas opened this issue Nov 19, 2019 · 4 comments
Open

Fails to Gerrit fetch for cherry-picked reviews #210

vitas opened this issue Nov 19, 2019 · 4 comments

Comments

@vitas
Copy link

vitas commented Nov 19, 2019

Using new option in Gerrit global.commentOnlyChangedLines=true
It fails if the commit is a cherry-pick.
From log file:

Exception in thread "main" pl.touk.sputnik.connector.gerrit.GerritException: Error when retrieve modified lines
at pl.touk.sputnik.connector.gerrit.GerritCommentFilter.init(GerritCommentFilter.java:51)
at pl.touk.sputnik.connector.gerrit.GerritFacadeBuilder.buildCommentFilter(GerritFacadeBuilder.java:68)
at pl.touk.sputnik.connector.gerrit.GerritFacadeBuilder.build(GerritFacadeBuilder.java:48)
at pl.touk.sputnik.connector.ConnectorFacadeFactory.build(ConnectorFacadeFactory.java:25)
at pl.touk.sputnik.Main.getConnectorFacade(Main.java:48)
at pl.touk.sputnik.Main.main(Main.java:40)
Caused by: com.urswolfer.gerrit.client.rest.http.HttpStatusException: Request not successful. Message: Not Found. Status-Code: 404. Content: Multiple changes found for I9b5bd093c5ae8e22142eb15563e922b0e29b56c3.

@SpOOnman
Copy link
Collaborator

@vitas can you paste your CLI options that you've used for running Sputnik? Please obfuscate them. Did you use only changeId and revisionId?

@vitas
Copy link
Author

vitas commented Nov 19, 2019

my setting work just fine. the issue is a minor and probably related to gerrit rest api client. If you cherry-pick a change in gerrit UI it also copies change-id from original commit. It is legit as both changes are in different branches, but looks like api client cannot handle that case. There is a workaround in gerrit: during cherry-pick remove change id and let generate new one

@SpOOnman
Copy link
Collaborator

I've used catch here so if Gerrit fails to fetch with 404 it won't break up.

@SpOOnman
Copy link
Collaborator

We're recently made a great progress with gerrit rest client. Please check if it is fixed with #230 and 2.6.0. release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants