Ticket #227 (closed enhancement: fixed)
New "scheduler" property in process.base.Build
| Reported by: | dossy | Owned by: | |
|---|---|---|---|
| Priority: | minor | Milestone: | 0.7.8 |
| Version: | Keywords: | scheduler, nightly | |
| Cc: |
Description
It is useful to know the name of the scheduler that initiated a build request, i.e., to conditionally FileUpload? the results of a Nightly scheduled build.
The patch I'm attaching passes the Scheduler along the BuildRequest? chain so that Build can setProperty("scheduler", self.scheduler.name) in Build.setupStatus().
It can then be used like this:
class CustomFileUpload(FileUpload):
def start(self):
scheduler = self.build.getProperty("scheduler")
if scheduler == "nightly":
FileUpload.start(self)
else:
self.step_status.setColor("green")
self.step_status.setText(["upload", "skipped"])
self.addCompleteLog("log", "skipped upload (not a nightly build, scheduler '%s')\n" % scheduler)
return SKIPPED
Attachments
Change History
Changed 4 years ago by dossy
-
attachment
scheduler-property-in-build-patch.txt
added
comment:2 Changed 4 years ago by dustin
- Milestone changed from undecided to 0.7.8
Looks good and passes tests. Attachment is committed to devel tree in #227:scheduler-property-in-build.patch, with some documentation in #227:scheduler-property-docs.patch.
Brian, I don't have TeX or inkscape installed, so I can't verify the correctness of the documentation, but it should be Close Enough.
![[Buildbot Logo]](/chrome/site/header-text-transparent.png)
scheduler-property-in-build-patch.txt