Exemplo n.º 1
0
 def _done(bsid):
     # return a remotely-usable BuildSetStatus object
     bss = BuildSetStatus(bsid, status, db)
     from buildbot.status.client import makeRemote
     r = makeRemote(bss)
     #self.parent.parent.loop_done() # so it will notify builder loop
     return r
Exemplo n.º 2
0
 def _done(bsid):
     # return a remotely-usable BuildSetStatus object
     bss = BuildSetStatus(bsid, status, db)
     from buildbot.status.client import makeRemote
     r = makeRemote(bss)
     #self.parent.parent.loop_done() # so it will notify builder loop
     return r
Exemplo n.º 3
0
    def perspective_try(self, branch, revision, patch, repository, project,
                        builderNames, properties={}, ):
        db = self.scheduler.master.db
        log.msg("user %s requesting build on builders %s" % (self.username,
                                                             builderNames))

        # build the intersection of the request and our configured list
        builderNames = self.scheduler.filterBuilderList(builderNames)
        if not builderNames:
            return

        wfd = defer.waitForDeferred(
                db.sourcestamps.createSourceStamp(branch=branch, revision=revision,
                    repository=repository, project=project, patch_level=patch[0],
                    patch_body=patch[1], patch_subdir=''))
                    # note: no way to specify patch subdir - #1769
        yield wfd
        ssid = wfd.getResult()

        reason = "'try' job from user %s" % self.username

        requested_props = Properties()
        requested_props.update(properties, "try build")
        wfd = defer.waitForDeferred(
                self.scheduler.addBuildsetForSourceStamp(ssid=ssid,
                        reason=reason, properties=requested_props,
                        builderNames=builderNames))
        yield wfd
        bsid = wfd.getResult()

        # return a remotely-usable BuildSetStatus object
        bss = BuildSetStatus(bsid, self.scheduler.master.status, db)
        from buildbot.status.client import makeRemote
        r = makeRemote(bss)
        yield r # return value
Exemplo n.º 4
0
    def perspective_try(self, branch, revision, patch, builderNames, properties={}):
        log.msg("user %s requesting build on builders %s" % (self.username,
                                                             builderNames))
        for b in builderNames:
            if not b in self.parent.builderNames:
                log.msg("%s got job with builder %s" % (self, b))
                log.msg(" but that wasn't in our list: %s"
                        % (self.parent.builderNames,))
                return
        ss = SourceStamp(branch, revision, patch)
        reason = "'try' job from user %s" % self.username

        # roll the specified props in with our inherited props
        combined_props = Properties()
        combined_props.updateFromProperties(self.parent.properties)
        combined_props.update(properties, "try build")

        bs = buildset.BuildSet(builderNames, 
                               ss,
                               reason=reason, 
                               properties=combined_props)

        self.parent.submitBuildSet(bs)

        # return a remotely-usable BuildSetStatus object
        from buildbot.status.client import makeRemote
        return makeRemote(bs.status)
Exemplo n.º 5
0
    def perspective_try(self,
                        branch,
                        revision,
                        patch,
                        repository,
                        project,
                        builderNames,
                        who="",
                        comment="",
                        properties={}):
        db = self.scheduler.master.db
        log.msg("user %s requesting build on builders %s" %
                (self.username, builderNames))

        # build the intersection of the request and our configured list
        builderNames = self.scheduler.filterBuilderList(builderNames)
        if not builderNames:
            return

        reason = "'try' job"

        if who:
            reason += " by user %s" % who

        if comment:
            reason += " (%s)" % comment

        sourcestampsetid = yield db.sourcestampsets.addSourceStampSet()

        # note: no way to specify patch subdir - #1769
        yield db.sourcestamps.addSourceStamp(branch=branch,
                                             revision=revision,
                                             repository=repository,
                                             project=project,
                                             patch_level=patch[0],
                                             patch_body=patch[1],
                                             patch_subdir='',
                                             patch_author=who or '',
                                             patch_comment=comment or '',
                                             codebase='',
                                             sourcestampsetid=sourcestampsetid)

        requested_props = Properties()
        requested_props.update(properties, "try build")
        (bsid, brids) = yield self.scheduler.addBuildsetForSourceStamp(
            setid=sourcestampsetid,
            reason=reason,
            properties=requested_props,
            builderNames=builderNames)

        # return a remotely-usable BuildSetStatus object
        bsdict = yield db.buildsets.getBuildset(bsid)

        bss = BuildSetStatus(bsdict, self.scheduler.master.status)
        from buildbot.status.client import makeRemote
        defer.returnValue(makeRemote(bss))
Exemplo n.º 6
0
    def perspective_try(self, branch, revision, patch, repository, taskId, project,
                        builderNames, who="", comment="", properties={}):
        db = self.scheduler.master.db
        log.msg("user %s requesting build on builders %s" % (self.username,
                                                             builderNames))

        # build the intersection of the request and our configured list
        builderNames = self.scheduler.filterBuilderList(builderNames)
        if not builderNames:
            log.msg("incoming Try job from user %s did not specify a valid job id" % self.username)
            return

        # Mx specific
        if self.scheduler.auto:
            if not taskId:
                log.msg("incoming Try auto job from user %s did not specify a task id" % self.username)
                return
            issue = self.jiraClient.getIssue(taskId) 
            if not issue: 
                log.msg("incoming Try auto job from user %s did not specify a valid task id" % self.username)
                return
            properties["tpks"]=issue["tpks"]
            properties["taskId"]=taskId
            log.msg("incoming Try auto job from user %s properties %s" % (self.username, properties["tpks"]) ) 

        reason = "'try' job"

        if who:
            reason += " by user %s" % who

        if comment:
            reason += " (%s)" % comment

        sourcestampsetid = yield db.sourcestampsets.addSourceStampSet()

        yield db.sourcestamps.addSourceStamp(
            branch=branch, revision=revision, repository=repository,
            project=project, patch_level=patch[0], patch_body=patch[1],
            patch_subdir='', patch_author=who or '',
            patch_comment=comment or '',
            sourcestampsetid=sourcestampsetid)
                    # note: no way to specify patch subdir - #1769

        requested_props = Properties()
        requested_props.update(properties, "try build")
        (bsid, brids) = yield self.scheduler.addBuildsetForSourceStamp(
                setid=sourcestampsetid, reason=reason,
                properties=requested_props, builderNames=builderNames)

        # return a remotely-usable BuildSetStatus object
        bsdict = yield db.buildsets.getBuildset(bsid)

        bss = BuildSetStatus(bsdict, self.scheduler.master.status)
        from buildbot.status.client import makeRemote
        defer.returnValue(makeRemote(bss))
Exemplo n.º 7
0
    def perspective_try(self,
                        branch,
                        revision,
                        patch,
                        repository,
                        project,
                        builderNames,
                        who='',
                        properties={}):
        db = self.scheduler.master.db
        log.msg("user %s requesting build on builders %s" %
                (self.username, builderNames))

        # build the intersection of the request and our configured list
        builderNames = self.scheduler.filterBuilderList(builderNames)
        if not builderNames:
            return

        wfd = defer.waitForDeferred(
            db.sourcestamps.addSourceStamp(branch=branch,
                                           revision=revision,
                                           repository=repository,
                                           project=project,
                                           patch_level=patch[0],
                                           patch_body=patch[1],
                                           patch_subdir=''))
        # note: no way to specify patch subdir - #1769
        yield wfd
        ssid = wfd.getResult()

        reason = "'try' job"
        if who:
            reason += " by user %s" % who

        requested_props = Properties()
        requested_props.update(properties, "try build")
        wfd = defer.waitForDeferred(
            self.scheduler.addBuildsetForSourceStamp(
                ssid=ssid,
                reason=reason,
                properties=requested_props,
                builderNames=builderNames))
        yield wfd
        (bsid, brids) = wfd.getResult()

        # return a remotely-usable BuildSetStatus object
        wfd = defer.waitForDeferred(db.buildsets.getBuildset(bsid))
        yield wfd
        bsdict = wfd.getResult()

        bss = BuildSetStatus(bsdict, self.scheduler.master.status)
        from buildbot.status.client import makeRemote
        r = makeRemote(bss)
        yield r  # return value
Exemplo n.º 8
0
    def perspective_try(self, branch, revision, patch, repository, project,
                        builderNames, who="", comment="", properties={} ):
        db = self.scheduler.master.db
        log.msg("user %s requesting build on builders %s" % (self.username,
                                                             builderNames))

        # build the intersection of the request and our configured list
        builderNames = self.scheduler.filterBuilderList(builderNames)
        if not builderNames:
            return

        reason = "'try' job"
        
        if who:
            reason += " by user %s" % who
            
        if comment:
            reason += " (%s)" % comment

        wfd = defer.waitForDeferred(db.sourcestampsets.addSourceStampSet())
        yield wfd
        sourcestampsetid = wfd.getResult()

        wfd = defer.waitForDeferred(
                db.sourcestamps.addSourceStamp(branch=branch, revision=revision,
                    repository=repository, project=project, patch_level=patch[0],
                    patch_body=patch[1], patch_subdir='', patch_author=who or '',
                    patch_comment=comment or '', sourcestampsetid = sourcestampsetid))
                    # note: no way to specify patch subdir - #1769
        yield wfd
        wfd.getResult()

        requested_props = Properties()
        requested_props.update(properties, "try build")
        wfd = defer.waitForDeferred(
                self.scheduler.addBuildsetForSourceStamp(setid=sourcestampsetid,
                        reason=reason, properties=requested_props,
                        builderNames=builderNames))
        yield wfd
        (bsid,brids) = wfd.getResult()

        # return a remotely-usable BuildSetStatus object
        wfd = defer.waitForDeferred(
                db.buildsets.getBuildset(bsid))
        yield wfd
        bsdict = wfd.getResult()

        bss = BuildSetStatus(bsdict, self.scheduler.master.status)
        from buildbot.status.client import makeRemote
        r = makeRemote(bss)
        yield r # return value
Exemplo n.º 9
0
    def perspective_try(self, branch, revision, patch, builderNames):
        log.msg("user %s requesting build on builders %s" % (self.username,
                                                             builderNames))
        for b in builderNames:
            if not b in self.parent.builderNames:
                log.msg("%s got job with builder %s" % (self, b))
                log.msg(" but that wasn't in our list: %s"
                        % (self.parent.builderNames,))
                return
        ss = SourceStamp(branch, revision, patch)
        reason = "'try' job from user %s" % self.username
        bs = buildset.BuildSet(builderNames, ss, reason=reason)
        self.parent.submitBuildSet(bs)

        # return a remotely-usable BuildSetStatus object
        from buildbot.status.client import makeRemote
        return makeRemote(bs.status)
Exemplo n.º 10
0
    def perspective_try(self, branch, revision, patch, builderNames):
        log.msg("user %s requesting build on builders %s" %
                (self.username, builderNames))
        for b in builderNames:
            if not b in self.parent.builderNames:
                log.msg("%s got job with builder %s" % (self, b))
                log.msg(" but that wasn't in our list: %s" %
                        (self.parent.builderNames, ))
                return
        ss = SourceStamp(branch, revision, patch)
        reason = "'try' job from user %s" % self.username
        bs = buildset.BuildSet(builderNames, ss, reason=reason)
        self.parent.submitBuildSet(bs)

        # return a remotely-usable BuildSetStatus object
        from buildbot.status.client import makeRemote
        return makeRemote(bs.status)
Exemplo n.º 11
0
 def testAdaptation(self):
     b = builder.BuilderStatus("bname")
     b2 = client.makeRemote(b)
     self.failUnless(isinstance(b2, client.RemoteBuilder))
     b3 = client.makeRemote(None)
     self.failUnless(b3 is None)
Exemplo n.º 12
0
 def testAdaptation(self):
     b = builder.BuilderStatus("bname")
     b2 = client.makeRemote(b)
     self.failUnless(isinstance(b2, client.RemoteBuilder))
     b3 = client.makeRemote(None)
     self.failUnless(b3 is None)