Skip to content

Commit e4ceb9f

Browse files
committed
Release notes updates for flutter/website expectations
1 parent 44c3d8c commit e4ceb9f

File tree

4 files changed

+53
-32
lines changed

4 files changed

+53
-32
lines changed

packages/devtools_app/release_notes/NEXT_RELEASE_NOTES.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ Copyright 2025 The Flutter Authors
33
Use of this source code is governed by a BSD-style license that can be
44
found in the LICENSE file or at https://developers.google.com/open-source/licenses/bsd.
55
-->
6-
This is draft for future release notes, that are going to land on
6+
This is a draft for future release notes that are going to land on
77
[the Flutter website](https://docs.flutter.dev/tools/devtools/release-notes).
88

99
# DevTools 2.55.0 release notes
1010

1111
The 2.55.0 release of the Dart and Flutter DevTools
1212
includes the following changes among other general improvements.
1313
To learn more about DevTools, check out the
14-
[DevTools overview](/tools/devtools/overview).
14+
[DevTools overview](/tools/devtools).
1515

1616
## General updates
1717

@@ -53,11 +53,11 @@ TODO: Remove this section if there are not any updates.
5353

5454
TODO: Remove this section if there are not any updates.
5555

56-
## VS Code Sidebar updates
56+
## VS Code sidebar updates
5757

5858
TODO: Remove this section if there are not any updates.
5959

60-
## DevTools Extension updates
60+
## DevTools extension updates
6161

6262
TODO: Remove this section if there are not any updates.
6363

packages/devtools_app/release_notes/README.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,21 @@ found in the LICENSE file or at https://developers.google.com/open-source/licens
88
When you add a user-facing change to DevTools,
99
please add a release note entry to document this improvement.
1010

11-
This entry should be phrased in the past tense (e.g. "Added XYZ" instead of "Add XYZ").
11+
This entry should be phrased in the past tense.
12+
For example, "Added XYZ" instead of "Add XYZ".
1213

1314
### Release note entry
1415

1516
Use this format for the entry:
1617

1718
```markdown
1819
* Created the best feature ever. -
19-
[#10000000001](https://github.com/flutter/devtools/pull/10000000001),
20-
[#10000000002](https://github.com/flutter/devtools/pull/10000000002),
21-
[#10000000003](https://github.com/flutter/devtools/pull/10000000003)
20+
[#10000000001](https://github.com/flutter/devtools/pull/10000000001),
21+
[#10000000002](https://github.com/flutter/devtools/pull/10000000002),
22+
[#10000000003](https://github.com/flutter/devtools/pull/10000000003)
2223
```
2324

24-
Find other examples in [previous notes](https://github.com/flutter/website/tree/main/src/tools/devtools/release-notes).
25+
Find other examples in [previous notes](https://github.com/flutter/website/tree/main/src/content/tools/devtools/release-notes).
2526

2627
### Adding images to a release note entry
2728

@@ -37,10 +38,12 @@ Consider adding an image to the release note entry:
3738
```
3839

3940
#### Image style
40-
Please use DevTools in **dark mode** when taking screenshots for release
41-
notes. We use a dark theme since this is the default theme for DevTools.
41+
42+
Please use DevTools in **dark mode** when taking screenshots for release notes.
43+
We use a dark theme since this is the default theme for DevTools.
4244

4345
#### Image size
46+
4447
When adding images, be cognizant that the images will be rendered in a
4548
relatively small window in DevTools, and they should be sized accordingly.
4649
A wide aspect ratio is preferred so that the space of the release notes
@@ -58,7 +61,9 @@ Before continuing, ensure you have your local environment set up for
5861

5962
### Creating the release notes PR
6063

61-
Draft release notes on a local `flutter/website` branch using the following command:
64+
Draft release notes on a local `flutter/website` branch by running
65+
the following command with the path to your local `flutter/website` repo:
66+
6267
```console
6368
dt release-notes -w /Users/me/absolute/path/to/flutter/website
6469
```

packages/devtools_app/release_notes/helpers/release_notes_template.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ Copyright 2025 The Flutter Authors
33
Use of this source code is governed by a BSD-style license that can be
44
found in the LICENSE file or at https://developers.google.com/open-source/licenses/bsd.
55
-->
6-
This is draft for future release notes, that are going to land on
6+
This is a draft for future release notes that are going to land on
77
[the Flutter website](https://docs.flutter.dev/tools/devtools/release-notes).
88

99
# DevTools <number> release notes
1010

1111
The <number> release of the Dart and Flutter DevTools
1212
includes the following changes among other general improvements.
1313
To learn more about DevTools, check out the
14-
[DevTools overview](/tools/devtools/overview).
14+
[DevTools overview](/tools/devtools).
1515

1616
## General updates
1717

@@ -53,11 +53,11 @@ TODO: Remove this section if there are not any updates.
5353

5454
TODO: Remove this section if there are not any updates.
5555

56-
## VS Code Sidebar updates
56+
## VS Code sidebar updates
5757

5858
TODO: Remove this section if there are not any updates.
5959

60-
## DevTools Extension updates
60+
## DevTools extension updates
6161

6262
TODO: Remove this section if there are not any updates.
6363

tool/lib/commands/release_notes_helper.dart

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ class ReleaseNotesCommand extends Command {
6868
CliCommand.git(['stash']),
6969
CliCommand.git(['checkout', 'main']),
7070
CliCommand.git(['pull']),
71-
CliCommand.git(['submodule', 'update', '--init', '--recursive']),
7271
CliCommand.git([
7372
'checkout',
7473
'-b',
@@ -114,7 +113,7 @@ class ReleaseNotesCommand extends Command {
114113
),
115114
)..createSync();
116115

117-
final srcLines = devToolsReleaseNotes.srcLines;
116+
final srcLines = devToolsReleaseNotes.sourceLines;
118117

119118
// Copy release notes images and fix image reference paths.
120119
if (devToolsReleaseNotes.imageLineIndices.isNotEmpty) {
@@ -142,19 +141,19 @@ class ReleaseNotesCommand extends Command {
142141
}
143142
}
144143

145-
final metadataHeader = '''---
144+
releaseNotesMd.writeAsStringSync('''---
146145
title: DevTools $releaseNotesVersion release notes
147146
shortTitle: $releaseNotesVersion release notes
148147
breadcrumb: $releaseNotesVersion
149148
showToc: false
150149
---
151150
152-
''';
151+
''');
153152

154-
// Write the 'release-notes-<x.y.z>.md' file, including any updates for
155-
// image paths.
153+
// Write the contents of the 'release-notes-<x.y.z>.md' file,
154+
// including any updates for image paths.
156155
releaseNotesMd.writeAsStringSync(
157-
metadataHeader + srcLines.joinWithNewLine(),
156+
srcLines.joinWithNewLine().trimLeft(),
158157
flush: true,
159158
);
160159

@@ -178,7 +177,7 @@ class _DevToolsReleaseNotes {
178177
_DevToolsReleaseNotes._({
179178
required this.file,
180179
required this.version,
181-
required this.srcLines,
180+
required this.sourceLines,
182181
required this.imageLineIndices,
183182
});
184183

@@ -192,8 +191,8 @@ class _DevToolsReleaseNotes {
192191

193192
final rawLines = file.readAsLinesSync();
194193

195-
late String version;
196-
late int titleLineIndex;
194+
String? version;
195+
int? sourceStartIndex;
197196
final versionRegExp = RegExp(r"\d+\.\d+\.\d+");
198197
for (int i = 0; i < rawLines.length; i++) {
199198
final line = rawLines[i];
@@ -202,17 +201,34 @@ class _DevToolsReleaseNotes {
202201
// This match should be from the line "# DevTools <x.y.z> release notes".
203202
version = matches.first.group(0)!;
204203
// This is the markdown title where the release notes src begins.
205-
titleLineIndex = i;
204+
sourceStartIndex = i + 1;
206205
break;
207206
}
208207

208+
if (version == null || sourceStartIndex == null) {
209+
throw Exception(
210+
'Could not find the title line ("# DevTools x.y.z release notes") '
211+
'in the NEXT_RELEASE_NOTES.md file.',
212+
);
213+
}
214+
215+
if (sourceStartIndex >= rawLines.length) {
216+
throw Exception(
217+
'No content found after the title line ("# DevTools x.y.z release notes") '
218+
'in the NEXT_RELEASE_NOTES.md file.',
219+
);
220+
}
221+
222+
// Don't include the copyright, draft notice, or h1 header in
223+
// the output release notes.
224+
final sourceLines = rawLines.sublist(sourceStartIndex);
225+
209226
// TODO(kenz): one nice polish task could be to remove sections that are
210227
// empty (i.e. sections that have the line
211228
// "TODO: Remove this section if there are not any updates.").
212-
final srcLines = rawLines.sublist(titleLineIndex);
213229
final imageLineIndices = <int>{};
214-
for (int i = 0; i < srcLines.length; i++) {
215-
final line = srcLines[i];
230+
for (int i = 0; i < sourceLines.length; i++) {
231+
final line = sourceLines[i];
216232
if (line.contains(_imagePathMarker)) {
217233
imageLineIndices.add(i);
218234
}
@@ -221,14 +237,14 @@ class _DevToolsReleaseNotes {
221237
return _DevToolsReleaseNotes._(
222238
file: file,
223239
version: version,
224-
srcLines: srcLines,
240+
sourceLines: sourceLines,
225241
imageLineIndices: imageLineIndices,
226242
);
227243
}
228244

229245
final File file;
230246
final String version;
231-
final List<String> srcLines;
247+
final List<String> sourceLines;
232248
final Set<int> imageLineIndices;
233249

234250
static final _imagePathMarker = RegExp(r'images\/.*\.png');

0 commit comments

Comments
 (0)