Skip to contentSkip to conversation

GitPoller changesource improvements

PATCH In review Bryan Evenson 2 participants 6 messages Dec 5, 2014 – Dec 9, 2014

lore
Share & tools
lore
#0 lore raw

cover GitPoller changesource improvements

These are fixes on top of California Sullivan's work for adding the GitPoller changesource. With my testing, I was unable to get the GitPoller changesource to work until I added the first patch. The second patch documents how to use the GitPoller changesource.

Applies on top of HEAD of git://git.yoctoproject.org/yocto-autobuilder branch sullical/contrib

Bryan Evenson (2):
Autobuilder.py: Import gitpoller module
Documentation: Document GitPoller changesource

 README-NEW-AUTOBUILDER                             |   35 ++++++++++++++++----
 docs/YoctoAutobuilderDevelopersDocument.html       |   26 +++++++++++++--
 .../site-packages/autobuilder/Autobuilder.py       |    1 +
 3 files changed, 54 insertions(+), 8 deletions(-)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/2 Autobuilder.py: Import gitpoller module

For the GitPoller changesource to work, Autobuilder.py needs the Buildbot GitPoller module. This commit imports the GitPoller module in Autobuilder.py.

---
 .../site-packages/autobuilder/Autobuilder.py       |    1 +
 1 file changed, 1 insertion(+)
lib/python2.7/site-packages/autobuilder/Autobuilder.py +1 -0
index b76c213..0dae5dc 100644
@@ -18,6 +18,7 @@ from buildbot.schedulers import timed
 from buildbot.schedulers.basic  import SingleBranchScheduler
 from buildbot.changes import filter
 from buildbot.changes.pb import PBChangeSource
+from buildbot.changes.gitpoller import *
 from lib.ABTools import capitalize
 import ast
 import BuildSet
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH 2/2 Documentation: Document GitPoller changesource

In reply to Bryan Evenson

Adds documentation to README-NEW-AUTOBUILDER and the HTML documentation on how to use the GitPoller changesource.

---
 README-NEW-AUTOBUILDER                       |   35 +++++++++++++++++++++-----
 docs/YoctoAutobuilderDevelopersDocument.html |   26 +++++++++++++++++--
 2 files changed, 53 insertions(+), 8 deletions(-)
README-NEW-AUTOBUILDER +29 -6
index a6476f2..97bbe61 100644
@@ -182,7 +182,8 @@ scheduler: A list of dicts. Each item defines a scheduler associated with this
                     definition.
 
                stable-timer: how long (in seconds) to wait after change before
-                    triggering build to allow for changes to settle.
+                    triggering build to allow for changes to settle.  Defaults
+                    to 60 seconds.
 
 	       change-user: the user name which the remote hook will use; the
                     default value is the repository name as per the 'repository'
@@ -194,6 +195,17 @@ scheduler: A list of dicts. Each item defines a scheduler associated with this
                     secret to avoid injection of arbitrary changes into your
                     autobuilder.
 
+               changesource: the type of changesource to use for the scheduler;
+                    the default setting is a PBChangeSource.  Only other valid
+                    option is 'GitPoller' for a GitPoller changesource.  See the
+                    official Buildbot documentation at
+                    http://docs.buildbot.net/latest/manual/cfg-changesources.html
+                    for more information on changesources.
+               
+               interval: The interval between polling for changes.  Only valid
+                    for GitPoller changesources.  Defaults to 300 seconds (five
+                    minutes).
+
            Extra Notes on SingleBranchScheduler setup
            ------------------------------------------
 
@@ -204,10 +216,10 @@ scheduler: A list of dicts. Each item defines a scheduler associated with this
            do nightly rebuilds for some repos and immediate for others.
 
            The scheduler change filter is set up to watch changes only in the
-           single repository specified, so you have to set up your repository
-           hook to sent the repository url in the change set with the
-           --repository argument to git_buildbot.py, e.g., your git post-receive
-           hook could look something like:
+           single repository specified.  If you are using a PBChangeSource, you
+           have to set up your repository hook to send the repository url in the
+           change set with the --repository argument to git_buildbot.py, e.g.,
+           your git post-receive hook could look something like:
 
              #!/bin/sh
              echo "$1 $2 $3" | \
@@ -224,7 +236,18 @@ scheduler: A list of dicts. Each item defines a scheduler associated with this
                   git_buildbot.py --repository="file:///where_your_repo_is"
 
            Because of the way builbot change sources work, your change user
-           names must not colide with the user names used by your slaves.
+           names must not collide with the user names used by your slaves.
+
+           If you are using a GitPoller changesource and you specify a valid
+           repository but an non-existent branch, Buildbot will silently ignore
+           your scheduler. If a repository has changed recently but your build
+           has not triggered, validate that your repository and branch settings
+           are valid.
+
+           For either a PBChangeSource or a GitPoller changesource, the
+           scheduler will not see the initial repository discovery as a change.
+           If you are using a SingleBranchScheduler schedule, it is good
+           practice to force a build to verify the buildset works correctly.
 
 Example:
 
docs/YoctoAutobuilderDevelopersDocument.html +24 -2
index e3eb406..d8c5ccb 100644
@@ -1218,7 +1218,7 @@
                         <p class="c0"><span class="c9">the user name which the remote hook will use; the &nbsp;default value is the repository name as per the &#39;repository&#39; property.</span></p>
                     </td>
                 </tr>
-                <tr class="c3">
+                 <tr class="c3">
                     <td class="c15" colspan="1" rowspan="1">
                         <p class="c0"><span class="c9">change-password</span></p>
                     </td>
@@ -1229,15 +1229,37 @@
                         <p class="c0"><span class="c9">password which the remote hook will use; the default is the buildbot default &#39;changepw&#39; -- if your autobuilder is publically accessible, you want to keep this secret to avoid injection of arbitrary changes into your autobuilder.<br></span></p>
                     </td>
                 </tr>
+                <tr class="c3">
+                    <td class="c15" colspan="1" rowspan="1">
+                        <p class="c0"><span class="c9">changesource</span></p>
+                    </td>
+                    <td class="c28" colspan="1" rowspan="1">
+                        <p class="c0"><span class="c9">Optional</span></p>
+                    </td>
+                    <td class="c45" colspan="1" rowspan="1">
+                        <p class="c0"><span class="c9">the type of changesource to use for the scheduler; the default setting is a PBChangeSource. Only other valid option is 'GitPoller' for a GitPoller changesource. See the <span class="c20"><a class="c29" href="http://docs.buildbot.net/latest/manual/cfg-changesources.html">Buildbot Changesource documentation</a></span><span>&nbsp;for more information on changesources.<br></span></p>
+                    </td>
+                <tr class="c3">
+                    <td class="c15" colspan="1" rowspan="1">
+                        <p class="c0"><span class="c9">interval</span></p>
+                    </td>
+                    <td class="c28" colspan="1" rowspan="1">
+                        <p class="c0"><span class="c9">Optional</span></p>
+                    </td>
+                    <td class="c45" colspan="1" rowspan="1">
+                        <p class="c0"><span class="c9">The interval between polling for changes. Only valid for GitPoller changesources. Defaults to 300 seconds (five minutes).<br></span></p>
+                    </td>
+                 </tr>
             </tbody>
         </table>
         <h5 class="c4 c14"><a name="h.9xpudqajj26x"></a><span><br></span><span class="c43">Extra Notes on SingleBranchScheduler setup</span><span><br></span></h5>
         <p class="c4"><span>There is one SBS scheduler for each repository in the buildset, i.e., if your buildset contains more repositories, and you want build triggered by changes to any of them, you need to define a scheduler for each. This also means that you can mix and match, e.g., only do nightly rebuilds for some repos and immediate for others.<br></span></p>
-        <p class="c4"><span>The scheduler change filter is set up to watch changes only in the single repository specified, so you have to set up your repository hook to sent the repository url in the change set with the --repository argument to git_buildbot.py, e.g., your git post-receive &nbsp;hook could look something like:<br></span></p>
+        <p class="c4"><span>The scheduler change filter is set up to watch changes only in the single repository specified. If you are using a PBChangeSource, you have to set up your repository hook to send the repository url in the change set with the --repository argument to git_buildbot.py, e.g., your git post-receive hook could look something like:<br></span></p>
         <h6 class="c4 c14"><a name="h.xrluuas8ukd9"></a><span><br> &nbsp; &nbsp;#!/bin/sh<br> &nbsp; &nbsp;echo &quot;$1 $2 $3&quot; | git_buildbot.py --repository=&quot;git://some_repo...&quot;<br></span></h6>
         <p class="c4"><span><br>For local testing, you can use a post-merge hook instead, along these lines:</span></p>
         <h6 class="c4 c14"><a name="h.64rcw99ffkjq"></a><span><br> &nbsp; &nbsp;#!/bin/sh<br> &nbsp; &nbsp;PRE=$(git rev-parse &#39;HEAD@{1}&#39;)<br> &nbsp; &nbsp;POST=$(git rev-parse HEAD)<br> &nbsp; &nbsp;SYMNAME=$(git rev-parse --symbolic-full-name HEAD)<br> &nbsp; &nbsp;echo &quot;$PRE $POST $SYMNAME&quot; | \<br> &nbsp; &nbsp;git_buildbot.py --repository=&quot;file:///where_your_repo_is&quot;</span></h6>
         <p class="c4"><span><br>Because of the way buildbot change sources work, your change user names must not collide with the user names used by your slaves.</span></p>
+        <p class="c4"><span><br>If you are using a GitPoller changesource and you specify a valid repository but an non-existent branch, Buildbot will silently ignore your scheduler. If a repository has changed recently but your build has not triggered, validate that your repository and branch settings are valid.</span></p><p class="c4"><span><br>For either a PBChangeSource or a GitPoller changesource, the scheduler will not see the initial repository discovery as a change. If you are using a SingleBranchScheduler schedule, it is good practice to force a build after initial setup to verify the buildset works correctly.</span></p>
         <p class="c4 c6"><span></span></p>
         <h3 class="c4 c14"><a name="h.fs6mwzkke7xv"></a><span>How do I create my own buildset?</span></h3>
         <ol class="c7 lst-kix_rxf8talb6b1y-0 start" start="1">
Signature · 1 line
1.7.9.5
#3 lore raw
In reply to Bryan Evenson

Pulled into master, thanks!

-b

Quoted 19 lines · Bryan Evenson

These are fixes on top of California Sullivan's work for adding the GitPoller changesource. With my testing, I was unable to get the GitPoller changesource to work until I added the first patch. The second patch documents how to use the GitPoller changesource.

Applies on top of HEAD of git://git.yoctoproject.org/yocto-autobuilder branch sullical/contrib

Bryan Evenson (2):
Autobuilder.py: Import gitpoller module
Documentation: Document GitPoller changesource

 README-NEW-AUTOBUILDER                             |   35 ++++++++++++++++----
 docs/YoctoAutobuilderDevelopersDocument.html       |   26 +++++++++++++--
 .../site-packages/autobuilder/Autobuilder.py       |    1 +
 3 files changed, 54 insertions(+), 8 deletions(-)

--
1.7.9.5

Signature · 3 lines
Elizabeth Flanagan
Yocto Project
Build and Release
#4 lore raw

Elizabeth,

Thanks for pulling in my commits, but it is incomplete. The top two commits from the sullical/contrib branch are needed before the GitPoller changesource will work. Specifically, they are commits ecf1b8716d7e695a88976bba747af5c5bbe0007f and c0aac5c415797aac5c204b2b70ee5a896d76ffdc. Once these are in place the GitPoller changesource should work.

Regards,
Bryan

Quoted 41 lines

-----Original Message-----
From: Flanagan, Elizabeth [mailto:[email protected]]
Sent: Monday, December 08, 2014 7:33 PM
To: Bryan Evenson
Cc: [email protected]; California L Sullivan
Subject: Re: [autobuilder][PATCH 0/2] GitPoller changesource improvements

Pulled into master, thanks!

-b

Quoted 8 lines · Bryan Evenson

These are fixes on top of California Sullivan's work for adding the GitPoller changesource. With my testing, I was unable to get the GitPoller changesource to work until I added the first patch. The second patch documents how to use the GitPoller changesource.

Applies on top of HEAD of git://git.yoctoproject.org/yocto-autobuilder
branch sullical/contrib

Quoted 6 lines

Bryan Evenson (2):
Autobuilder.py: Import gitpoller module
Documentation: Document GitPoller changesource

 README-NEW-AUTOBUILDER                             |   35 ++++++++++++++++----
 docs/YoctoAutobuilderDevelopersDocument.html       |   26

+++++++++++++--

Quoted 6 lines
 .../site-packages/autobuilder/Autobuilder.py       |    1 +
 3 files changed, 54 insertions(+), 8 deletions(-)

--
1.7.9.5

--
Elizabeth Flanagan
Yocto Project
Build and Release

#5 lore raw
Quoted 3 lines · Bryan Evenson

Elizabeth,

Thanks for pulling in my commits, but it is incomplete. The top two commits from the sullical/contrib branch are needed before the GitPoller changesource will work. Specifically, they are commits ecf1b8716d7e695a88976bba747af5c5bbe0007f and c0aac5c415797aac5c204b2b70ee5a896d76ffdc. Once these are in place the GitPoller changesource should work.

Ah. I think these got missed in Cals pull request (or he had an earlier pull request I missed?) I've looked at the commits and have pulled them into master-next. They should be in master by EOD.

Thanks!

-b

Quoted 45 lines

Regards,
Bryan

Quoted 41 lines

-----Original Message-----
From: Flanagan, Elizabeth [mailto:[email protected]]
Sent: Monday, December 08, 2014 7:33 PM
To: Bryan Evenson
Cc: [email protected]; California L Sullivan
Subject: Re: [autobuilder][PATCH 0/2] GitPoller changesource improvements

Pulled into master, thanks!

-b

Quoted 8 lines · Bryan Evenson

These are fixes on top of California Sullivan's work for adding the GitPoller changesource. With my testing, I was unable to get the GitPoller changesource to work until I added the first patch. The second patch documents how to use the GitPoller changesource.

Applies on top of HEAD of git://git.yoctoproject.org/yocto-autobuilder
branch sullical/contrib

Quoted 6 lines

Bryan Evenson (2):
Autobuilder.py: Import gitpoller module
Documentation: Document GitPoller changesource

 README-NEW-AUTOBUILDER                             |   35 ++++++++++++++++----
 docs/YoctoAutobuilderDevelopersDocument.html       |   26

+++++++++++++--

Quoted 6 lines
 .../site-packages/autobuilder/Autobuilder.py       |    1 +
 3 files changed, 54 insertions(+), 8 deletions(-)

--
1.7.9.5

--
Elizabeth Flanagan
Yocto Project
Build and Release

Signature · 3 lines
Elizabeth Flanagan
Yocto Project
Build and Release