[Buildbot] #2574: GerritChangeSource extracts wrong branch name when using Gerrit 2.7

Buildbot trac trac at buildbot.net
Mon Sep 8 22:52:22 UTC 2014


#2574: GerritChangeSource extracts wrong branch name when using Gerrit 2.7
---------------------+--------------------
Reporter:  dluntzer  |       Owner:
    Type:  defect    |      Status:  new
Priority:  major     |   Milestone:  0.9.+
 Version:  0.8.8     |  Resolution:
Keywords:  gerrit    |
---------------------+--------------------
Description changed by sa2ajj:

Old description:

> When using GerritChangeSource builds are triggered correctly but Git
> checkout fails due to invalid branch-names.
>
> This happens when a new change is created or an existing change is
> upgraded in gerrit.
> When a build is submitted in gerrit the build is triggered with the
> correct branch name.
>
> The logs below show the serverlogs for the described bug.
> When adding a new change the invalid branch "master/5" is used (should be
> "refs/changes/05/5/1" instead).
> When adding a new patchset to the change created above the invalid branch
> "master/5" is used again (should be "refs/changes/05/5/2" instead).
>

> In my opinion the "ref"-entry in the delivered json should be choosen as
> branch because this seems to be the correct branch when using Gerrit 2.7.
> Anyway, I don't know how this has been handled in previous gerrit
> versions and if this possible solution would break support to older
> gerrit versions.
>

>
> buildbot log when creating new change:
>
> 2013-10-20 18:23:07+0200 [-] gerrit: {"type":"patchset-
> created","change":{"project":"test","b
> ranch":"master","id":"If4d248479d037ed69b04b834eb3a5cd04590f520","number":"5","subject":"msg"
> ,"owner":{"name":"COOLEST_USER","email":"buildbot at vm","username":"buildbot"},"url":"http://ub
> untu64vm:8080/5"},"patchSet":{"number":"1","revision":"5785b15baa109170a44c7349b69b1ec297b563
> 10","parents":["9f42aa3c218c7e3e29eccefdac2f43d296d4575e"],"ref":"refs/changes/05/5/1","uploa
> der":{"name":"COOLEST_USER","email":"buildbot at vm","username":"buildbot"},"createdOn":13822861
> 87,"author":{"name":"COOLEST_USER","email":"buildbot at vm","username":"buildbot"},"sizeInsertio
> ns":1,"sizeDeletions":-1},"uploader":{"name":"COOLEST_USER","email":"buildbot at vm","username":
> "buildbot"}}
> 2013-10-20 18:23:07+0200 [-] added change
> Change(revision=u'5785b15baa109170a44c7349b69b1ec29
> 7b56310', who=u'COOLEST_USER <buildbot at vm>', branch=u'master/5',
> comments=u'msg', when=138228
> 6187, category=u'patchset-created', project=u'test',
> repository=u'ssh://buildbot@localhost:29
> 418/test', codebase=u'') to database
>

> buildbot log when creating a new patchset for an existing change:
>
> 2013-10-20 18:31:11+0200 [-] gerrit: {"type":"patchset-
> created","change":{"project":"test","branch":"master","id":"If4d248479d037ed69b04b834eb3a5cd04590f520","number":"5","subject":"msg
> new","owner":{"name":"COOLEST_USER","email":"buildbot at vm","username":"buildbot"},"url":"http://ubuntu64vm:8080/5"},"patchSet":{"number":"2","revision":"77a86936ff64ee4fabdb92a615c1c5cfa659751f","parents":["9f42aa3c218c7e3e29eccefdac2f43d296d4575e"],"ref":"refs/changes/05/5/2","uploader":{"name":"COOLEST_USER","email":"buildbot at vm","username":"buildbot"},"createdOn":1382286671,"author":{"name":"COOLEST_USER","email":"buildbot at vm","username":"buildbot"},"sizeInsertions":1,"sizeDeletions":-1},"uploader":{"name":"COOLEST_USER","email":"buildbot at vm","username":"buildbot"}}
> 2013-10-20 18:31:11+0200 [-] gerrit: {"type":"ref-
> updated","submitter":{"name":"COOLEST_USER","email":"buildbot at vm","username":"buildbot"},"refUpdate":{"oldRev":"0000000000000000000000000000000000000000","newRev":"77a86936ff64ee4fabdb92a615c1c5cfa659751f","refName":"refs/changes/5","project":"test"}}
> 2013-10-20 18:31:11+0200 [-] added change
> Change(revision=u'77a86936ff64ee4fabdb92a615c1c5cfa659751f',
> who=u'COOLEST_USER <buildbot at vm>', branch=u'master/5', comments=u'msg
> new', when=1382286671, category=u'patchset-created', project=u'test',
> repository=u'ssh://buildbot@localhost:29418/test', codebase=u'') to
> database

New description:

 When using GerritChangeSource builds are triggered correctly but Git
 checkout fails due to invalid branch-names.

 This happens when a new change is created or an existing change is
 upgraded in gerrit.
 When a build is submitted in gerrit the build is triggered with the
 correct branch name.

 The logs below show the serverlogs for the described bug.
 When adding a new change the invalid branch "master/5" is used (should be
 "refs/changes/05/5/1" instead).
 When adding a new patchset to the change created above the invalid branch
 "master/5" is used again (should be "refs/changes/05/5/2" instead).


 In my opinion the "ref"-entry in the delivered json should be choosen as
 branch because this seems to be the correct branch when using Gerrit 2.7.
 Anyway, I don't know how this has been handled in previous gerrit versions
 and if this possible solution would break support to older gerrit
 versions.



 buildbot log when creating new change:

 {{{
 2013-10-20 18:23:07+0200 [-] gerrit: {"type":"patchset-
 created","change":{"project":"test","b
 ranch":"master","id":"If4d248479d037ed69b04b834eb3a5cd04590f520","number":"5","subject":"msg"
 ,"owner":{"name":"COOLEST_USER","email":"buildbot at vm","username":"buildbot"},"url":"http://ub
 untu64vm:8080/5"},"patchSet":{"number":"1","revision":"5785b15baa109170a44c7349b69b1ec297b563
 10","parents":["9f42aa3c218c7e3e29eccefdac2f43d296d4575e"],"ref":"refs/changes/05/5/1","uploa
 der":{"name":"COOLEST_USER","email":"buildbot at vm","username":"buildbot"},"createdOn":13822861
 87,"author":{"name":"COOLEST_USER","email":"buildbot at vm","username":"buildbot"},"sizeInsertio
 ns":1,"sizeDeletions":-1},"uploader":{"name":"COOLEST_USER","email":"buildbot at vm","username":
 "buildbot"}}
 2013-10-20 18:23:07+0200 [-] added change
 Change(revision=u'5785b15baa109170a44c7349b69b1ec29
 7b56310', who=u'COOLEST_USER <buildbot at vm>', branch=u'master/5',
 comments=u'msg', when=138228
 6187, category=u'patchset-created', project=u'test',
 repository=u'ssh://buildbot@localhost:29
 418/test', codebase=u'') to database
 }}}

 buildbot log when creating a new patchset for an existing change:

 {{{

 2013-10-20 18:31:11+0200 [-] gerrit: {"type":"patchset-
 created","change":{"project":"test","branch":"master","id":"If4d248479d037ed69b04b834eb3a5cd04590f520","number":"5","subject":"msg
 new","owner":{"name":"COOLEST_USER","email":"buildbot at vm","username":"buildbot"},"url":"http://ubuntu64vm:8080/5"},"patchSet":{"number":"2","revision":"77a86936ff64ee4fabdb92a615c1c5cfa659751f","parents":["9f42aa3c218c7e3e29eccefdac2f43d296d4575e"],"ref":"refs/changes/05/5/2","uploader":{"name":"COOLEST_USER","email":"buildbot at vm","username":"buildbot"},"createdOn":1382286671,"author":{"name":"COOLEST_USER","email":"buildbot at vm","username":"buildbot"},"sizeInsertions":1,"sizeDeletions":-1},"uploader":{"name":"COOLEST_USER","email":"buildbot at vm","username":"buildbot"}}
 2013-10-20 18:31:11+0200 [-] gerrit: {"type":"ref-
 updated","submitter":{"name":"COOLEST_USER","email":"buildbot at vm","username":"buildbot"},"refUpdate":{"oldRev":"0000000000000000000000000000000000000000","newRev":"77a86936ff64ee4fabdb92a615c1c5cfa659751f","refName":"refs/changes/5","project":"test"}}
 2013-10-20 18:31:11+0200 [-] added change
 Change(revision=u'77a86936ff64ee4fabdb92a615c1c5cfa659751f',
 who=u'COOLEST_USER <buildbot at vm>', branch=u'master/5', comments=u'msg
 new', when=1382286671, category=u'patchset-created', project=u'test',
 repository=u'ssh://buildbot@localhost:29418/test', codebase=u'') to
 database

 }}}

--

--
Ticket URL: <http://trac.buildbot.net/ticket/2574#comment:4>
Buildbot <http://buildbot.net/>
Buildbot: build/test automation


More information about the bugs mailing list