From 88e979c72ca7433c6088255c7ca9b2824f83eafb Mon Sep 17 00:00:00 2001 From: vik378 Date: Fri, 6 Oct 2023 11:42:42 +0200 Subject: [PATCH] added template support for metadata and stats --- report.html.j2 | 87 ++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 80 insertions(+), 7 deletions(-) diff --git a/report.html.j2 b/report.html.j2 index bec2589..313c2eb 100644 --- a/report.html.j2 +++ b/report.html.j2 @@ -30,26 +30,91 @@ .created { color: #00aa00; } + /* nice table style with borders, bold th*/ + table { + border-collapse: collapse; + border: 1px solid #ccc; + } + table tbody th { + font-weight: bold; + border: 1px solid #ccc; + padding: 0.25em; + text-align: right; + } + table td { + border: 1px solid #ccc; + padding: 0.25em; + }

Model Change Assessment Report

-

Current model: {{ data["metadata"]["new-revision"] }}

-

Previous model: {{ data["metadata"]["old-revision"] }}

-

Object Changes {{ data["objects"].stats }}

+

This report provides an analysis of changes to the following model repository:

+

+ Repository: {{ data["metadata"]["model"]["path"] }}
+ Entry point: {{ data["metadata"]["model"]["entrypoint"] }} +

+

The review of changes covers the following commits:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PreviousCurrent
Author{{ data["metadata"]["old_revision"]["author"] }}{{ data["metadata"]["new_revision"]["author"] }}
Revision{{ data["metadata"]["old_revision"]["revision"] }}{{ data["metadata"]["new_revision"]["revision"] }}
Date & time of commit{{ data["metadata"]["old_revision"]["date"] }}{{ data["metadata"]["new_revision"]["date"] }}
Commit message{{ data["metadata"]["old_revision"]["description"] }}{{ data["metadata"]["new_revision"]["description"] }}
Commit ID (hash){{ data["metadata"]["old_revision"]["hash"] }}{{ data["metadata"]["new_revision"]["hash"] }}
+ +{% macro pretty_stats(stats) %} +( + {% if stats.created %}+{{stats["created"]}} / {% endif %} + {% if stats.deleted %}-{{stats["deleted"]}} / {% endif %} + {% if stats.modified %}Δ{{stats["modified"]}}{% endif %} +) +{% endmacro %} + +

Object Changes {{ pretty_stats(data["objects"].stats) }}

Disclaimer: current version of model comparison engine uses a selected list of objects of interest and will not report object changes for object types that were considered as "out of scope". For the objects of interest however we can assure completness and correctness of comparison.

{% set LAYER = {"oa": "Operational Analysis", "sa": "System Analysis", "la": "Logical Architecture", "pa": "Physical Architecture"}%} {% for layer in ["oa", "sa", "la", "pa"] %} {% set layer_data = data["objects"][layer] %} - {% if layer_data %} -

{{LAYER[layer]}} {{ layer_data.stats }}

- {% endif %} + {% if layer_data and layer_data.stats %} +

{{LAYER[layer]}} {{ pretty_stats(layer_data.stats) }}

+
{% for obj_type in data["objects"][layer] if obj_type != "stats" %} {% set obj_type_items = data["objects"][layer][obj_type] %} -

{{obj_type}} {{obj_type_items.stats}}

+ {% if obj_type_items.stats %} +

{{obj_type}} {{pretty_stats(obj_type_items.stats)}}

{% if "created" in obj_type_items %}

Created

@@ -93,9 +158,17 @@
{% endif %}
+ {% endif %} {% endfor %}
+ {% endif %} {% endfor %} + +

Diagram changes

+

Disclaimer: this section only looks at content changes to diagrams of interest.

+
+ +
\ No newline at end of file