Opened 6 years ago

Last modified 6 years ago

#2906 new enhancement

Check the situation w/ HTML logs

Reported by: sa2ajj Owned by:
Priority: patches-accepted Milestone: 0.8.x
Version: 0.8.9 Keywords:
Cc:

Description

Relevant part of IRC chat starts at http://irclogs.jackgrigg.com/irc.freenode.net/buildbot/2014-09-17#i_3452473

As a basis, the http://pastebin.com/4Wh9DBux was used (attached).

Ended up with:

    def setupLogfiles(self, cmd, logfiles):
        for logname,remotefilename in logfiles.items():
            if self.lazylogfiles:
                # Ask RemoteCommand to watch a logfile, but only add
                # it when/if we see any data.
                #
                # The dummy default argument local_logname is a work-around for
                # Python name binding; default values are bound by value, but
                # captured variables in the body are bound by name.
                callback = lambda cmd_arg, local_logname=logname: self.addHTMLOrTextLog(local_logname, remotefilename)
                cmd.useLogDelayed(logname, callback, True)
            else:
                # tell the BuildStepStatus to add a LogFile
                newlog = self.addHTMLOrTextLog(logname, remotefilename)
                # and tell the RemoteCommand to feed it
                cmd.useLog(newlog, True)

    def addHTMLOrTextLog(self, logname, remotefilename):
            if ( remotefilename.lower().endswith( ".html" ) ):
                html = ""  # addHTMLLog requires html arg, but in this case, the actual contents are being added from the slave later.
                newlog = self.addHTMLLog(logname, html)
            else:
                # tell the BuildStepStatus to add a LogFile
                newlog = self.addLog(logname)
            return newlog

Attachments (1)

4Wh9DBux.py (5.8 KB) - added by sa2ajj 6 years ago.
The original patch to handle HTML log files

Download all attachments as: .zip

Change History (4)

Changed 6 years ago by sa2ajj

The original patch to handle HTML log files

comment:1 Changed 6 years ago by dustin

What is the action here? I'm not sure what you mean by "check".

Factoring some functionality to handle logfiles formatted as HTML in the new-style steps (ShellMixin, probably) seems like a great idea.

comment:2 Changed 6 years ago by sa2ajj

"Check" =

  • see what the patch does
  • if it's really the way
  • if not, how to do it
  • nine or eight first

and then "Do it".

You, obviously, have a better grasp for the Buildbot code, so you can easily see what needs to be done and where :)

comment:3 Changed 6 years ago by dustin

  • Looks like the patch makes log files with a remote name matching '*.html' into HTML logfiles
  • I think that's very reasonable; it might be nice to have a more explicit way of configuring the logfile type, too. I thought we allowed configuration for each logfile with something like logfiles = dict(somelogfile=dict(someoption=someotheroption)), but I don't see it in the source. Maybe that's a feature for later.
  • I'd rather see it in nine first, and then backported to eight, so any complications that arise in nine get handled before the backport starts.
Note: See TracTickets for help on using tickets.