Skip to content

Commit ac776ac

Browse files
themr0copenshift-cherrypick-robot
authored andcommitted
RHIDP-6391 Release notes script to not use the issue title for the release notes section
Signed-off-by: Fabrice Flore-Thébault <[email protected]>
1 parent d07858d commit ac776ac

File tree

4 files changed

+75
-9
lines changed

4 files changed

+75
-9
lines changed

modules/release-notes/README.adoc

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
= Single-sourcing release notes
2+
3+
== Single-sourcing general purpose release notes
4+
5+
The general purpose release notes content is single-sourced from link:https://issues.redhat.com/browse/RHIDP[the JIRA project].
6+
7+
.Prerequisites
8+
* In link:https://issues.redhat.com/secure/Dashboard.jspa?selectPageId=12364101#SIGwKWmOqDCVBoapBCJiDqhoiKInaroYEg9j2PldSYMUcQVVVdrFHVDUxs1uBtQolXVZgDTdZwjXSCNOA1u11Xeog9Xjb100DUNCh2jwi0TVgzWteeg2FC1TmbT1TUrftGiFHa2CjQtp2TX1DnIGgGCIgEKI+iQfrUlV2AvkJQA[the JIRA project]:
9+
** *Fix Version/s* is set.
10+
** *Release Notes Text* is set using following format: a level 0 title followed by descriptive content.
11+
** *Release Notes Type* is set to `Enhancement`, `Feature`, `Removed Functionality`, `Deprecated Functionality`, `Developer Preview`, `Technology Preview`, `Known Issue`, or `Bug Fix`.
12+
** *Release Notes Status* is set to `Done`.
13+
14+
* On the single-sourcing environment: Bash, Git, Python, and Pip are installed.
15+
16+
.Procedure
17+
. Verify the `product-version` and `product-bundle-version` attributes values in the `artifacts/attributes.adoc` file.
18+
19+
. Open a terminal and change directory to the Git repository root.
20+
21+
. Install required python modules.
22+
+
23+
----
24+
$ pip3 install --requirement requirements.txt
25+
----
26+
27+
. Single-source content from JIRA.
28+
+
29+
----
30+
$ python modules/release-notes/single-source-release-notes.py
31+
----
32+
33+
.Verification
34+
* Verify the changed content:
35+
+
36+
----
37+
$ git diff
38+
----
39+
40+
== Single-sourcing fixed security issues release notes
41+
42+
The fixed security issues release notes content is single-sourced from link:https://docs.redhat.com/en/documentation/red_hat_security_data_api/1.0/html/red_hat_security_data_api/cve[Red Hat Security Data API].
43+
44+
.Prerequisites
45+
* Bash
46+
47+
.Procedure
48+
. Verify the `product-bundle-version` attribute value in the `artifacts/attributes.adoc` file.
49+
50+
. In the `modules/releases-notes` directory, create a `list-fixed-security-issues-in-product-_<product-bundle-version>_.adoc` file that contains the CVE entry list, with one entry per line, such as:
51+
+
52+
.`list-fixed-security-issues-in-product-1.5.0.adoc`
53+
----
54+
CVE-2024-56326
55+
CVE-2024-56201
56+
----
57+
. Open a terminal, change directory to the `modules/release-notes`, and run:
58+
+
59+
----
60+
$ ./single-source-fixed-security-issues.sh
61+
----
62+
63+
.Verification
64+
* Verify the changed content:
65+
+
66+
----
67+
$ git diff
68+
----
69+

modules/release-notes/single-source-release-notes-template.adoc.jinja

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
== {{ title }} in {{ fixversion }}
1111
{% endif %}
1212
[id="{{ issue.fields.customfield_12320850 | lower | replace(" ", "-") }}-{{ issue.key | lower }}"]
13-
=== {{ issue.fields.summary }}
14-
{% else -%}
13+
==
14+
{%- else -%}
1515
[id="{{ issue.fields.customfield_12320850 | lower | replace(" ", "-") }}-{{ issue.key | lower }}"]
16-
== {{ issue.fields.summary }}
17-
{% endif %}
16+
=
17+
{%- endif -%}
1818
{{ issue.fields.customfield_12317313 }}
1919
{% if template == "with-jira-link" or template == "with-z-stream-section" %}
2020

modules/release-notes/single-source-release-notes.jira2asciidoc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ sections:
6969
- id: fixed-issues
7070
title: Fixed issues
7171
description: |
72-
This section lists issues fixed in {product} {product-version}.
72+
This section lists issues fixed in {product} {product-version} that have a significant impact on users.
7373
query: >
7474
project = "Red Hat Internal Developer Platform"
7575
AND "Release Note Status" = "Done"

modules/release-notes/single-source-release-notes.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,8 @@
4747
items = lines.rsplit(':', 2)
4848
attributes[items[1]] = items[2].strip()
4949

50-
product_version_minor = attributes["product-version"]
50+
product_version_minor = attributes["product-version"] + ".0"
5151
product_version_patch = attributes["product-bundle-version"]
52-
# Until 1.4 at least, Jira has no z-stream 0. Use the y-stream instead.
53-
if re.search('.0$',product_version_patch):
54-
product_version_patch = product_version_minor
5552

5653
# Load the configuration file to get the sections and their Jira queries.
5754
with open(config_file) as file:

0 commit comments

Comments
 (0)