Tim Andersson has proposed merging ~andersson123/autopkgtest-cloud:add-djlint-to-ci into autopkgtest-cloud:master.
Requested reviews: Canonical's Ubuntu QA (canonical-ubuntu-qa) Related bugs: Bug #2058686 in Auto Package Testing: "add djlint to autopkgtest-cloud CI" https://bugs.launchpad.net/auto-package-testing/+bug/2058686 For more details, see: https://code.launchpad.net/~andersson123/autopkgtest-cloud/+git/autopkgtest-cloud/+merge/464113 -- Your team Canonical's Ubuntu QA is requested to review the proposed merge of ~andersson123/autopkgtest-cloud:add-djlint-to-ci into autopkgtest-cloud:master.
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 56403eb..929694e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,4 +1,16 @@ repos: + - repo: https://github.com/djlint/djLint + rev: v1.34.1 + hooks: + - id: djlint-reformat-handlebars + files: "\\.html" + stages: + [commit-msg, post-checkout, post-commit, post-merge, post-rewrite, + commit, merge-commit, push, prepare-commit-msg] + types_or: ['html'] + - id: djlint-handlebars + files: "\\.html" + stages: [manual] - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.4.0 hooks: diff --git a/charms/focal/autopkgtest-web/webcontrol/templates/browse-admin.html b/charms/focal/autopkgtest-web/webcontrol/templates/browse-admin.html index 72d5d5b..f3b9d7d 100644 --- a/charms/focal/autopkgtest-web/webcontrol/templates/browse-admin.html +++ b/charms/focal/autopkgtest-web/webcontrol/templates/browse-admin.html @@ -1,15 +1,16 @@ {% extends "browse-layout.html" %} {% import "macros.html" as macros %} - {% block content %} - <h1 class="page-header">Admin</h1> - <p>Click on the package name to jump to the tests of the package for all arches/releases.</p> - <p>This page is simply a bunch of heuristics filtering all running jobs to try to get the problematic ones. Feel free to come help improve the heuristics <a href="https://code.launchpad.net/~ubuntu-release/autopkgtest-cloud/+git/autopkgtest-cloud/+ref/master">here.</a></p> - - <!-- Running tests --> - {% for p, info in running.items()|sort %} - <h2 id="pkg-{{ p }}"><a href="/packages/{{ p }}">{{ p }}</a></h2> - {{ macros.display_running_job(p, info) }} - {% endfor %} - + <h1 class="page-header">Admin</h1> + <p>Click on the package name to jump to the tests of the package for all arches/releases.</p> + <p> + This page is simply a bunch of heuristics filtering all running jobs to try to get the problematic ones. Feel free to come help improve the heuristics <a href="https://code.launchpad.net/~ubuntu-release/autopkgtest-cloud/+git/autopkgtest-cloud/+ref/master">here.</a> + </p> + <!-- Running tests --> + {% for p, info in running.items()|sort %} + <h2 id="pkg-{{ p }}"> + <a href="/packages/{{ p }}">{{ p }}</a> + </h2> + {{ macros.display_running_job(p, info) }} + {% endfor %} {% endblock %} diff --git a/charms/focal/autopkgtest-web/webcontrol/templates/browse-error.html b/charms/focal/autopkgtest-web/webcontrol/templates/browse-error.html index 12b6cf7..8b3c6ad 100644 --- a/charms/focal/autopkgtest-web/webcontrol/templates/browse-error.html +++ b/charms/focal/autopkgtest-web/webcontrol/templates/browse-error.html @@ -1,12 +1,12 @@ {% extends "browse-layout.html" %} {% block content %} -<div style="background: #f33; padding: 0.5em 1.5em;"> - <h1>Error:</h1> - <p>{{ error }}</p> -</div> -<p> -A server error has occured, please contact a member of the Ubuntu QA team. You -can contact them via the ubuntu-quality mailing list, or via the #ubuntu-quality -IRC channel on irc.libera.chat (highlight 'qa-help' for more reactivity). -</p> + <div style="background: #f33; padding: 0.5em 1.5em;"> + <h1>Error:</h1> + <p>{{ error }}</p> + </div> + <p> + A server error has occured, please contact a member of the Ubuntu QA team. You + can contact them via the ubuntu-quality mailing list, or via the #ubuntu-quality + IRC channel on irc.libera.chat (highlight 'qa-help' for more reactivity). + </p> {% endblock %} diff --git a/charms/focal/autopkgtest-web/webcontrol/templates/browse-health.html b/charms/focal/autopkgtest-web/webcontrol/templates/browse-health.html index 5aa154f..b1beab6 100644 --- a/charms/focal/autopkgtest-web/webcontrol/templates/browse-health.html +++ b/charms/focal/autopkgtest-web/webcontrol/templates/browse-health.html @@ -1,36 +1,39 @@ {% extends "browse-layout.html" %} {% import "macros.html" as macros %} - {% block content %} - <h2>release health <small>[{{ release }}{% if arch %}/{{ arch }}{% endif %}]</small></h2> - - <table class="table"> + <h2> + release health <small>[{{ release }} + {% if arch %}/{{ arch }}{% endif %} + ]</small> +</h2> +<table class="table"> <tr> - <td><b>Package</b></td> - <td><b>Version</b></td> - {% for arch in arches %} - <td>{{arch}}</td> - {% endfor %} + <td> + <b>Package</b> + </td> + <td> + <b>Version</b> + </td> + {% for arch in arches %}<td>{{arch}}</td>{% endfor %} </tr> - - {% for package, version in reference_results %} - <tr> - <td>{{package}}</td> - <td>{{version}}</td> - {% for arch in arches %} - {% set values = reference_results[package, version].get(arch, None) %} - {% if values and values["run_id"] %} - <td class="nowrap {{values["code"]}}" title={{values["code"]}}> - <a href="{{values["url"]}}/log.gz">{{values["code"]}}</a>   - {% if values["show_retry"] %} - <a href="{{base_url}}request.cgi?release={{release}}&arch={{values["arch"]}}&package={{package|urlencode}}&trigger=migration-reference/0">♻</a> - {% endif %} - </td> - {% else %} - <td>N/A</td> - {% endif %} + {% for package, version in reference_results %} + <tr> + <td>{{package}}</td> + <td>{{version}}</td> + {% for arch in arches %} + {% set values = reference_results[package, version].get(arch, None) %} + {% if values and values["run_id"] %} + <td class="nowrap {{values["code"]}}" title={{values["code"]}}> + <a href="{{values["url"]}}/log.gz">{{values["code"]}}</a>   + {% if values["show_retry"] %} + <a href="{{base_url}}request.cgi?release={{release}}&arch={{values["arch"]}}&package={{package|urlencode}}&trigger=migration-reference/0">♻</a> + {% endif %} + </td> + {% else %} + <td>N/A</td> + {% endif %} + {% endfor %} + </tr> {% endfor %} - </tr> - {% endfor %} - </table> +</table> {% endblock %} diff --git a/charms/focal/autopkgtest-web/webcontrol/templates/browse-home.html b/charms/focal/autopkgtest-web/webcontrol/templates/browse-home.html index fe51858..3324695 100644 --- a/charms/focal/autopkgtest-web/webcontrol/templates/browse-home.html +++ b/charms/focal/autopkgtest-web/webcontrol/templates/browse-home.html @@ -1,50 +1,60 @@ {% extends "browse-layout.html" %} {% block content %} -<div class='container'> - <div class='row'> - - <div class='col-md-4'> - <div class="panel panel-default"> - <div class="panel-heading">Recent test runs</div> - <div class="list-group"> - {% for (res, pkg, rel, arch, trigs) in recent_runs %} - <a class="list-group-item" href="{{base_url}}packages/{{pkg}}/{{rel}}/{{arch}}"> - <span class="{{res}}">{{pkg}} on {{rel}}/{{arch}}</span><br /> - <small class="text-muted">Triggers: {{trigs}}</small> - </a> - {% endfor %} + <div class='container'> + <div class='row'> + <div class='col-md-4'> + <div class="panel panel-default"> + <div class="panel-heading">Recent test runs</div> + <div class="list-group"> + {% for (res, pkg, rel, arch, trigs) in recent_runs %} + <a class="list-group-item" + href="{{base_url}}packages/{{pkg}}/{{rel}}/{{arch}}"> + <span class="{{res}}">{{pkg}} on {{rel}}/{{arch}}</span> + <br /> + <small class="text-muted">Triggers: {{trigs}}</small> + </a> + {% endfor %} + </div> + </div> + </div> + <div class="col-md-4"> + <div class="panel panel-default"> + <div class="panel-heading">Package Index</div> + <div class="panel-body"> + <p> + You can navigate to {{base_url}}packages/<i>packagename</i> to get + results for a particular package. + </p> + <ul class="list-inline"> + {% for i in indexes %} + <li> + <h5> + <a href="{{base_url}}testlist#index-{{i}}">{{i}}</a> + </h5> + </li> + {% endfor %} + </ul> + </div> + </div> + <div class="panel panel-default"> + <div class="panel-heading">Machine readable data</div> + <div class="panel-body"> + <ul> + <li> + <a href="{{base_url}}static/autopkgtest.db">SQLite database with results</a> + </li> + <li> + <a href="{{base_url}}static/running.json">Currently running tests in JSON format</a> + </li> + <li> + <a href="{{base_url}}queues.json">Queued tests in JSON format</a> + </li> + </ul> + </div> + </div> + </div> </div> - </div> + <!-- main row --> </div> - - <div class="col-md-4"> - <div class="panel panel-default"> - <div class="panel-heading">Package Index</div> - <div class="panel-body"> - <p>You can navigate to {{base_url}}packages/<i>packagename</i> to get - results for a particular package.</p> - - <ul class="list-inline"> - - {% for i in indexes %} - <li><h5><a href="{{base_url}}testlist#index-{{i}}">{{i}}</a></h5></li> - {% endfor %} - </ul> - </div> - </div> - - <div class="panel panel-default"> - <div class="panel-heading">Machine readable data</div> - <div class="panel-body"> - <ul> - <li><a href="{{base_url}}static/autopkgtest.db">SQLite database with results</a></li> - <li><a href="{{base_url}}static/running.json">Currently running tests in JSON format</a></li> - <li><a href="{{base_url}}queues.json">Queued tests in JSON format</a></li> - </ul> - </div> - </div> - </div> - - </div> <!-- main row --> -</div> <!-- class='container' --> + <!-- class='container' --> {% endblock %} diff --git a/charms/focal/autopkgtest-web/webcontrol/templates/browse-layout.html b/charms/focal/autopkgtest-web/webcontrol/templates/browse-layout.html index e4cfce6..1dd87d6 100644 --- a/charms/focal/autopkgtest-web/webcontrol/templates/browse-layout.html +++ b/charms/focal/autopkgtest-web/webcontrol/templates/browse-layout.html @@ -1,53 +1,76 @@ <!DOCTYPE html> <html> - <head> - <meta charset="utf-8"> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <title>Ubuntu Autopkgtest Results {{title_suffix}}</title> - <!-- <link rel="icon" type="image/png" href="/debian.png"/> --> - <link rel="stylesheet" type="text/css" href="{{static_url}}bootstrap/css/bootstrap.css"/> - <link rel="stylesheet" type="text/css" href="{{static_url}}bootstrap/css/bootstrap-theme.css"/> - <link rel="stylesheet" type="text/css" href="{{static_url}}style.css"/> - </head> - <body> - <div id='wrap'> - - <!-- Fixed navbar --> - <div class="navbar navbar-default"> - <div class="container"> - <div class="navbar-header"> - <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> - <span class="icon-bar"></span> - <span class="icon-bar"></span> - <span class="icon-bar"></span> - </button> - <a class="navbar-brand" href="{{base_url}}">Ubuntu Autopkgtest</a> - </div> - <div class="collapse navbar-collapse"> - <ul class="nav navbar-nav"> - <li><a href="{{base_url}}">Home</a></li> - <li><a href="{{base_url}}testlist">Test list</a></li> - <li><a href="{{base_url}}running">Running</a></li> - <li><a href="{{base_url}}statistics">Statistics</a></li> - <li><a href="https://wiki.ubuntu.com/ProposedMigration#autopkgtests">Documentation</a></li> - <li><a href="https://discourse.ubuntu.com/t/autopkgtest-service/34490">Service Status</a></li> - <li><a href="https://autopkgtest-cloud.readthedocs.io/">Docs for admins</a></li> - <li><a href="{{base_url}}admin">Admin</a></li> - {% if not session.get("nickname") %} - <li><a href="{{base_url}}request.cgi?/login">Login</a></li> - {% endif %} - </ul> - </div><!--/.nav-collapse --> - </div> - </div> - - -<div class="container"> -{% block content %}{% endblock %} -</div> - - <script type="text/javascript" src="{{static_url}}jquery/jquery.min.js"></script> - <script type="text/javascript" src="{{static_url}}bootstrap/js/bootstrap.min.js"></script> - </body> -</html> + <head> + <meta charset="utf-8"> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <title>Ubuntu Autopkgtest Results {{title_suffix}}</title> + <!-- <link rel="icon" type="image/png" href="/debian.png" /> --> + <link rel="stylesheet" + type="text/css" + href="{{static_url}}bootstrap/css/bootstrap.css" /> + <link rel="stylesheet" + type="text/css" + href="{{static_url}}bootstrap/css/bootstrap-theme.css" /> + <link rel="stylesheet" type="text/css" href="{{static_url}}style.css" /> + </head> + <body> + <div id='wrap'> + <!-- Fixed navbar --> + <div class="navbar navbar-default"> + <div class="container"> + <div class="navbar-header"> + <button type="button" + class="navbar-toggle" + data-toggle="collapse" + data-target=".navbar-collapse"> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <a class="navbar-brand" href="{{base_url}}">Ubuntu Autopkgtest</a> + </div> + <div class="collapse navbar-collapse"> + <ul class="nav navbar-nav"> + <li> + <a href="{{base_url}}">Home</a> + </li> + <li> + <a href="{{base_url}}testlist">Test list</a> + </li> + <li> + <a href="{{base_url}}running">Running</a> + </li> + <li> + <a href="{{base_url}}statistics">Statistics</a> + </li> + <li> + <a href="https://wiki.ubuntu.com/ProposedMigration#autopkgtests">Documentation</a> + </li> + <li> + <a href="https://discourse.ubuntu.com/t/autopkgtest-service/34490">Service Status</a> + </li> + <li> + <a href="https://autopkgtest-cloud.readthedocs.io/">Docs for admins</a> + </li> + <li> + <a href="{{base_url}}admin">Admin</a> + </li> + {% if not session.get("nickname") %} + <li> + <a href="{{base_url}}request.cgi?/login">Login</a> + </li> + {% endif %} + </ul> + </div> + <!--/.nav-collapse --> + </div> + </div> + <div class="container"> + {% block content %}{% endblock %} + </div> + <script type="text/javascript" src="{{static_url}}jquery/jquery.min.js"></script> + <script type="text/javascript" + src="{{static_url}}bootstrap/js/bootstrap.min.js"></script> + </body> + </html> diff --git a/charms/focal/autopkgtest-web/webcontrol/templates/browse-package.html b/charms/focal/autopkgtest-web/webcontrol/templates/browse-package.html index 165cfd8..bb05597 100644 --- a/charms/focal/autopkgtest-web/webcontrol/templates/browse-package.html +++ b/charms/focal/autopkgtest-web/webcontrol/templates/browse-package.html @@ -1,40 +1,30 @@ {% extends "browse-layout.html" %} {% import "macros.html" as macros %} - {% block content %} - <h2>{{package}}</h2> - <ul class="external-links"> - <li> - {{ macros.launchpad_link(package) }} - </li> - <li> - {{ macros.excuses_link(package) }} - </li> - </ul> - - <table class="table" style='width: auto'> - <tr> - <th /> - {% for r in releases %}<th>{{r}}</th> {% endfor %} - </tr> - - {% for a in arches %} - <tr> - <th>{{a}}</th> - {% for r in releases %} - <td class="{{ results[r][a] }}"><a href="{{package}}/{{r}}/{{a}}">{{ results[r][a] }}</a></td> + <h2>{{package}}</h2> + <ul class="external-links"> + <li>{{ macros.launchpad_link(package) }}</li> + <li>{{ macros.excuses_link(package) }}</li> + </ul> + <table class="table" style='width: auto'> + <tr> + <th /> + {% for r in releases %}<th>{{r}}</th>{% endfor %} + </tr> + {% for a in arches %} + <tr> + <th>{{a}}</th> + {% for r in releases %} + <td class="{{ results[r][a] }}"> + <a href="{{package}}/{{r}}/{{a}}">{{ results[r][a] }}</a> + </td> + {% endfor %} + </tr> {% endfor %} - </tr> - {% endfor %} - </table> - - <hr> - <h3>Running tests</h3> - - {% for p, info in running.items()|sort %} - {{ macros.display_running_job(p, info) }} - {% endfor %} - - <h3>Queued tests</h3> - {{ macros.display_queues_info(queues_info) }} + </table> + <hr> + <h3>Running tests</h3> + {% for p, info in running.items()|sort %}{{ macros.display_running_job(p, info) }}{% endfor %} + <h3>Queued tests</h3> + {{ macros.display_queues_info(queues_info) }} {% endblock %} diff --git a/charms/focal/autopkgtest-web/webcontrol/templates/browse-results.html b/charms/focal/autopkgtest-web/webcontrol/templates/browse-results.html index fadff6d..0957b74 100644 --- a/charms/focal/autopkgtest-web/webcontrol/templates/browse-results.html +++ b/charms/focal/autopkgtest-web/webcontrol/templates/browse-results.html @@ -1,68 +1,79 @@ {% extends "browse-layout.html" %} {% import "macros.html" as macros %} - {% block content %} - <h2><a href="{{base_url}}packages/{{package}}">{{package}}</a> <small>[{{release}}/{{arch}}]</small></h2> - <ul class="external-links"> - <li> - {{ macros.launchpad_link(package, release) }} - </li> - <li> - {{ macros.excuses_link(package, release) }} - </li> - </ul> - - <table class="table"> - <tr> - <td><b>Version</b></td> - <td><b>Triggers</b></td> - <td><b>Env</b></td> - <td><b>Date</b></td> - <td><b>Duration</b></td> - <td><b>Requester</b></td> - <td><b>Result</b></td> - <td><b>UUID</b></td> - <td></td> - </tr> - - {% for row in package_results %} - <tr {% if row[6] in ["running", "queued"] %}class="unfinished"{% endif %}> - <td>{{row[0]}}</td> - <td>{{row[1]}}</td> - <td>{{row[2]}}</td> - <td>{{row[3]}}</td> - <td>{{row[4]}}</td> - <td> - {% if row[5] != "-" %} - <a href="https://launchpad.net/~{{row[5]}}">{{row[5]}}</a> - {% else %} - {{row[5]}} - {% endif %} - </td> - <td class="nowrap {{row[6]}}" title={{ row[6] }}>{{row[6]}}</td> - <td>{{row[10]}}</td> - <td class="nowrap"> - {% if row[6] not in ["running", "queued"] %} - <a href="{{row[7]}}/log.gz">log</a>   - <a href="{{row[7]}}/artifacts.tar.gz">artifacts</a>   - {% endif %} - </td> - <td class="nowrap"> - {% if row[8] %} - {% set ts = row[1].split()|map('urlencode')|join("&trigger=")|safe %} - {% set all_proposed = row[9] %} - {% if all_proposed %} - <a href="{{base_url}}request.cgi?release={{release}}&arch={{arch}}&package={{package|urlencode}}&trigger={{ts}}&all-proposed=1">♻</a> - {% else %} - <a href="{{base_url}}request.cgi?release={{release}}&arch={{arch}}&package={{package|urlencode}}&trigger={{ts}}">♻</a> - {% endif %} - {% endif %} - </td> - </tr> - {% endfor %} - </table> - - <p> - To ease the browsing of logs, you can use <a href="{{ url_for('static', filename='logs-viewer.user.js') }}">this userscript</a> with any extension supporting that, like <a href="https://www.tampermonkey.net/">TamperMonkey</a>. - </p> + <h2> + <a href="{{base_url}}packages/{{package}}">{{package}}</a> <small>[{{release}}/{{arch}}]</small> + </h2> + <ul class="external-links"> + <li>{{ macros.launchpad_link(package, release) }}</li> + <li>{{ macros.excuses_link(package, release) }}</li> + </ul> + <table class="table"> + <tr> + <td> + <b>Version</b> + </td> + <td> + <b>Triggers</b> + </td> + <td> + <b>Env</b> + </td> + <td> + <b>Date</b> + </td> + <td> + <b>Duration</b> + </td> + <td> + <b>Requester</b> + </td> + <td> + <b>Result</b> + </td> + <td> + <b>UUID</b> + </td> + <td></td> + </tr> + {% for row in package_results %} + <tr {% if row[6] in ["running", "queued"] %}class="unfinished"{% endif %}> + <td>{{row[0]}}</td> + <td>{{row[1]}}</td> + <td>{{row[2]}}</td> + <td>{{row[3]}}</td> + <td>{{row[4]}}</td> + <td> + {% if row[5] != "-" %} + <a href="https://launchpad.net/~{{row[5]}}">{{row[5]}}</a> + {% else %} + {{row[5]}} + {% endif %} + </td> + <td class="nowrap {{row[6]}}" title={{ row[6] }}>{{row[6]}} + </td> + <td>{{row[10]}}</td> + <td class="nowrap"> + {% if row[6] not in ["running", "queued"] %} + <a href="{{row[7]}}/log.gz">log</a>   + <a href="{{row[7]}}/artifacts.tar.gz">artifacts</a>   + {% endif %} + </td> + <td class="nowrap"> + {% if row[8] %} + {% set ts = row[1].split()|map('urlencode')|join("&trigger=")|safe %} + {% set all_proposed = row[9] %} + {% if all_proposed %} + <a href="{{base_url}}request.cgi?release={{release}}&arch={{arch}}&package={{package|urlencode}}&trigger={{ts}}&all-proposed=1">♻</a> + {% else %} + <a href="{{base_url}}request.cgi?release={{release}}&arch={{arch}}&package={{package|urlencode}}&trigger={{ts}}">♻</a> + {% endif %} + {% endif %} + </td> + </tr> + {% endfor %} + </table> + <p> + To ease the browsing of logs, you can use <a href="{{ url_for('static', filename='logs-viewer.user.js') }}">this userscript</a> with any extension supporting that, like <a href="https://www.tampermonkey.net/">TamperMonkey</a>. + </p> {% endblock %} diff --git a/charms/focal/autopkgtest-web/webcontrol/templates/browse-running.html b/charms/focal/autopkgtest-web/webcontrol/templates/browse-running.html index 48080ce..da00503 100644 --- a/charms/focal/autopkgtest-web/webcontrol/templates/browse-running.html +++ b/charms/focal/autopkgtest-web/webcontrol/templates/browse-running.html @@ -1,54 +1,60 @@ {% extends "browse-layout.html" %} {% import "macros.html" as macros %} - {% block content %} - <h1 class="page-header">Currently running tests</h1> - {% if running_count != 1 %} - <p>There are currently {{running_count}} running tests.</p> - {% else %} - <p>There is currently {{running_count}} running test.</p> - {% endif %} - <p>Click on the package name to jump to the currently running tests of that package.</p> - - <table class="table-condensed table-striped"> - {% for column in running|sort|batch(3) %} - <tr> - {% for p in column %} - <td><a href="#pkg-{{ p }}">{{ p }}</a></td> - {% endfor %} - </tr> + <h1 class="page-header">Currently running tests</h1> + {% if running_count != 1 %} + <p>There are currently {{running_count}} running tests.</p> + {% else %} + <p>There is currently {{running_count}} running test.</p> + {% endif %} + <p>Click on the package name to jump to the currently running tests of that package.</p> + <table class="table-condensed table-striped"> + {% for column in running|sort|batch(3) %} + <tr> + {% for p in column %} + <td> + <a href="#pkg-{{ p }}">{{ p }}</a> + </td> + {% endfor %} + </tr> + {% endfor %} + </table> + <h3>Queue lengths</h3> + <p> + Click on the number in a cell to jump to the list of test requests for + that release and architecture which are waiting to be run. + </p> + {% for context in queues_info.keys() %} + <table class="table-condensed table-striped" + style="display: inline-block; + padding-right: 30px"> + <tr> + <th>{{ context }}</th> + {% for a in arches %}<th>{{ a }}</th>{% endfor %} + </tr> + {% for r in releases %} + <tr> + <td>{{ r }}</td> + {% for a in arches %} + <td> + {% if queues_lengths[context][r][a] %} + <a href="#queue-{{ context }}-{{ r }}-{{ a }}">{{ queues_lengths[context][r][a] }}</a> + {% else %} + - + {% endif %} + </td> + {% endfor %} + </tr> + {% endfor %} + </table> {% endfor %} - </table> - - <h3>Queue lengths</h3> - <p>Click on the number in a cell to jump to the list of test requests for - that release and architecture which are waiting to be run.</p> - - {% for context in queues_info.keys() %} - <table class="table-condensed table-striped" style="display: inline-block; padding-right: 30px"> - <tr> - <th>{{ context }}</th> - {% for a in arches %}<th>{{ a }}</th>{% endfor %} - </tr> - - {% for r in releases %} - <tr> - <td>{{ r }}</td> - {% for a in arches %} - <td>{% if queues_lengths[context][r][a] %}<a href="#queue-{{ context }}-{{ r }}-{{ a }}">{{ queues_lengths[context][r][a] }}</a>{% else %}-{% endif %}</td> - {% endfor %} - </tr> + <!-- Running tests --> + {% for p, info in running.items()|sort %} + <h2 id="pkg-{{ p }}"> + <a href="/packages/{{ p }}">{{ p }}</a> + </h2> + {{ macros.display_running_job(p, info) }} {% endfor %} - </table> - {% endfor %} - - <!-- Running tests --> - {% for p, info in running.items()|sort %} - <h2 id="pkg-{{ p }}"><a href="/packages/{{ p }}">{{ p }}</a></h2> - {{ macros.display_running_job(p, info) }} - {% endfor %} - - <!-- queue contents --> - {{ macros.display_queues_info(queues_info) }} - + <!-- queue contents --> + {{ macros.display_queues_info(queues_info) }} {% endblock %} diff --git a/charms/focal/autopkgtest-web/webcontrol/templates/browse-statistics.html b/charms/focal/autopkgtest-web/webcontrol/templates/browse-statistics.html index fddcaa6..f66074b 100644 --- a/charms/focal/autopkgtest-web/webcontrol/templates/browse-statistics.html +++ b/charms/focal/autopkgtest-web/webcontrol/templates/browse-statistics.html @@ -1,55 +1,45 @@ {% extends "browse-layout.html" %} {% block content %} - <h1 class="page-header">Statistics</h1> - - {% for r in release_arches %} - <h3 class="page-header">{{ r.capitalize() }}</h2> - - <table class="table" style="width: auto"> - <tr> - <th>architecture</th> - {% for arch in release_arches[r]|sort %}<th>{{arch}}</th> {% endfor %} - </tr> - - <tr> - <th>#packages with tests</th> - {% for arch in release_arches[r]|sort %} - <td>{{data[r][arch]['numpkgs']}}</td> - {% endfor %} - </tr> - - <tr> - <th>#packages with passing tests </th> - {% for arch in release_arches[r]|sort %} - <td>{% if data[r][arch]['numpkgspass'] %}{{data[r][arch]['numpkgspass']}}{% endif %}</td> - {% endfor %} - </tr> - - <tr> - <th>pass rate</th> - {% for arch in release_arches[r]|sort %} - <td>{% if data[r][arch]['numpkgs'] %} - {{'%.1f' % (data[r][arch]['numpkgspass'] * 100 / data[r][arch]['numpkgs'])}}% - {% endif %}</td> - {% endfor %} - </tr> - - - <tr> - <th>#passed test runs</th> - {% for arch in release_arches[r]|sort %} - <td>{{data[r][arch]['passruns']}}</td> - {% endfor %} - </tr> - - <tr> - <th>#failed test runs</th> - {% for arch in release_arches[r]|sort %} - <td>{{data[r][arch]['failruns']}}</td> - {% endfor %} - </tr> - </table> - - {% endfor %} - + <h1 class="page-header">Statistics</h1> + {% for r in release_arches %} + <h3 class="page-header"> + {{ r.capitalize() }} + </h2> + <table class="table" style="width: auto"> + <tr> + <th>architecture</th> + {% for arch in release_arches[r]|sort %}<th>{{arch}}</th>{% endfor %} + </tr> + <tr> + <th>#packages with tests</th> + {% for arch in release_arches[r]|sort %}<td>{{data[r][arch]['numpkgs']}}</td>{% endfor %} + </tr> + <tr> + <th>#packages with passing tests</th> + {% for arch in release_arches[r]|sort %} + <td> + {% if data[r][arch]['numpkgspass'] %}{{data[r][arch]['numpkgspass']}}{% endif %} + </td> + {% endfor %} + </tr> + <tr> + <th>pass rate</th> + {% for arch in release_arches[r]|sort %} + <td> + {% if data[r][arch]['numpkgs'] %} + {{'%.1f' % (data[r][arch]['numpkgspass'] * 100 / data[r][arch]['numpkgs'])}}% + {% endif %} + </td> + {% endfor %} + </tr> + <tr> + <th>#passed test runs</th> + {% for arch in release_arches[r]|sort %}<td>{{data[r][arch]['passruns']}}</td>{% endfor %} + </tr> + <tr> + <th>#failed test runs</th> + {% for arch in release_arches[r]|sort %}<td>{{data[r][arch]['failruns']}}</td>{% endfor %} + </tr> + </table> + {% endfor %} {% endblock %} diff --git a/charms/focal/autopkgtest-web/webcontrol/templates/browse-testlist.html b/charms/focal/autopkgtest-web/webcontrol/templates/browse-testlist.html index 5744f1c..9ff2ae4 100644 --- a/charms/focal/autopkgtest-web/webcontrol/templates/browse-testlist.html +++ b/charms/focal/autopkgtest-web/webcontrol/templates/browse-testlist.html @@ -1,52 +1,60 @@ {% extends "browse-layout.html" %} {% block content %} -<div class='container'> - <div class='row'> - <div class='col-md-12'> - <h1 class="page-header">List of packages with tests</h1> - - <p>Click on a source package to get to the current autopkgtest results. - Versions link to the current source package, which can be downloaded with - <a href="http://manpages.ubuntu.com/dget">dget</a>.</p> - </div> - </div> - - <div class='row'> - <div class='col-md-5'> - <table class="table-condensed table-striped"> - <tr><th>Source package</th> <th>Version</th></tr> - {% for i, pkglist in indexed_pkgs|dictsort %} - {% set next_id=True %} - {% for (p, v) in pkglist %} - {% if next_id %} - <tr id="index-{{i}}"> - {% set next_id=False %} - {% else %} - <tr> - {% endif %} - <td><a href="{{base_url}}packages/{{p}}">{{p}}</a></td> - <td><a href="https://launchpad.net/ubuntu/+archive/primary/+files/{{p}}_{{v}}.dsc">{{v}}</a></td> - </tr> - {% endfor %} - {% endfor %} - </table> - </div> - - <div class="col-md-3"> - <div class="panel panel-default"> - <div class="panel-heading">Package Index</div> - <div class="panel-body"> - <ul class="list-inline"> - - {% for i in indexed_pkgs|sort %} - <li><h5><a href="#index-{{i}}">{{i}}</a></h5></li> - {% endfor %} - </ul> + <div class='container'> + <div class='row'> + <div class='col-md-12'> + <h1 class="page-header">List of packages with tests</h1> + <p> + Click on a source package to get to the current autopkgtest results. + Versions link to the current source package, which can be downloaded with + <a href="http://manpages.ubuntu.com/dget">dget</a>. + </p> + </div> </div> - </div> - </div> - - </div> -</div> <!-- class='container' --> - -{% endblock %} + <div class='row'> + <div class='col-md-5'> + <table class="table-condensed table-striped"> + <tr> + <th>Source package</th> + <th>Version</th> + </tr> + {% for i, pkglist in indexed_pkgs|dictsort %} + {% set next_id = True %} + {% for (p, v) in pkglist %} + {% if next_id %} + <tr id="index-{{i}}"> + {% set next_id = False %} + {% else %} + <tr> + {% endif %} + <td> + <a href="{{base_url}}packages/{{p}}">{{p}}</a> + </td> + <td> + <a href="https://launchpad.net/ubuntu/+archive/primary/+files/{{p}}_{{v}}.dsc">{{v}}</a> + </td> + </tr> + {% endfor %} + {% endfor %} + </table> + </div> + <div class="col-md-3"> + <div class="panel panel-default"> + <div class="panel-heading">Package Index</div> + <div class="panel-body"> + <ul class="list-inline"> + {% for i in indexed_pkgs|sort %} + <li> + <h5> + <a href="#index-{{i}}">{{i}}</a> + </h5> + </li> + {% endfor %} + </ul> + </div> + </div> + </div> + </div> + </div> + <!-- class='container' --> + {% endblock %} diff --git a/charms/focal/autopkgtest-web/webcontrol/templates/macros.html b/charms/focal/autopkgtest-web/webcontrol/templates/macros.html index 941dc77..02bb9d6 100644 --- a/charms/focal/autopkgtest-web/webcontrol/templates/macros.html +++ b/charms/focal/autopkgtest-web/webcontrol/templates/macros.html @@ -1,64 +1,90 @@ {% macro display_running_job(package, info) -%} - {% for runhash, relinfo in info.items() %} - {% for release, archinfo in relinfo.items() %} - {% for arch, (params, duration, logtail) in archinfo.items() %} - <table class="table-condensed"> - <tr><th>Release:</th><td>{{ release }}</td></tr> - <tr><th>Architecture:</th><td>{{ arch }}</td></tr> - {% for param, v in params.items() %} - {% if param == "requester" %} - <tr><th>{{ param|capitalize }}:</th><td><a href="https://launchpad.net/~{{ v }}">{{ v }}</a></td></tr> - {% elif param == "uuid" %} - <tr><th>{{ param|upper }}:</th><td>{{ v }}</td></tr> - {% else %} - <tr><th>{{ param|capitalize }}:</th><td>{{ v }}</td></tr> - {% endif %} - {% endfor %} - <tr><th>Running for:</th><td>{{ duration//3600 }}h {{ duration % 3600//60 }}m {{ duration % 60 }}s ({{ duration }}s)</td></tr> - </table> - <pre> + {% for runhash, relinfo in info.items() %} + {% for release, archinfo in relinfo.items() %} + {% for arch, (params, duration, logtail) in archinfo.items() %} + <table class="table-condensed"> + <tr> + <th>Release:</th> + <td>{{ release }}</td> + </tr> + <tr> + <th>Architecture:</th> + <td>{{ arch }}</td> + </tr> + {% for param, v in params.items() %} + {% if param == "requester" %} + <tr> + <th>{{ param|capitalize }}:</th> + <td> + <a href="https://launchpad.net/~{{ v }}">{{ v }}</a> + </td> + </tr> + {% elif param == "uuid" %} + <tr> + <th>{{ param|upper }}:</th> + <td>{{ v }}</td> + </tr> + {% else %} + <tr> + <th>{{ param|capitalize }}:</th> + <td>{{ v }}</td> + </tr> + {% endif %} + {% endfor %} + <tr> + <th>Running for:</th> + <td>{{ duration//3600 }}h {{ duration % 3600//60 }}m {{ duration % 60 }}s ({{ duration }}s)</td> + </tr> + </table> + <pre> {{ logtail }} </pre> - {% endfor %} + {% endfor %} + {% endfor %} + <hr> {% endfor %} - <hr> - {% endfor %} {%- endmacro %} - {% macro display_queues_info(queues_info) -%} - {% for queue_name in queues_info.keys() -%} - {% for r in queues_info[queue_name] -%} - {% for a in queues_info[queue_name][r] -%} - {% if queues_info[queue_name][r][a] -%} - {% set (nreqs, reqs) = queues_info[queue_name][r][a] %} - {%- if nreqs > 0 %} - <table class="table-condensed table-striped" id="queue-{{ queue_name }}-{{ r }}-{{ a }}"> - <thead> - <tr><th class="sticky-table-headers"><h3>Queued tests for {{ queue_name }} {{ r }} {{ a }}</h3></th></tr> - </thead> - <tbody> - {% for req in reqs %} - <tr><td>{{ req }}</td></tr> - {% endfor %} - </tbody> - </table> - {% endif %} - {% endif %} - {%- endfor %} + {% for queue_name in queues_info.keys() -%} + {% for r in queues_info[queue_name] -%} + {% for a in queues_info[queue_name][r] -%} + {% if queues_info[queue_name][r][a] -%} + {% set (nreqs, reqs) = queues_info[queue_name][r][a] %} + {%- if nreqs > 0 %} + <table class="table-condensed table-striped" + id="queue-{{ queue_name }}-{{ r }}-{{ a }}"> + <thead> + <tr> + <th class="sticky-table-headers"> + <h3>Queued tests for {{ queue_name }} {{ r }} {{ a }}</h3> + </th> + </tr> + </thead> + <tbody> + {% for req in reqs %} + <tr> + <td>{{ req }}</td> + </tr> + {% endfor %} + </tbody> + </table> + {% endif %} + {% endif %} + {%- endfor %} + {%- endfor %} {%- endfor %} - {%- endfor %} {%- endmacro %} - {% macro excuses_link(package_name, release="") -%} -{% if release != "" %} -{% set release = release + "/" %} -{% endif %} -<a href="https://ubuntu-archive-team.ubuntu.com/proposed-migration/{{ release }}update_excuses.html#{{ package_name }}">excuses</a> + {% if release != "" %} + {% set release = release + "/" %} + {% endif %} + <a href="https://ubuntu-archive-team.ubuntu.com/proposed-migration/{{ release }}update_excuses.html#{{ package_name }}">excuses</a> {%- endmacro %} - {% macro launchpad_link(package_name, release="") -%} -{% if release != "" %} -{% set release = release + "/" %} -{% endif %} -<a href="https://launchpad.net/ubuntu/{{ release }}+source/{{ package_name }}"><img src="{{ url_for('static', filename='launchpad.ico') }}" class="icon">Launchpad</a> + {% if release != "" %} + {% set release = release + "/" %} + {% endif %} + <a href="https://launchpad.net/ubuntu/{{ release }}+source/{{ package_name }}"> + <img src="{{ url_for('static', filename='launchpad.ico') }}" class="icon"> + Launchpad</a> {%- endmacro %}
-- Mailing list: https://launchpad.net/~canonical-ubuntu-qa Post to : canonical-ubuntu-qa@lists.launchpad.net Unsubscribe : https://launchpad.net/~canonical-ubuntu-qa More help : https://help.launchpad.net/ListHelp