Skip to content

Commit c84b317

Browse files
committed
[DOC-13702]: Write documentation for the Release Note Generator
Tidying up the text.
1 parent 5b30fbe commit c84b317

2 files changed

Lines changed: 82 additions & 6 deletions

File tree

home/modules/contribute/pages/release-note-generator/adding-a-new-product.adoc

Lines changed: 63 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ alter the Python script itself. Adding a new product involves two steps:
2424
. Add the new product release set to `cb_release_notes_config.yaml`.
2525
. Create a new Jinja template for rendering the AsciiDoc file for your new release note.
2626

27+
28+
== Adding a new product
29+
2730
To demonstrate this process, we're going to create a new release note configuration for the Sync Gateway product.
2831

2932
NOTE: You should run the following commands from the directory where your Release Notes Generator is installed.
@@ -91,6 +94,7 @@ release_settings:
9194
Now, you add the URL and the JQL statements used to retrieve the Jira tickets that match your parameters:
9295

9396
[source, yaml]
97+
.Adding the JQL statement
9498
----
9599
release_settings:
96100
- name: "Sync Gateway"
@@ -105,17 +109,71 @@ release_settings:
105109
type: file
106110
message: 'Enter the file path for the release notes:'
107111
url: https://jira.issues.couchbase.com
108-
jql: project = CBG AND issuetype in (Bug, "New Feature") #<.>
109-
AND (fixVersion = {{release_number}} OR labels IN (known_issue)) #<.>
110-
ORDER BY key ASC #<.>
112+
jql: project = CBG AND issuetype in (Bug, "New Feature", Improvement) # <.>
113+
AND (fixVersion = {{release_number}} OR labels IN (known_issue)) # <.>
114+
ORDER BY key ASC # <.>
115+
template: sync-gateway.jinja2
111116
----
112-
113117
<.> Note that the JQL statement restricts the query to tickets belonging to the Sync Gateway project,
114118
and also ensures that the ticket is either a Bug or a New Feature.
115119
<.> We supply the `release_number` parameter to the JQL statement so that we only pick up tickets from the specified release.
116120
<.> The `ORDER BY key` clause ensures that the tickets are returned in ascending order based on their Jira key.
117121
This is important to ensure that the tickets are passed to the template in the correct order.
118122

123+
[#define-release-note-field]
124+
=== Step {counter: step}: Define the release note field.
125+
126+
The script needs to know which field in a Jira ticket holds the release note description.
127+
The script uses this to ensure that the ticket's release note description field has been filled in.
128+
If the field hasn't been filled in,
129+
the script can optionally use AI to generate a release note summary from the
130+
ticket and comments.
131+
For most of the Couchbase projects, this was added some time after the Jira system was set up,
132+
so the new field was added as a custom field called `customfield_11402`.
133+
134+
[source,yaml, subs="+quotes"]
135+
----
136+
- name: "Sync Gateway"
137+
fields:
138+
- name: release_number
139+
type: text
140+
message: 'Enter the release number:'
141+
- name: release_date
142+
type: text
143+
message: 'Enter the release date (Month Year):'
144+
- name: file_path
145+
type: file
146+
message: 'Enter the file path for the release notes:'
147+
url: https://jira.issues.couchbase.com
148+
jql: project = CBG AND issuetype in (Bug, "New Feature", Improvement)
149+
AND (fixVersion = {{release_number}} OR labels IN (known_issue))
150+
ORDER BY key ASC
151+
#release_note_field: 'customfield_11402'#
152+
template: sync-gateway.jinja2
153+
----
154+
155+
Any item from the `fields` list can be designated as a `release_note_field` (e.g. the ticket's `summary` field).
156+
Alternatively, if the project doesn't have a release note field, then set `release_note_field` to `None`.
157+
158+
.Retrieving JIRA field names
159+
****
160+
The field names for Jira often differ from the names displayed on the ticket's page.
161+
162+
The easiest way to get the field names is to
163+
use the `CURL` and `jq` commands to retrieve an existing ticket with a public security level:
164+
165+
[source,shell, subs="+quotes"]
166+
----
167+
curl -X GET --location "https://jira.issues.couchbase.com/rest/api/2/issue/CBG-4977" \
168+
-H "Authorization: Basic #<insert your JIRA token here>#" \
169+
-H "Content-Type: application/json" | jq
170+
----
171+
172+
This will render the complete ticket (including field names) to the standard output.
173+
****
174+
175+
176+
119177
[#define-your-jinja-template]
120178
=== Step {counter: step}: Define your JINJA template
121179

@@ -144,7 +202,7 @@ release_settings:
144202
template: sync-gateway.jinja2
145203
----
146204

147-
Step {counter: step}: Create your JINJA template
205+
=== Step {counter: step}: Create your JINJA template
148206

149207
The templates reside in the `templates` directory, as defined near the top of the configuration file.
150208
Use your editor to create a new template file in this directory. The file should be called `sync-gateway.jinja2`,

home/modules/contribute/pages/release-note-generator/design-guide.adoc

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ image::release-note-generator/cb-release-notes-menu-options.png[Release Notes Ge
128128

129129
In the following steps, we'll look at the release set options in more detail.
130130

131-
== Step {counter:flow}: Get the parameters
131+
=== Step {counter:flow}: Get the parameters
132132

133133
In this example, assume that the user has selected the first menu option: `Fixes and enhancements (Server 8.0+)`.
134134
The script will then load the release set configuration for the selected product:
@@ -235,6 +235,24 @@ Pay close attention to the field parameters delimited by `{{}}`;
235235
these are the named parameters that will be replaced with the values
236236
entered by the user from the xref:#fields[`fields`] section.
237237

238+
=== Step {counter:flow}: Set the release note field
239+
240+
The `release_note_field` tells the generator script where the Jira ticket it will find the release note information.
241+
242+
[source, yaml]
243+
----
244+
release_note_field: 'customfield_11402'
245+
----
246+
247+
Here, we have informed the script that it will find the release note details in field `customfield_11402` in the Jira ticket.
248+
The release note script makes use of `release_note_field` to determine whether the ticket has its release note filled in.
249+
If not, then the script can fill in the missing release notes using AI.
250+
251+
You can also reference the release note field in your Jinja template using `user_settings.release_set.release_note_field`.
252+
(For more information on Jinja templates, see the xref:./adding-a-new-product.adoc#define-release-note-field[Defining the release note field].)
253+
254+
255+
238256
=== Step {counter:flow}: Render the release note
239257

240258
Having retrieved the tickets that match the JQL,

0 commit comments

Comments
 (0)