sputnik icon indicating copy to clipboard operation
sputnik copied to clipboard

Fails to Gerrit fetch for cherry-picked reviews

Open vitas opened this issue 6 years ago • 4 comments

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.

vitas avatar Nov 19 '19 09:11 vitas

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

SpOOnman avatar Nov 19 '19 09:11 SpOOnman

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

vitas avatar Nov 19 '19 12:11 vitas

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

SpOOnman avatar Nov 25 '19 07:11 SpOOnman

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

SpOOnman avatar Jan 28 '21 22:01 SpOOnman