From 8d8713a2c611dfaa6144b16fd86092e992f63efd Mon Sep 17 00:00:00 2001
From: Marco Cattaneo <marco.cattaneo@cern.ch>
Date: Thu, 13 Aug 2020 14:12:06 +0200
Subject: [PATCH] Update the release notes template to latest version from
 master

---
 ReleaseNotes/release_notes_template.md | 64 ++++++++++++++++++--------
 1 file changed, 44 insertions(+), 20 deletions(-)

diff --git a/ReleaseNotes/release_notes_template.md b/ReleaseNotes/release_notes_template.md
index 2b9342776..f6bd2e893 100644
--- a/ReleaseNotes/release_notes_template.md
+++ b/ReleaseNotes/release_notes_template.md
@@ -1,32 +1,56 @@
-{% set used = [] -%}
-{% macro section(labels) -%}
-{% for mr in select_mrs(merge_requests, labels, used) %}
-- {{mr.title}}, !{{mr.iid}} (@{{mr.author.username}}) {{find_tasks(mr)}}
-  {{mr.description|mdindent(2)}}
-{% endfor %}
-{%- endmacro %}
+{% set categories = [
+    'Configuration',
+    'Decoding', 'Tracking', 'PV finding', 'Muon', 'Calo', 'RICH', 'Jets',
+    'PID', 'Composites', 'Filters', 'Functors',
+    'Event model', 'Persistency',
+    'MC checking', 'Monitoring', 'Luminosity',
+    'Core', 'Conditions', 'Utilities',
+    'Simulation',  'Tuples', 'Accelerators',
+    'Flavour tagging',
+    'Build',
+    ] -%}
+{% set used_mrs = [] -%}
+{% macro section(labels, mrs=merge_requests, used=used_mrs, indent='', highlight='highlight') -%}
+{% for mr in order_by_label(select_mrs(mrs, labels, used), categories) -%}
+  {% set mr_labels = categories|select("in", mr.labels)|list -%}
+{{indent}}- {% if mr_labels %}{{mr_labels|map('label_ref')|join(' ')}} | {% endif -%}
+    {{mr.title|sentence}}, {{mr|mr_ref(project_fullname)}} (@{{mr.author.username}}){% if mr.issue_refs %} [{{mr.issue_refs|join(',')}}]{% endif %}{% if highlight in mr.labels %} :star:{% endif %}
+{# {{mr.description|mdindent(2)}} -#}
+{% endfor -%}
+{% endmacro -%}
 {{date}} {{project}} {{version}}
-========================================
+===
 
-Short release description
-----------------------------------------
-Based on ...
-This version is released on ... branch.
+This version uses
+{{project_deps[:-1]|join(',\n')}} and
+{{project_deps|last}}.
 
-### Line developments
-{{ section(['line']) }}
+This version is released on `2018-patches` branch. It is intended for patches to Moore in 2018 simulation workflows. Builds with gcc62 on slc6 and centos7 and with gcc7 on centos7
+Built relative to {{project}} [{{project_prev_tag}}](../-/tags/{{project_prev_tag}}), with the following changes:
+
+### New features ~"new feature"
 
-### New features
 {{ section(['new feature']) }}
 
-### Enhancements
+### Fixes ~"bug fix" ~workaround
+
+{{ section(['bug fix', 'workaround']) }}
+
+### Enhancements ~enhancement
+
 {{ section(['enhancement']) }}
 
-### Bug fixes
-{{ section(['bug fix']) }}
+### Code cleanups and changes to tests ~modernisation ~cleanup ~testing
 
-### Cleanup and testing
-{{ section(['cleanup', 'testing']) }}
+{{ section(['cleanup', 'modernisation', 'testing']) }}
+
+### Documentation ~Documentation
+
+{# Collect documentation independently, may lead to repeated entries -#}
+{{ section(['Documentation'], used=None) }}
+{# Mark as used such documentation does not appear under Other -#}
+{% set dummy = section(['Documentation']) -%}
 
 ### Other
+
 {{ section([[]]) }}
-- 
GitLab