From ce832dbb4d14e5d46691ed930cfef22dc5d85dd4 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Tue, 13 May 2025 11:58:20 +0200 Subject: Invocation server: add links to blob references in analysis errors When using a serve endpoint, analysis errors my contain a reference to a build failure on serve, shown as 'blob '. For each such blob reference add a link offering to read this blob. --- doc/invocations-http-server/server.py | 10 +++++++++- doc/invocations-http-server/templates/invocation.html | 9 ++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) (limited to 'doc/invocations-http-server') diff --git a/doc/invocations-http-server/server.py b/doc/invocations-http-server/server.py index 05832ada..6ff6b668 100755 --- a/doc/invocations-http-server/server.py +++ b/doc/invocations-http-server/server.py @@ -15,6 +15,7 @@ import jinja2 import json +import re import os import subprocess import werkzeug.exceptions @@ -328,7 +329,14 @@ class InvocationServer: params["repo_config"] = meta.get('configuration') params["exit_code"] = profile.get('exit code') - params["analysis_errors"] = profile.get('analysis errors', []) + analysis_errors = [] + blob_pattern = re.compile(r'blob ([0-9A-Za-z]{40,64})') + for s in profile.get('analysis errors', []): + analysis_errors.append({ + "msg": s, + "blobs": blob_pattern.findall(s), + }) + params["analysis_errors"] = analysis_errors params["remote_address"] = profile.get('remote', {}).get('address') remote_props = [] for k, v in profile.get('remote', {}).get('properties', {}).items(): diff --git a/doc/invocations-http-server/templates/invocation.html b/doc/invocations-http-server/templates/invocation.html index c8d77f58..50d5690a 100644 --- a/doc/invocations-http-server/templates/invocation.html +++ b/doc/invocations-http-server/templates/invocation.html @@ -158,7 +158,14 @@ Inocations {{invocation | e}}

Analysis errors

{% else %} -- cgit v1.2.3