<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>11508</bug_id>
          
          <creation_ts>2017-05-12 16:17:15 +0000</creation_ts>
          <short_desc>Bugs in MultiBranch GitPoller example code and limitation in buildbot library</short_desc>
          <delta_ts>2018-03-22 08:49:21 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>5</classification_id>
          <classification>Infrastructure</classification>
          <product>AutoBuilder</product>
          <component>autobuilder</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>OBSOLETE</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.5</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Johannes Schrimpf">johannes.schrimpf</reporter>
          <assigned_to name="Joshua Lock">joshuagloe</assigned_to>
          <cc>infras.ab.watcher</cc>
    
    <cc>Infras.watcher</cc>
    
    <cc>pidge</cc>
    
    <cc>pokylinux</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Yes (doc changes required)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>73239</commentid>
    <comment_count>0</comment_count>
      <attachid>3763</attachid>
    <who name="Johannes Schrimpf">johannes.schrimpf</who>
    <bug_when>2017-05-12 16:17:15 +0000</bug_when>
    <thetext>Created attachment 3763
Patch that includes branch names in GitPoller name to make it possible to use several pollers for same repo with different branches

There are several bugs in the code in example of MultiBranch GitPoller in the documentation and a related limitation in the buildbot library that is used:

1) In both schedulers there is a &apos;}&apos; after 3600 in the line for the interval

Solution for 1:
Remove the &apos;}&apos;s

After doing this, autobuilder managed to start but in Changesources in the webinterface only one GitPoller is visible.

2) The second scheduler seems to overwrite the first one. I could not verify with same repository and different branches but I could verify it happens with different repositories)

Solution for 2:
Add the two schedulers to the same scheduler list
scheduler:[{....},
           {....}]

That leads to the following problem:
3) The two pollers are not allowed to have the same name

Solution for 3:
Change the names for the two schedulers to be unique

Doing these three steps, I was able to add scheduler with multiple different repositories with a similar buildset config, but still did not get two GitPollers to work on the same repository. This is a problem in gitpoller.py.

The problem is the following:
- Two GitPollers with the same repository but different branches will get the same name which is a problem for twisted. To prevent this, gitpoller.py has to be changed. The applies patch is a quick fix that appends the list of branches as string in the name of the service. It works in my local setup, together with my suggested patch in ID 11507.


Autobuilder version: commit 867b093d540fcd51d821adcdd8184668ab23b40e</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73812</commentid>
    <comment_count>1</comment_count>
    <who name="Joshua Lock">joshuagloe</who>
    <bug_when>2017-06-07 15:29:01 +0000</bug_when>
    <thetext>As this bug is in buildbot core, have you considered submitting your fix to the upstream buildbot project? https://github.com/buildbot/buildbot

Over the course of the next development cycle or so I&apos;d really like to move to a newer version of buildbot and ideally no longer carry a fork of the code in the yocto-autobuilder repository.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73933</commentid>
    <comment_count>2</comment_count>
    <who name="Johannes Schrimpf">johannes.schrimpf</who>
    <bug_when>2017-06-09 08:32:25 +0000</bug_when>
    <thetext>I had a brief look at the upstream repo, but since autobuilder uses a fork in an older version,  I did not look more into it.

Also, the use of gitpoller in autobuilder is quite specific and traceable and I don&apos;t know how this change would impact other software using buildbot. I don&apos;t have enough insight in the mainline buildbot setup to know how gitpoller is intended to be used outside autobuilder, and I could imagine this specific change could potentially break compatibility with other software.

I think moving to a mainline buildbot version would be very good and I guess then this issue should be addressed then in regard to the new version. If still present, it should definitively be reported to the buildbot developers, but I suggest to apply the patch until then to make autobuilder work in this setup.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79927</commentid>
    <comment_count>3</comment_count>
    <who name="Joshua Lock">joshuagloe</who>
    <bug_when>2018-03-22 08:49:21 +0000</bug_when>
    <thetext>Resolved by the new infrastructure architecture of helper scripts (yocto-autobuilder-helper) with a more recent buildbot with minimal configuration (yocto-autobuilder2).</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>3763</attachid>
            <date>2017-05-12 16:17:15 +0000</date>
            <delta_ts>2017-05-12 16:17:15 +0000</delta_ts>
            <desc>Patch that includes branch names in GitPoller name to make it possible to use several pollers for same repo with different branches</desc>
            <filename>0001-lib-python2.7-site-packages-buildbot-0.8.8-py2.7.egg.patch</filename>
            <type>application/octet-stream</type>
            <size>1979</size>
            <attacher name="Johannes Schrimpf">johannes.schrimpf</attacher>
            
              <data encoding="base64">RnJvbSA1ZjdlMjU0MzUxYTdhMzMzODJmNGM2MmQ3YTBmYjdjYjRlOWM3NjQ0IE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBKb2hhbm5lcyBTY2hyaW1wZiA8am9oYW5uZXMuc2NocmltcGZA
Ymx1ZXllLm5vPgpEYXRlOiBGcmksIDEyIE1heSAyMDE3IDE4OjAyOjE1ICswMjAwClN1YmplY3Q6
IFtQQVRDSF0gCiBsaWIvcHl0aG9uMi43L3NpdGUtcGFja2FnZXMvYnVpbGRib3QtMC44LjgtcHky
LjcuZWdnL2J1aWxkYm90L2NoYW5nZXMvZ2l0cG9sbGVyLnB5OgogQWxsb3cgdHdvIGdpdHBvbGxl
cnMgd2l0aCBzYW1lIHJlcG9zaXRvcnkgYW5kIGRpZmZlcmVudCBicmFuY2hlcwoKVHdvIEdpdFBv
bGxlcnMgd2l0aCB0aGUgc2FtZSByZXBvc2l0b3J5IGJ1dCBkaWZmZXJlbnQgY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xsaW5nQ2hhbmdlU291cmNlLCBTdGF0ZU1peGlu
KToKICAgICAgICAgaWYgcG9sbGludGVydmFsICE9IC0yOgogICAgICAgICAgICAgcG9sbEludGVy
dmFsID0gcG9sbGludGVydmFsCiAKLSAgICAgICAgYmFzZS5Qb2xsaW5nQ2hhbmdlU291cmNlLl9f
aW5pdF9fKHNlbGYsIG5hbWU9cmVwb3VybCwKLSAgICAgICAgICAgICAgICBwb2xsSW50ZXJ2YWw9
cG9sbEludGVydmFsKQotCi0gICAgICAgIGlmIHByb2plY3QgaXMgTm9uZTogcHJvamVjdCA9ICcn
Ci0KICAgICAgICAgaWYgYnJhbmNoIGFuZCBicmFuY2hlczoKICAgICAgICAgICAgIGNvbmZpZy5l
cnJvcigiR2l0UG9sbGVyOiBjYW4ndCBzcGVjaWZ5IGJvdGggYnJhbmNoIGFuZCBicmFuY2hlcyIp
CiAgICAgICAgIGVsaWYgYnJhbmNoOgpAQCAtNTQsNiArNDksMTEgQEAgY2xhc3MgR2l0UG9sbGVy
KGJhc2UuUG9sbGluZ0NoYW5nZVNvdXJjZSwgU3RhdGVNaXhpbik6CiAgICAgICAgIGVsaWYgbm90
IGJyYW5jaGVzOgogICAgICAgICAgICAgYnJhbmNoZXMgPSBbJ21hc3RlciddCiAKKyAgICAgICAg
YmFzZS5Qb2xsaW5nQ2hhbmdlU291cmNlLl9faW5pdF9fKHNlbGYsIG5hbWU9cmVwb3VybCtzdHIo
YnJhbmNoZXMpLAorICAgICAgICAgICAgICAgIHBvbGxJbnRlcnZhbD1wb2xsSW50ZXJ2YWwpCisK
KyAgICAgICAgaWYgcHJvamVjdCBpcyBOb25lOiBwcm9qZWN0ID0gJycKKwogICAgICAgICBzZWxm
LnJlcG91cmwgPSByZXBvdXJsCiAgICAgICAgIHNlbGYuYnJhbmNoZXMgPSBicmFuY2hlcwogICAg
ICAgICBzZWxmLmVuY29kaW5nID0gZW5jb2RpbmcKLS0gCjIuNy40Cgo=
</data>

          </attachment>
      

    </bug>

</bugzilla>