Skip to contentSkip to conversation

SingleBranchScheduler: check each repo but not only the first one

PATCH In review Yin Kangkai 2 participants 6 messages May 20, 2014 – May 30, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 SingleBranchScheduler: check each repo but not only the first one

Without this patch, when you set a SingleBranchScheduler scheduler, code will only check against the first repo in repos list. e.g.:

In buildset-config/xxx.conf, I have this:

repos: [{'poky':

            {'repourl':'ssh://[email protected]:29418/poky',
             'bbpriority':'1',
             'branch':'galileo'}
             },
        {'meta-oe':
            {'repourl':'git://github.com/openembedded/meta-oe',
             'bbpriority':'1',
             'branch':'master',
             'hash':'13ae5105ee30410136beeae66ec41ee4a8a2e2b0'}
             },
	...

scheduler: [{'Continuous':

                {'type': 'SingleBranchScheduler',
                 'repository': 'meta-oe',
                 'stable-timer': 30}
            }]

Code will only check 'meta-oe' in scheduler against 'poly', and leads to a fail. This patch fix this.

---
 lib/python2.7/site-packages/autobuilder/Autobuilder.py | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
lib/python2.7/site-packages/autobuilder/Autobuilder.py +6 -4
index 4c33489..2a510d4 100644
@@ -201,10 +201,12 @@ class Autobuilder:
                             continue
 
                         reponame = value['repository']
-                        repos = dict(ast.literal_eval(self.configdict[key]['repos'])[0])
-                        if not repos.has_key(reponame):
-                            log.msg("No repo %s found" % reponame)
-                            continue
+                        for repos in ast.literal_eval(self.configdict[key]['repos']):
+                            if not repos.has_key(reponame):
+                                continue
+                            else:
+                                log.msg("Repo %s found" % reponame)
+                                break
 
                         repo=repos[reponame]
                         if not repo.has_key('repourl'):
Signature · 1 line
1.8.2.1
#1 lore raw

PATCH 2/3 SingleBranchScheduler: pass in the properties

Pass in the properties parsed from config file, otherwise the build triggered will fail because wrong properties.

---
 lib/python2.7/site-packages/autobuilder/Autobuilder.py | 1 +
 1 file changed, 1 insertion(+)
lib/python2.7/site-packages/autobuilder/Autobuilder.py +1 -0
index 2a510d4..1aba7ac 100644
@@ -233,6 +233,7 @@ class Autobuilder:
                             stabletimer = value['stable-timer']
                         self.yocto_sched.append(SingleBranchScheduler(name=str(name),
                                                                       builderNames=['%s' % key],
+                                                                      properties=checkoutprops,
                                                                       change_filter=filter.ChangeFilter(branch=branch,
                                                                                                         repository=repo['repourl']),
                                                                       treeStableTimer=stabletimer))
Signature · 1 line
1.8.2.1
#2 lore raw

PATCH 3/3 GetDistroVersion: also support clanton distro

In reply to Yin Kangkai

Otherwise, step GetDistroVersion will just fail.

---
 lib/python2.7/site-packages/autobuilder/buildsteps/GetDistroVersion.py | 2 ++
 1 file changed, 2 insertions(+)
lib/python2.7/site-packages/autobuilder/buildsteps/GetDistroVersion.py +2 -0
index 3d4f314..c60a786 100644
@@ -36,6 +36,8 @@ class GetDistroVersion(ShellCommand):
             distroconf=self.slaveworkdir + "/" + buildername + "/build/meta-yocto/conf/distro/poky.conf|grep 'DISTRO_VERSION = \"'"
         elif 'oecore' in self.distro:
             distroconf=self.slaveworkdir + "/" + buildername + "/build/meta/conf/distro/include/default-distrovars.inc|grep 'DISTRO_VERSION '"
+        elif 'clanton' in self.distro:
+            distroconf=self.slaveworkdir + "/" + buildername + "/build/meta-yocto/conf/distro/poky.conf|grep 'DISTRO_VERSION = \"'"
         else:
             self.finished(FAILURE)
         cmd = 'cat ' + distroconf
Signature · 1 line
1.8.2.1
#3 lore raw
In reply to Yin Kangkai

[up post intentionally]

I was trying to setup yocto-autobuilder in my local env, and customize it to my needs (i.e. watch git/gerrit event and only build my images). It is a little bit of struggle for me to make it finally work (due to the fact I am little knowledge to both buildbot and python.)

Anyway, these several patches are needed in my setup. Please review and considering merge.

If this is not the right mailing list, please let me know. Thanks.

Regards,
Kangkai

Quoted 2 lines · Yin Kangkai

Without this patch, when you set a SingleBranchScheduler scheduler, code will only check against the first repo in repos list. e.g.:

...

#4 lore raw
Quoted 11 lines · Yin Kangkai

[up post intentionally]

I was trying to setup yocto-autobuilder in my local env, and customize it to my needs (i.e. watch git/gerrit event and only build my images). It is a little bit of struggle for me to make it finally work (due to the fact I am little knowledge to both buildbot and python.)

Anyway, these several patches are needed in my setup. Please review and considering merge.

If this is not the right mailing list, please let me know. Thanks.

Sorry, any response on this patch set?

Quoted 4 lines · Yin Kangkai
Quoted 2 lines

Without this patch, when you set a SingleBranchScheduler scheduler, code will only check against the first repo in repos list. e.g.:

...

#5 lore raw

Sorry Yin, I've been backlogged. I have it in my preproduction test setup. I should pull tomorrow if all goes well.

-b

Quoted 19 lines · Yin Kangkai
Quoted 11 lines · Yin Kangkai

[up post intentionally]

I was trying to setup yocto-autobuilder in my local env, and customize it to my needs (i.e. watch git/gerrit event and only build my images). It is a little bit of struggle for me to make it finally work (due to the fact I am little knowledge to both buildbot and python.)

Anyway, these several patches are needed in my setup. Please review and considering merge.

If this is not the right mailing list, please let me know. Thanks.

Sorry, any response on this patch set?

Quoted 4 lines · Yin Kangkai
Quoted 2 lines

Without this patch, when you set a SingleBranchScheduler scheduler, code will only check against the first repo in repos list. e.g.:

...

Signature · 3 lines
Elizabeth Flanagan
Yocto Project
Build and Release