Ticket #227 (closed enhancement: fixed)

Opened 2 years ago

Last modified 22 months ago

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

scheduler-property-in-build-patch.txt Download (7.5 KB) - added by dossy 2 years ago.
scheduler-property-in-build-patch.txt

Change History

Changed 2 years ago by dossy

scheduler-property-in-build-patch.txt

Changed 2 years ago by dossy

See also: #87 and #124.

Changed 2 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.

Changed 22 months ago by dustin

  • status changed from new to closed
  • resolution set to fixed

this is in brian's tree

Note: See TracTickets for help on using tickets.