def setupBuild(self, expectations): # create the actual BuildSteps. If there are any name collisions, we # add a count to the loser until it is unique. self.steps = [] self.stepStatuses = {} sps = [] self.createSteps(sps) # Create a buildbot.status.progress.BuildProgress object. This is # called once at startup to figure out how to build the long-term # Expectations object, and again at the start of each build to get a # fresh BuildProgress object to track progress for that individual # build. TODO: revisit at-startup call if self.useProgress: self.progress = BuildProgress(sps) if self.progress and expectations: self.progress.setExpectationsFrom(expectations) # we are now ready to set up our BuildStatus. # pass all sourcestamps to the buildstatus self.build_status.setSourceStamps(self.sources) self.build_status.setReason(self.reason) self.builder.builder_status.reason = self.reason self.build_status.setBlamelist(self.blamelist()) self.build_status.setProgress(self.progress) if len(self.requests) > 0: self.build_status.setSubmitted(self.requests[0].submittedAt) self.setProperty("submittedTime", self.requests[0].submittedAt, "buildrequest") brids = [req.id for req in self.requests] self.build_status.setBuildRequestIDs(brids) self.setProperty("brids", brids, "buildrequest") self.build_status.setBuildChainID(self.requests[0].buildChainID) self.setProperty("buildChainID", self.requests[0].buildChainID, "buildrequest") # gather owners from build requests owners = [ r.properties['owner'] for r in self.requests if r.properties.has_key('owner') ] if owners: self.setProperty('owners', owners, self.reason) self.build_status.setOwners(owners) self.results = [] # list of FAILURE, SUCCESS, WARNINGS, SKIPPED self.result = SUCCESS # overall result, may downgrade after each step self.text = [] # list of text string lists (text2)
def setupBuild(self, expectations): # create the actual BuildSteps. If there are any name collisions, we # add a count to the loser until it is unique. self.steps = [] self.stepStatuses = {} stepnames = {} sps = [] for factory, args in self.stepFactories: args = args.copy() try: step = factory(**args) except: log.msg("error while creating step, factory=%s, args=%s" % (factory, args)) raise step.setBuild(self) step.setBuildSlave(self.slavebuilder.slave) if callable(self.workdir): step.setDefaultWorkdir(self.workdir(self.source)) else: step.setDefaultWorkdir(self.workdir) name = step.name if stepnames.has_key(name): count = stepnames[name] count += 1 stepnames[name] = count name = step.name + "_%d" % count else: stepnames[name] = 0 step.name = name self.steps.append(step) # tell the BuildStatus about the step. This will create a # BuildStepStatus and bind it to the Step. step_status = self.build_status.addStepWithName(name) step.setStepStatus(step_status) sp = None if self.useProgress: # XXX: maybe bail if step.progressMetrics is empty? or skip # progress for that one step (i.e. "it is fast"), or have a # separate "variable" flag that makes us bail on progress # tracking sp = step.setupProgress() if sp: sps.append(sp) # Create a buildbot.status.progress.BuildProgress object. This is # called once at startup to figure out how to build the long-term # Expectations object, and again at the start of each build to get a # fresh BuildProgress object to track progress for that individual # build. TODO: revisit at-startup call if self.useProgress: self.progress = BuildProgress(sps) if self.progress and expectations: self.progress.setExpectationsFrom(expectations) # we are now ready to set up our BuildStatus. self.build_status.setSourceStamp(self.source) self.build_status.setReason(self.reason) self.build_status.setBlamelist(self.blamelist()) self.build_status.setProgress(self.progress) # gather owners from build requests owners = [ r.properties['owner'] for r in self.requests if r.properties.has_key('owner') ] if owners: self.setProperty('owners', owners, self.reason) self.results = [] # list of FAILURE, SUCCESS, WARNINGS, SKIPPED self.result = SUCCESS # overall result, may downgrade after each step self.text = [] # list of text string lists (text2)
def setupBuild(self, expectations): # create the actual BuildSteps. If there are any name collisions, we # add a count to the loser until it is unique. self.steps = [] self.stepStatuses = {} stepnames = [] sps = [] for factory, args in self.stepFactories: args = args.copy() try: step = factory(**args) except: log.msg("error while creating step, factory=%s, args=%s" % (factory, args)) raise step.setBuild(self) step.setBuildSlave(self.slavebuilder.slave) step.setDefaultWorkdir(self.workdir) name = step.name count = 1 # LOCAL MOZILLA PATCH: # buildbotcustom.process.factory.ReleaseTaggingFactory uses # more than 100 ShellCommands when it runs - this has been bumped up # to support that. upstream buildbot bug here: # http://buildbot.net/trac/ticket/366 while name in stepnames and count < 1000: count += 1 name = step.name + "_%d" % count if name in stepnames: raise RuntimeError("duplicate step '%s'" % step.name) step.name = name stepnames.append(name) self.steps.append(step) # tell the BuildStatus about the step. This will create a # BuildStepStatus and bind it to the Step. step_status = self.build_status.addStepWithName(name) step.setStepStatus(step_status) sp = None if self.useProgress: # XXX: maybe bail if step.progressMetrics is empty? or skip # progress for that one step (i.e. "it is fast"), or have a # separate "variable" flag that makes us bail on progress # tracking sp = step.setupProgress() if sp: sps.append(sp) # Create a buildbot.status.progress.BuildProgress object. This is # called once at startup to figure out how to build the long-term # Expectations object, and again at the start of each build to get a # fresh BuildProgress object to track progress for that individual # build. TODO: revisit at-startup call if self.useProgress: self.progress = BuildProgress(sps) if self.progress and expectations: self.progress.setExpectationsFrom(expectations) # we are now ready to set up our BuildStatus. self.build_status.setSourceStamp(self.source) self.build_status.setReason(self.reason) self.build_status.setBlamelist(self.blamelist()) self.build_status.setProgress(self.progress) self.results = [] # list of FAILURE, SUCCESS, WARNINGS, SKIPPED self.result = SUCCESS # overall result, may downgrade after each step self.text = [] # list of text string lists (text2)
def setupBuild(self, expectations): # create the actual BuildSteps. If there are any name collisions, we # add a count to the loser until it is unique. self.steps = [] self.executedSteps = [] self.stepStatuses = {} stepnames = {} sps = [] for factory in self.stepFactories: step = factory.buildStep() step.setBuild(self) step.setBuildSlave(self.slavebuilder.slave) # TODO: remove once we don't have anything depending on setDefaultWorkdir if callable(self.workdir): step.setDefaultWorkdir(self.workdir(self.sources)) else: step.setDefaultWorkdir(self.workdir) name = step.name if name in stepnames: count = stepnames[name] count += 1 stepnames[name] = count name = step.name + "_%d" % count else: stepnames[name] = 0 step.name = name self.steps.append(step) sp = None if self.useProgress: # XXX: maybe bail if step.progressMetrics is empty? or skip # progress for that one step (i.e. "it is fast"), or have a # separate "variable" flag that makes us bail on progress # tracking sp = step.setupProgress() if sp: sps.append(sp) # Create a buildbot.status.progress.BuildProgress object. This is # called once at startup to figure out how to build the long-term # Expectations object, and again at the start of each build to get a # fresh BuildProgress object to track progress for that individual # build. TODO: revisit at-startup call if self.useProgress: self.progress = BuildProgress(sps) if self.progress and expectations: self.progress.setExpectationsFrom(expectations) # we are now ready to set up our BuildStatus. # pass all sourcestamps to the buildstatus self.build_status.setSourceStamps(self.sources) self.build_status.setReason(self.reason) self.build_status.setBlamelist(self.blamelist()) self.build_status.setProgress(self.progress) # gather owners from build requests owners = [r.properties['owner'] for r in self.requests if "owner" in r.properties] if owners: self.setProperty('owners', owners, self.reason) self.results = [] # list of FAILURE, SUCCESS, WARNINGS, SKIPPED self.result = SUCCESS # overall result, may downgrade after each step self.text = [] # list of text string lists (text2)