]> git.ipfire.org Git - pbs.git/commitdiff
builds: Fix sending bugfs reports to Bugzilla
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 12 Feb 2025 18:03:07 +0000 (18:03 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 12 Feb 2025 18:03:36 +0000 (18:03 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/templates/builds/bug-created.html
src/templates/builds/bug.html
src/web/builds.py

index 1377e1dc42a1ecedd953624b252d589de2f26122..c7667df611650ed74ef4648c028fc23b423b62f6 100644 (file)
@@ -1,6 +1,6 @@
-{% extends "../modal.html" %}
+{% extends "modal.html" %}
 
-{% block title %}{{ build }} - {{ _("Bug Created") }}{% end block %}
+{% block title %}{{ build }} - {{ _("Bug Created") }}{% endblock %}
 
 {% block breadcrumbs %}
        <nav class="breadcrumb" aria-label="breadcrumbs">
@@ -8,22 +8,27 @@
                        <li>
                                <a href="/packages">{{ _("Packages") }}</a>
                        </li>
+
                        <li>
                                <a href="/packages/{{ build.pkg.name }}">{{ build.pkg.name }}</a>
                        </li>
+
                        <li>
                                <a href="/builds/{{ build.uuid }}">{{ build.pkg.evr }}</a>
                        </li>
+
                        <li class="is-active">
                                <a href="#" aria-current="page">{{ _("Bug Created") }}</a>
                        </li>
                </ul>
        </nav>
-{% end block %}
+{% endblock %}
 
 {% block modal_title %}
-       <h4 class="title is-4">{{ _("Bug %s Created") % bug }}</h4>
-{% end block %}
+       <h4 class="title is-4">
+               {{ _("Bug %s Created") % bug }}
+       </h4>
+{% endblock %}
 
 {% block modal %}
        <div class="block">
@@ -43,4 +48,4 @@
                        {{ _("Go Back To Build") }}
                </a>
        </div>
-{% end block %}
+{% endblock %}
index 0096c103e47039ecaf526722214d858932f113fc..b4419ea8d72402ff0d5555ae4bdd36784fceeac1 100644 (file)
@@ -1,6 +1,6 @@
-{% extends "../modal.html" %}
+{% extends "modal.html" %}
 
-{% block title %}{{ build }} - {{ _("File Bug Report") }}{% end block %}
+{% block title %}{{ build }} - {{ _("File Bug Report") }}{% endblock %}
 
 {% block breadcrumbs %}
        <nav class="breadcrumb" aria-label="breadcrumbs">
                        </li>
                </ul>
        </nav>
-{% end block %}
+{% endblock %}
 
 {% block modal_title %}
        <h4 class="title is-4">{{ _("File A Bug Report For %s") % build }}</h4>
-{% end block %}
+{% endblock %}
 
 {% block modal %}
        <form method="POST" action="">
-               {% raw xsrf_form_html() %}
+               {{ xsrf_form_html() | safe }}
 
                {# Summary #}
                <div class="field">
                        <label class="label">{{ _("Summary") }}</label>
+
                        <div class="control">
                                <input class="input" type="text" name="summary"
                                        value="{{ _("%s FTBFS") % build }}" placeholder="{{ _("Summary") }}">
@@ -41,6 +42,7 @@
                {# Description #}
                <div class="field">
                        <label class="label">{{ _("Description") }}</label>
+
                        <div class="control">
                                <textarea class="textarea" name="description" rows="8"
                                        placeholder="{{ _("Description") }}"></textarea>
                                <div class="control">
                                        <label class="checkbox">
                                                <input type="checkbox" name="attach_log_{{ job.uuid }}"
-                                                       {% if job.has_failed() %}checked{% end %}>
+                                                       {% if job.has_failed() %}checked{% endif %}>
                                                {{ _("Attach log for %s") % job.arch }}
                                        </label>
                                </div>
                        </div>
-               {% end %}
+               {% endfor %}
 
                {# Submit! #}
                <div class="field">
@@ -67,4 +69,4 @@
                        </button>
                </div>
        </form>
-{% end block %}
+{% endblock %}
index 18437c0593835501b2e64632e3461c1ee5e0c624..dd33086913f398a967dd4ff50d6a942ece0901dd 100644 (file)
@@ -240,18 +240,18 @@ class CommentHandler(base.BaseHandler):
 class BugHandler(base.BaseHandler):
        @base.authenticated
        async def get(self, uuid):
-               build = self.backend.builds.get_by_uuid(uuid)
+               build = await self.backend.builds.get_by_uuid(uuid)
                if not build:
                        raise tornado.web.HTTPError(404, "Could not find build %s" % uuid)
 
                # Fetch fields
                fields = await self.backend.bugzilla.fields
 
-               self.render("builds/bug.html", build=build, fields=fields)
+               await self.render("builds/bug.html", build=build, fields=fields)
 
        @base.authenticated
        async def post(self, uuid):
-               build = self.backend.builds.get_by_uuid(uuid)
+               build = await self.backend.builds.get_by_uuid(uuid)
                if not build:
                        raise tornado.web.HTTPError(404, "Could not find build %s" % uuid)
 
@@ -282,10 +282,14 @@ class BugHandler(base.BaseHandler):
                                continue
 
                        # Attach it to the bug
-                       await bug.attach(summary="Log file for %s" % job, filename="%s.log" % job,
-                               data=log, content_type="text/plain")
+                       await bug.attach(
+                               summary      = "Log file for %s" % job,
+                               filename     = "%s.log" % job,
+                               data         = log,
+                               content_type = "text/plain",
+                       )
 
-               self.render("builds/bug-created.html", build=build, bug=bug)
+               await self.render("builds/bug-created.html", build=build, bug=bug)
 
 
 class ReposAddHandler(base.BaseHandler):