* Pretty-print the logs.

[?]
Nov 18, 2008, 4:45 PM
BA46C5LNEQ57N52IJTCEXW4J74F33KKNYHYXE6ZJLQ5ARMCJPUHAC

Dependencies

  • [2] HJLYC753 * Adding input value alternatives.
  • [3] MOCEUXZA * Support serving products that are directories (such as manuals or
  • [4] UVMFS73T * Some jQuery / CSS hackery.
  • [5] YTZOC7C5 * Editing of jobset inputs.
  • [6] 7YBYT2LQ
  • [7] E2ZY5TE5
  • [8] J5UVLXOK * Start of a basic Catalyst web interface.
  • [9] 2GK5DOU7 * Downloading closures.
  • [10] L5VIEXSC * Allow downloading of build products.
  • [11] IK53RV4V
  • [12] CLJQCY2X * Store info about all the build actions and allow them to be
  • [13] PBFZEQLZ
  • [*] DVNWJXWW * Generic declaration of build products.

Change contents

  • replacement in src/HydraFrontend/lib/HydraFrontend/Controller/Root.pm at line 343
    [3.2452][3.2452:2593]()
    # !!! all a quick hack
    if ($path =~ /.bz2$/) {
    return `cat $path | bzip2 -d`;
    } else {
    return `cat $path`;
    }
    [3.2452]
    [3.2593]
    # !!! quick hack
    my $pipeline = ($path =~ /.bz2$/ ? "cat $path | bzip2 -d" : "cat $path")
    . " | nix-log2xml | xsltproc xsl/mark-errors.xsl - | xsltproc xsl/log2html.xsl - | tail -n +2";
    return `$pipeline`;
  • replacement in src/HydraFrontend/lib/HydraFrontend/Controller/Root.pm at line 403
    [3.500][3.500:510]()
    [3.500]
    [3.2597]
  • replacement in src/HydraFrontend/root/layout.tt at line 17
    [3.11498][3.11498:11562]()
    <link rel="stylesheet" href="/hydra.css" type="text/css" />
    [3.11498]
    [2.499]
    <link rel="stylesheet" href="/static/css/hydra.css" type="text/css" />
    <link rel="stylesheet" href="/static/css/logfile.css" type="text/css" />
  • edit in src/HydraFrontend/root/layout.tt at line 21
    [3.1901]
    [3.1901]
    <script type="text/javascript" src="/static/js/treebits.js"></script>
  • replacement in src/HydraFrontend/root/log.tt at line 6
    [3.11918][3.11918:11941]()
    <pre class="buildlog">
    [3.11918]
    [3.11941]
    <div class="buildlog">
  • replacement in src/HydraFrontend/root/log.tt at line 8
    [3.11956][3.11956:11963]()
    </pre>
    [3.11956]
    [3.11963]
    </div>
  • file addition: css (d--r------)
    [3.282]
  • file move: hydra.css (----------)hydra.css (----------)
    [0.493]
    [3.8691]
  • edit in src/HydraFrontend/root/static/css/hydra.css at line 162
    [3.250]
    [15.1971]
    div.buildlog {
    border: 1px solid black;
    padding: 0.3em;
    }
  • file addition: logfile.css (----------)
    [0.493]
    ul.nesting, ul.toplevel {
    padding: 0;
    margin: 0;
    }
    ul.toplevel {
    list-style-type: none;
    }
    .line, .head {
    padding-top: 0em;
    }
    ul.nesting li.line, ul.nesting li.lastline {
    position: relative;
    list-style-type: none;
    }
    ul.nesting li.line {
    padding-left: 2.0em;
    }
    ul.nesting li.lastline {
    padding-left: 2.1em; // for the 0.1em border-left in .lastline > .lineconn
    }
    li.line {
    border-left: 0.1em solid #6185a0;
    }
    li.line > span.lineconn, li.lastline > span.lineconn {
    position: absolute;
    height: 0.65em;
    left: 0em;
    width: 1.5em;
    border-bottom: 0.1em solid #6185a0;
    }
    li.lastline > span.lineconn {
    border-left: 0.1em solid #6185a0;
    }
    em.storeref {
    color: #500000;
    position: relative;
    width: 100%;
    }
    em.storeref:hover {
    background-color: #eeeeee;
    }
    *.popup {
    display: none;
    /* background: url('http://losser.st-lab.cs.uu.nl/~mbravenb/menuback.png') repeat; */
    background: #ffffcd;
    border: solid #555555 1px;
    position: absolute;
    top: 0em;
    left: 0em;
    margin: 0;
    padding: 0;
    z-index: 100;
    }
    em.storeref:hover span.popup {
    display: inline;
    }
    .toggle {
    text-decoration: none;
    }
    .showTree, .hideTree {
    font-family: monospace;
    font-size: larger;
    }
    .error {
    color: #ff0000;
    font-weight: bold;
    }
  • file addition: js (d--r------)
    [3.282]
  • file addition: treebits.js (----------)
    [0.1985]
    /* Acknowledgement: this is based on the Wikipedia table-of-contents
    * toggle. */
    var idCounter = 0;
    function showTreeToggle(isHidden) {
    if (document.getElementById) {
    var id = "toggle_" + idCounter;
    document.writeln(
    '<a href="javascript:toggleTree(\'' + id + '\')" class="toggle" id="' + id + '">' +
    '<span class="showTree" ' + (isHidden ? '' : 'style="display: none;"') + '>+</span>' +
    '<span class="hideTree" ' + (isHidden ? 'style="display: none;"' : '') + '>-</span>' +
    '</a>');
    idCounter = idCounter + 1;
    }
    }
    function toggleTree(id) {
    var href = document.getElementById(id);
    var node = href;
    var tree = null;
    while (node != null) {
    if (node.className == "nesting") tree = node;
    node = node.nextSibling;
    }
    node = href.firstChild;
    var hideTree = null;
    var showTree = null;
    while (node != null) {
    if (node.className == "showTree") showTree = node;
    else if (node.className == "hideTree") hideTree = node;
    node = node.nextSibling;
    }
    if (tree.style.display == 'none') {
    tree.style.display = '';
    hideTree.style.display = '';
    showTree.style.display = 'none';
    } else {
    tree.style.display = 'none';
    hideTree.style.display = 'none';
    showTree.style.display = '';
    }
    }
  • file addition: xsl (d--r------)
    [3.1]
  • file addition: log2html.xsl (----------)
    [0.3437]
    <?xml version="1.0"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method='html' encoding="UTF-8"
    doctype-public="-//W3C//DTD HTML 4.01//EN"
    doctype-system="http://www.w3.org/TR/html4/strict.dtd" />
    <xsl:template match="logfile">
    <ul class='toplevel'>
    <xsl:for-each select='line|nest'>
    <li>
    <xsl:apply-templates select='.'/>
    </li>
    </xsl:for-each>
    </ul>
    </xsl:template>
    <xsl:template match="nest">
    <!-- The tree should be collapsed by default if all children are
    unimportant or if the header is unimportant. -->
    <!-- <xsl:variable name="collapsed"
    select="count(.//line[not(@priority = 3)]) = 0 or ./head[@priority = 3]" /> -->
    <xsl:variable name="collapsed" select="count(.//*[@error]) = 0"/>
    <xsl:variable name="style"><xsl:if test="$collapsed">display: none;</xsl:if></xsl:variable>
    <xsl:variable name="arg"><xsl:choose><xsl:when test="$collapsed">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:variable>
    <script type='text/javascript'>showTreeToggle(<xsl:value-of select="$collapsed"/>)</script>
    <xsl:apply-templates select='head'/>
    <!-- Be careful to only generate <ul>s if there are <li>s, otherwise it’s malformed. -->
    <xsl:if test="line|nest">
    <ul class='nesting' style="{$style}">
    <xsl:for-each select='line|nest'>
    <!-- Is this the last line? If so, mark it as such so that it
    can be rendered differently. -->
    <xsl:variable name="class"><xsl:choose><xsl:when test="position() != last()">line</xsl:when><xsl:otherwise>lastline</xsl:otherwise></xsl:choose></xsl:variable>
    <li class='{$class}'>
    <span class='lineconn' />
    <span class='linebody'>
    <xsl:apply-templates select='.'/>
    </span>
    </li>
    </xsl:for-each>
    </ul>
    </xsl:if>
    </xsl:template>
    <xsl:template match="head|line">
    <code>
    <xsl:if test="@error">
    <xsl:attribute name="class">error</xsl:attribute>
    </xsl:if>
    <xsl:apply-templates/>
    </code>
    </xsl:template>
    <xsl:template match="storeref">
    <em class='storeref'>
    <span class='popup'><xsl:apply-templates/></span>
    <span class='elided'>/...</span><xsl:apply-templates select='name'/><xsl:apply-templates select='path'/>
    </em>
    </xsl:template>
    </xsl:stylesheet>
  • file addition: mark-errors.xsl (----------)
    [0.3437]
    <?xml version="1.0"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="@*|node()">
    <xsl:copy>
    <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
    </xsl:template>
    <xsl:template match="line">
    <line>
    <xsl:if test="contains(text(), ' *** ') or
    contains(text(), 'LaTeX Error') or
    contains(text(), 'FAIL:') or
    contains(text(), ' error: ') or
    true">
    <xsl:attribute name="error"></xsl:attribute>
    </xsl:if>
    <xsl:apply-templates select="@*|node()"/>
    </line>
    </xsl:template>
    </xsl:stylesheet>