From 327a0683e3a9a5662b1d59931ab02f615cb8a1bd Mon Sep 17 00:00:00 2001 From: Dan Chevalier Date: Tue, 15 Nov 2022 13:53:10 -0500 Subject: [PATCH 01/25] Adding release note behaviour --- .github/PULL_REQUEST_TEMPLATE.md | 33 ++++ .github/workflows/build.yaml | 2 +- .github/workflows/release-notes.yaml | 85 ++++++++++ .../lib/src/framework/release_notes/README.md | 8 +- .../lib/src/utils/semantic_version.dart | 18 +++ .../test/semantic_version_test.dart | 11 ++ tool/README.md | 29 ++-- tool/lib/release_note_classes.dart | 149 ++++++++++++++++++ tool/lib/release_note_classes.g.dart | 62 ++++++++ tool/pubspec.yaml | 5 + tool/release_note_helper.dart | 148 +++++++++++++++++ tool/release_notes/release_notes.json | 43 +++++ tool/update_version.dart | 73 +++++++-- 13 files changed, 637 insertions(+), 29 deletions(-) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/workflows/release-notes.yaml create mode 100644 tool/lib/release_note_classes.dart create mode 100644 tool/lib/release_note_classes.g.dart create mode 100755 tool/release_note_helper.dart create mode 100644 tool/release_notes/release_notes.json diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000000..a741c15ac85 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,33 @@ +*Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.* + +*List which issues are fixed by this PR. You must list at least one issue.* + +*If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].* + + + + +## Pre-launch Checklist + +- [ ] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. +- [ ] I read the [Tree Hygiene] wiki page, which explains my responsibilities. +- [ ] I read the [Flutter Style Guide] _recently_, and have followed its advice. +- [ ] I signed the [CLA]. +- [ ] I listed at least one issue that this PR fixes in the description above. +- [ ] I updated/added relevant documentation (doc comments with `///`). +- [ ] I added new tests to check the change I am making, or this PR is [test-exempt]. +- [ ] All existing and new tests are passing. + +If you need help, consider asking for advice on the #hackers-new channel on [Discord]. + + +[Contributor Guide]: https://github.com/flutter/flutter/wiki/Tree-hygiene#overview +[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene +[test-exempt]: https://github.com/flutter/flutter/wiki/Tree-hygiene#tests +[Flutter Style Guide]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo +[CLA]: https://cla.developers.google.com/ +[flutter/tests]: https://github.com/flutter/tests +[breaking change policy]: https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes +[Discord]: https://github.com/flutter/flutter/wiki/Chat \ No newline at end of file diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 239b047831d..fc48897cd15 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -5,7 +5,7 @@ name: devtools on: - pull_request: + # pull_request: push: branches: - master diff --git a/.github/workflows/release-notes.yaml b/.github/workflows/release-notes.yaml new file mode 100644 index 00000000000..2842f8ff71e --- /dev/null +++ b/.github/workflows/release-notes.yaml @@ -0,0 +1,85 @@ +name: Release Notes + +on: + pull_request: + types: [ assigned, opened, synchronize, reopened, edited ] +env: + CURRENT_RELEASE_JSON_FILE_PATH: tool/release_notes/release_notes.json +jobs: + release-preparedness: + runs-on: ubuntu-latest + name: Verify PR Release Note Requirements + steps: + + - name: Get Pull Request Number + id: get-pull-request-number + run: | + PULL_REQUEST_NUMBER=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH") + echo "PULL_REQUEST_NUMBER=$PULL_REQUEST_NUMBER" >> $GITHUB_OUTPUT + + - name: Check if we have modified release_notes.json + id: get-modified-files + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PULL_NUMBER: ${{steps.get-pull-request-number.outputs.PULL_REQUEST_NUMBER}} + run: | + FILES_RESPONSE=$(gh api /repos/flutter/devtools/pulls/$PULL_NUMBER/files) + echo "FILES_RESPONSE: $FILES_RESPONSE" + + HAS_CHANGED_RELEASE_NOTES=$(echo $FILES_RESPONSE | jq '.[].filename' | jq -s '. | any(. == env.CURRENT_RELEASE_JSON_FILE_PATH)') + echo "HAS_CHANGED_RELEASE_NOTES=$HAS_CHANGED_RELEASE_NOTES" >> $GITHUB_OUTPUT + + - name: Get PR Description + id: check-release-note-exceptions + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PULL_NUMBER: ${{steps.get-pull-request-number.outputs.PULL_REQUEST_NUMBER}} + run: | + PULLS_RESPONSE=$(gh api /repos/flutter/devtools/pulls/$PULL_NUMBER) + DESCRIPTION_BODY=$(echo $PULLS_RESPONSE | jq '.body') + echo $DESCRIPTION_BODY + if $(echo $DESCRIPTION_BODY | grep -q "> NO RELEASE NOTE CHANGES:"); then + HAS_RELEASE_NOTE_EXCEPTION_STRING=true + else + HAS_RELEASE_NOTE_EXCEPTION_STRING=false + fi + echo "HAS_RELEASE_NOTE_EXCEPTION_STRING=$HAS_RELEASE_NOTE_EXCEPTION_STRING" >> $GITHUB_OUTPUT + + - name: Check Release Preparedness requirements + env: + HAS_CHANGED_RELEASE_NOTES: ${{steps.get-modified-files.outputs.HAS_CHANGED_RELEASE_NOTES}} + HAS_RELEASE_NOTE_EXCEPTION_STRING: ${{steps.check-release-note-exceptions.outputs.HAS_RELEASE_NOTE_EXCEPTION_STRING}} + run: | + if [ "$HAS_CHANGED_RELEASE_NOTES" != "true" ] && [ "$HAS_RELEASE_NOTE_EXCEPTION_STRING" != "true" ] ; then + echo "Release Preparedness check failed" + echo "::error file=$CURRENT_RELEASE_JSON_FILE_PATH,line=0,col=0,endColumn=0,title='Release Notes Weren\'t Modified'::Please add a release note entry or a reason to your description using: \`> NO RELEASE NOTE CHANGES: [reason goes here]\`" + exit 1 + fi + + release-note-validation: + runs-on: ubuntu-latest + name: Release Note Validation + steps: + - name: Get Pull Request Number + id: get-pull-request-number + run: | + PULL_REQUEST_NUMBER=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH") + echo "PULL_REQUEST_NUMBER=$PULL_REQUEST_NUMBER" >> $GITHUB_OUTPUT + - uses: dart-lang/setup-dart@9a04e6d73cca37bd455e0608d7e5092f881fd603 + - uses: actions/checkout@v3 + - name: Verify the release note integrity + run: | + cd tool/ + dart pub get + dart release_note_helper.dart verify -f "../$CURRENT_RELEASE_JSON_FILE_PATH" + + - name: Check PR Urls + env: + PULL_NUMBER: ${{steps.get-pull-request-number.outputs.PULL_REQUEST_NUMBER}} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + cd tool/ + dart pub get + dart ./release_note_helper.dart pr-url \ + -f "../$CURRENT_RELEASE_JSON_FILE_PATH" \ + -u https://github.com/flutter/devtools/pull/$PULL_NUMBER diff --git a/packages/devtools_app/lib/src/framework/release_notes/README.md b/packages/devtools_app/lib/src/framework/release_notes/README.md index 81a6b4f82a5..210074f300b 100644 --- a/packages/devtools_app/lib/src/framework/release_notes/README.md +++ b/packages/devtools_app/lib/src/framework/release_notes/README.md @@ -1,9 +1,9 @@ -## Writing DevTools release notes +## Generating Release notes - Release notes for DevTools are hosted on the flutter website (see [archive](https://docs.flutter.dev/development/tools/devtools/release-notes)). -- To add release notes for the latest release, create a PR with the appropriate changes for your release - - The [release notes template](release-notes-template.md) can be used as a starting point - - see example [PR](https://github.com/flutter/website/pull/6791). +- To add release notes for the latest release, create a PR with the appropriate changes for your release. + - To generate the release notes run: + `dart tool/release_note_helper.dart markdown -f tool/release_notes/release_notes.json` - Test these changes locally before creating the PR. - See [README.md](https://github.com/flutter/website/blob/main/README.md) for getting setup to run the Flutter website locally. diff --git a/packages/devtools_shared/lib/src/utils/semantic_version.dart b/packages/devtools_shared/lib/src/utils/semantic_version.dart index 0ecd9bb072d..5a4c078011e 100644 --- a/packages/devtools_shared/lib/src/utils/semantic_version.dart +++ b/packages/devtools_shared/lib/src/utils/semantic_version.dart @@ -14,6 +14,16 @@ class SemanticVersion with CompareMixin { this.preReleaseMajor, this.preReleaseMinor, }); + + factory SemanticVersion.fromJson(Map json) { + return SemanticVersion( + major: json['major'], + minor: json['minor'], + patch: json['patch'], + preReleaseMajor: json['preReleaseMajor'], + preReleaseMinor: json['preReleaseMinor'], + ); + } factory SemanticVersion.parse(String? versionString) { if (versionString == null) return SemanticVersion(); @@ -148,6 +158,14 @@ class SemanticVersion with CompareMixin { return -1; } + Map toJson() => { + 'major': major, + 'minor': minor, + 'patch': patch, + 'preReleaseMajor': preReleaseMajor, + 'preReleaseMinor': preReleaseMinor, + }; + @override String toString() { final semVer = [major, minor, patch].join('.'); diff --git a/packages/devtools_shared/test/semantic_version_test.dart b/packages/devtools_shared/test/semantic_version_test.dart index 38eefb87490..52fcf04c36d 100644 --- a/packages/devtools_shared/test/semantic_version_test.dart +++ b/packages/devtools_shared/test/semantic_version_test.dart @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'dart:convert'; + import 'package:devtools_shared/devtools_shared.dart'; import 'package:test/test.dart'; @@ -206,5 +208,14 @@ void main() { equals('1.1.1-0.1'), ); }); + + test('json', () { + final version = SemanticVersion( + major: 1, minor: 2, patch: 3, preReleaseMajor: 4, preReleaseMinor: 5); + final encodedVersion = jsonEncode(version); + final decodedVersion = + SemanticVersion.fromJson(jsonDecode(encodedVersion)); + expect(version.compareTo(decodedVersion), equals(0)); + }); }); } diff --git a/tool/README.md b/tool/README.md index 82ce414a521..eee40808ed1 100644 --- a/tool/README.md +++ b/tool/README.md @@ -33,7 +33,27 @@ git checkout -b release_$(date +%s); #### Update the DevTools version number +##### Releasing a clean version Run the `tool/update_version.dart` script to update the DevTools version. +- When doing a release, the pre-releases can be stripped with: + ```shell + dart tool/update_version.dart auto --type release + ``` +- Create a PR with this cleaned version number to denote the official release of Devtools under that number + +Verify: +* that this script updated the pubspecs under packages/ +* updated all references to those packages. +* make sure that the version constant in `packages/devtools_app/lib/devtools.dart` was updated + +These packages always have their version numbers updated in lock, so we don't have to worry about versioning. + +##### Updating to the next version +After merging a cleaned version of the current release, you can then perform a `patch`, `minor`, or `major` update. +This version can be pushed up in a separate PR to denote the start of this next version. + +> NOTE: In the future these two released commits will automatically be handled by GitHub. + - For regular monthly releases, use `minor`: ```shell dart tool/update_version.dart auto --type minor @@ -47,15 +67,6 @@ Run the `tool/update_version.dart` script to update the DevTools version. dart tool/update_version.dart auto --type patch ``` -Verify: -* that this script updated the pubspecs under packages/ -* updated all references to those packages. -* make sure that the version constant in `packages/devtools_app/lib/devtools.dart` was updated - -These packages always have their version numbers updated in lock, so we don't have to worry about versioning. - -> Note: Updating to a new `dev` version will automatically prepare the version for a new `minor` release (eg, `2.17.0` will become `2.18.0-dev.0`). To update to a `major` or `patch` release instead, specify either `dev,patch` or `dev,major` (eg, `dart tool/update_version.dart auto --type dev,patch`). - #### Update the CHANGELOG.md (for non-dev releases) * Use the tool `generate-changelog` to automatically update the `packages/devtools/CHANGELOG.md` file. diff --git a/tool/lib/release_note_classes.dart b/tool/lib/release_note_classes.dart new file mode 100644 index 00000000000..4640d8693f5 --- /dev/null +++ b/tool/lib/release_note_classes.dart @@ -0,0 +1,149 @@ +import 'dart:io'; + +import 'package:devtools_repo/repo_tool.dart'; +import 'package:devtools_shared/devtools_shared.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'release_note_classes.g.dart'; + +@JsonSerializable() +class ReleaseNotes { + ReleaseNotes({ + required this.releases, + }); + + List releases; + + String toMarkdown() { + String markdown = ''; + for (var release in releases) { + markdown += release.toMarkdown(); + markdown += '\n'; + } + return markdown; + } + + factory ReleaseNotes.fromJson(Map json) => + _$ReleaseNotesFromJson(json); + + Map toJson() => _$ReleaseNotesToJson(this); +} + +@JsonSerializable() +class Release { + Release({ + required this.version, + required this.sections, + }) { + for (var element in sections) { + _sectionMap[element.name] = element; + } + } + + final SemanticVersion version; + List sections = []; + final Map _sectionMap = {}; + + void addNote(String sectionName, ReleaseNote note) { + _sectionMap[sectionName]!.notes.add(note); + } + + String toMarkdown() { + String markdown = ''; + markdown += '# DevTools $version release notes\n\n'; + sections.forEach((section) { + markdown += '# ${section.name}\n\n'; + for (var note in section.notes) { + markdown += note.toMarkdown(); + } + markdown += '\n'; + }); + return markdown; + } + + factory Release.fromJson(Map json) => + _$ReleaseFromJson(json); + + Map toJson() => _$ReleaseToJson(this); +} + +@JsonSerializable() +class ReleaseSection { + ReleaseSection({ + required this.name, + List? notes, + }) : notes = notes ?? []; + + ReleaseSection.emptyNotes({ + required this.name, + }) : notes = []; + + final String name; + final List notes; + + factory ReleaseSection.fromJson(Map json) => + _$ReleaseSectionFromJson(json); + + Map toJson() => _$ReleaseSectionToJson(this); +} + +@JsonSerializable() +class ReleaseNote { + ReleaseNote({ + required this.message, + this.imageNames, + this.githubPullRequestUrls, + }) { + if (imageNames != null) { + for (var name in imageNames!) { + final path = "release_notes/files/$name"; + //TODO: get the proper path? + if (!File(path).existsSync()) { + throw Exception( + "Could not find image file $path for note: \n${toMarkdown()}"); + } + } + } + } + + List? githubPullRequestUrls; + final String message; + final List? imageNames; + + String toMarkdown() { + String markdown = ''; + markdown += '- $message'; + if (githubPullRequestUrls != null) { + List prUrls = []; + for (var url in githubPullRequestUrls!) { + final match = RegExp( + r'^https://github.com/flutter/devtools/pull/(?\d+)$') + .firstMatch(url); + if (match == null) { + throw Exception( + "Invalid github PR Url($url) found in message: $message}"); + } + final prNumber = match.namedGroup('pr_number'); + prUrls.add('[#$prNumber]($url)'); + } + markdown += ' - ${prUrls.join(", ")}'; + } + + markdown += '\n'; + + if (imageNames != null) { + for (var imageName in imageNames!) { + markdown += '![](files/$imageName)\n'; + } + } + + return markdown; + } + + factory ReleaseNote.fromJson(Map json) => + _$ReleaseNoteFromJson(json); + + Map toJson() => _$ReleaseNoteToJson(this); +} +// # Sementic line breaks of 80 chars or fewer +// # each line requires an PR command diff --git a/tool/lib/release_note_classes.g.dart b/tool/lib/release_note_classes.g.dart new file mode 100644 index 00000000000..de333082285 --- /dev/null +++ b/tool/lib/release_note_classes.g.dart @@ -0,0 +1,62 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'release_note_classes.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ReleaseNotes _$ReleaseNotesFromJson(Map json) => ReleaseNotes( + releases: (json['releases'] as List) + .map((e) => Release.fromJson(e as Map)) + .toList(), + ); + +Map _$ReleaseNotesToJson(ReleaseNotes instance) => + { + 'releases': instance.releases, + }; + +Release _$ReleaseFromJson(Map json) => Release( + version: + SemanticVersion.fromJson(json['version'] as Map), + sections: (json['sections'] as List) + .map((e) => ReleaseSection.fromJson(e as Map)) + .toList(), + ); + +Map _$ReleaseToJson(Release instance) => { + 'version': instance.version, + 'sections': instance.sections, + }; + +ReleaseSection _$ReleaseSectionFromJson(Map json) => + ReleaseSection( + name: json['name'] as String, + notes: (json['notes'] as List?) + ?.map((e) => ReleaseNote.fromJson(e as Map)) + .toList(), + ); + +Map _$ReleaseSectionToJson(ReleaseSection instance) => + { + 'name': instance.name, + 'notes': instance.notes, + }; + +ReleaseNote _$ReleaseNoteFromJson(Map json) => ReleaseNote( + message: json['message'] as String, + imageNames: (json['imageNames'] as List?) + ?.map((e) => e as String) + .toList(), + githubPullRequestUrls: (json['githubPullRequestUrls'] as List?) + ?.map((e) => e as String) + .toList(), + ); + +Map _$ReleaseNoteToJson(ReleaseNote instance) => + { + 'githubPullRequestUrls': instance.githubPullRequestUrls, + 'message': instance.message, + 'imageNames': instance.imageNames, + }; diff --git a/tool/pubspec.yaml b/tool/pubspec.yaml index 736f05ae63b..b102309fd8d 100644 --- a/tool/pubspec.yaml +++ b/tool/pubspec.yaml @@ -9,9 +9,14 @@ dependencies: cli_util: ^0.3.3 devtools_shared: ^2.18.0 http: ^0.13.3 + json_annotation: ^4.4.0 lints: any path: ^1.8.0 dependency_overrides: devtools_shared: path: ../packages/devtools_shared + +dev_dependencies: + build_runner: ^2.0.0 + json_serializable: ^6.0.0 diff --git a/tool/release_note_helper.dart b/tool/release_note_helper.dart new file mode 100755 index 00000000000..e2d10fc4bc1 --- /dev/null +++ b/tool/release_note_helper.dart @@ -0,0 +1,148 @@ +#!/usr/bin/env dart + +import 'dart:convert'; +import 'dart:io'; + +import 'package:args/command_runner.dart'; +import 'lib/release_note_classes.dart'; + +void main(List args) { + final runner = CommandRunner( + 'release_note_helper', + 'Helps manage version notes for release.', + ) + ..addCommand(VerifyCommand()) + ..addCommand(MarkDownCommand()) + ..addCommand(BackfillPullRequestUrlCommand()); + + runner.run(args).catchError((error) { + if (error is! UsageException) throw error; + print(error); + exit(64); // Exit code 64 indicates a usage error. + }); + return; +} + +class MarkDownCommand extends Command { + @override + final name = 'markdown'; + @override + final description = 'Prints all versions listed in the `file`, in markdown.'; + + MarkDownCommand() { + argParser.addOption( + 'version', + abbr: 'v', + help: 'The released version to print the markdown for.', + ); + argParser.addOption( + 'file', + abbr: 'f', + mandatory: true, + help: 'The json release file to operate on.', + ); + } + + @override + void run() async { + final filePath = argResults!['file'].toString(); + final version = argResults?['version']?.toString(); + + final fileContents = await File(filePath).readAsString(); + Release release = Release.fromJson(jsonDecode(fileContents)); + + print(release.toMarkdown()); + } +} + +class VerifyCommand extends Command { + @override + final name = 'verify'; + @override + final description = + 'Verifies that the release_notes.json file is still readable with the serializable dart classes.'; + + VerifyCommand() { + argParser.addOption( + 'file', + abbr: 'f', + mandatory: true, + help: + 'The json release file to verify. The file will be decoded and parsed to ensure that it\'s format is still what is expected.', + ); + } + + @override + void run() async { + final filePath = argResults!['file'].toString(); + final url = argResults!['file'].toString(); + print("The filepath $filePath"); + final fileContents = await File(filePath).readAsString(); + // This step will fail if the json is not valid, or can't be unserialized + Release.fromJson(jsonDecode(fileContents)); + + print('Release notes were successfully decoded and serialized'); + } +} + +class BackfillPullRequestUrlCommand extends Command { + @override + final name = 'pr-url'; + + @override + final description = + 'Checks if all entries in the release notes have pr urls. If a -u ' + 'parameter is passed along, any entries missing a pr url, will be given ' + 'that pr url.'; + + BackfillPullRequestUrlCommand() { + argParser.addOption( + 'url', + abbr: 'u', + mandatory: false, + help: + 'Add the url to any note, that does NOT already have an URL assigned to it.', + ); + argParser.addOption( + 'file', + abbr: 'f', + mandatory: true, + help: 'The json release file to operate on.', + ); + } + + @override + void run() async { + final filePath = argResults!['file'].toString(); + final url = argResults!['url']?.toString(); + + final file = File(filePath); + final fileContents = await file.readAsString(); + // This step will fail if the json is not valid, or can't be unserialized + final release = Release.fromJson(jsonDecode(fileContents)); + + var foundMissingPrUrl = false; + for (var section in release.sections) { + for (var note in section.notes) { + if (note.githubPullRequestUrls == null || + note.githubPullRequestUrls!.isEmpty) { + foundMissingPrUrl = true; + if (url != null) { + note.githubPullRequestUrls = [url]; + } + } + } + } + if (foundMissingPrUrl) { + if (url != null) { + final encoder = JsonEncoder.withIndent(" "); + await file.writeAsString(encoder.convert( + release.toJson(), + )); + } + print('Missing PR urls found in $filePath'); + exit(1); + } + print('No Missing PR Urls Found.'); + } +} diff --git a/tool/release_notes/release_notes.json b/tool/release_notes/release_notes.json new file mode 100644 index 00000000000..ff9782c7397 --- /dev/null +++ b/tool/release_notes/release_notes.json @@ -0,0 +1,43 @@ +{ + "version": { + "major": 2, + "minor": 19, + "patch": 0, + "preReleaseMajor": null, + "preReleaseMinor": null + }, + "sections": [ + { + "name": "General updates", + "notes": [] + }, + { + "name": "Inspector update", + "notes": [] + }, + { + "name": "Performance updates", + "notes": [] + }, + { + "name": "CPU profiler updates", + "notes": [] + }, + { + "name": "Memory updates", + "notes": [] + }, + { + "name": "Network profiler updates", + "notes": [] + }, + { + "name": "Logging updates", + "notes": [] + }, + { + "name": "App size tool updates", + "notes": [] + } + ] +} \ No newline at end of file diff --git a/tool/update_version.dart b/tool/update_version.dart index 65cfe760e94..9246d53cec6 100644 --- a/tool/update_version.dart +++ b/tool/update_version.dart @@ -6,6 +6,9 @@ import 'dart:convert'; import 'dart:io'; import 'package:args/command_runner.dart'; +import 'package:devtools_shared/devtools_shared.dart'; + +import 'lib/release_note_classes.dart' as rn; // This script must be executed from the top level devtools/ directory. // TODO(kenz): If changes are made to this script, first consider refactoring to @@ -59,6 +62,37 @@ Future performTheVersionUpdate( }); } +Future resetReleaseNotes({ + required SemanticVersion newVersion, +}) async { + final release = rn.Release(version: newVersion, sections: [ + rn.ReleaseSection(name: 'General updates'), + rn.ReleaseSection(name: 'Inspector update'), + rn.ReleaseSection(name: 'Performance updates'), + rn.ReleaseSection(name: 'CPU profiler updates'), + rn.ReleaseSection(name: 'Memory updates'), + rn.ReleaseSection(name: 'Network profiler updates'), + rn.ReleaseSection(name: 'Logging updates'), + rn.ReleaseSection(name: 'App size tool updates'), + ]); + + // Clear out the current notes + final releaseNotesDir = Directory('./tool/release_notes/'); + if (releaseNotesDir.existsSync()) { + releaseNotesDir.delete(recursive: true); + } + final filesDir = Directory('./tool/release_notes/files'); + + await releaseNotesDir.create(); + await filesDir.create(); + + // populate a blank release notes file + JsonEncoder encoder = JsonEncoder.withIndent(' '); + await File('./tool/release_notes/release_notes.json').writeAsString( + encoder.convert(release), + ); +} + String? incrementVersionByType(String version, String type) { final semVerMatch = RegExp(r'^(?\d+)\.(?\d+)\.(?\d+)') .firstMatch(version); @@ -189,7 +223,7 @@ void writeVersionToIndexHtml( indexHtml.writeAsStringSync(revisedLines.joinWithNewLine()); } -String incrementDevVersion(String currentVersion, String devType) { +String incrementDevVersion(String currentVersion) { final alreadyHasDevVersion = isDevVersion(currentVersion); if (alreadyHasDevVersion) { final devVerMatch = RegExp( @@ -208,8 +242,17 @@ String incrementDevVersion(String currentVersion, String devType) { return newVersion; } } else { - final nextVersion = incrementVersionByType(currentVersion, devType); - return '$nextVersion-dev.0'; + return '$currentVersion-dev.0'; + } +} + +String stripPreReleases(String currentVersion) { + final devVerMatch = + RegExp(r'^(?\d+\.\d+\.\d+).*$').firstMatch(currentVersion); + if (devVerMatch == null) { + throw 'Invalid version, could not increment dev version'; + } else { + return devVerMatch.namedGroup('semver')!; } } @@ -284,12 +327,11 @@ class AutoUpdateCommand extends Command { AutoUpdateCommand() { argParser.addOption('type', abbr: 't', - allowed: ['dev', 'dev,patch', 'dev,major', 'patch', 'minor', 'major'], + allowed: ['release', 'dev', 'patch', 'minor', 'major'], allowedHelp: { + 'release': 'strips any pre-release versions from the version.', 'dev': - 'bumps the version to the next dev pre-release value (minor by default)', - 'dev,patch': 'bumps the version to the next dev pre-patch value', - 'dev,major': 'bumps the version to the next dev pre-major value', + 'bumps the version to the next dev pre-release value (minor by default).', 'patch': 'bumps the version to the next patch value', 'minor': 'bumps the version to the next minor value', 'major': 'bumps the version to the next major value', @@ -299,7 +341,7 @@ class AutoUpdateCommand extends Command { } @override - void run() { + void run() async { final type = argResults!['type'].toString(); final currentVersion = versionFromPubspecFile(); String? newVersion; @@ -307,17 +349,18 @@ class AutoUpdateCommand extends Command { throw 'Could not automatically determine current version.'; } switch (type) { - case 'dev': - newVersion = incrementDevVersion(currentVersion, 'minor'); - break; - case 'dev,patch': - newVersion = incrementDevVersion(currentVersion, 'patch'); + case 'release': + newVersion = stripPreReleases(currentVersion); break; - case 'dev,major': - newVersion = incrementDevVersion(currentVersion, 'major'); + case 'dev': + newVersion = incrementDevVersion(currentVersion); break; default: newVersion = incrementVersionByType(currentVersion, type); + + // Doing a proper version update so cycle the release notes + await resetReleaseNotes( + newVersion: SemanticVersion.parse(currentVersion)); } if (newVersion == null) { throw 'Failed to determine the newVersion.'; From 3155fa01ef11f5be6178347bc514a96a496d0856 Mon Sep 17 00:00:00 2001 From: Dan Chevalier Date: Tue, 15 Nov 2022 13:58:25 -0500 Subject: [PATCH 02/25] unleash the PR --- .github/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index fc48897cd15..239b047831d 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -5,7 +5,7 @@ name: devtools on: - # pull_request: + pull_request: push: branches: - master From a53ccea3cd1aa14593e71bda45b0a615d5832315 Mon Sep 17 00:00:00 2001 From: Dan Chevalier Date: Tue, 15 Nov 2022 14:05:45 -0500 Subject: [PATCH 03/25] Fix update version so we start with a dev version when bumping --- tool/update_version.dart | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tool/update_version.dart b/tool/update_version.dart index 9246d53cec6..fd22923af11 100644 --- a/tool/update_version.dart +++ b/tool/update_version.dart @@ -332,9 +332,12 @@ class AutoUpdateCommand extends Command { 'release': 'strips any pre-release versions from the version.', 'dev': 'bumps the version to the next dev pre-release value (minor by default).', - 'patch': 'bumps the version to the next patch value', - 'minor': 'bumps the version to the next minor value', - 'major': 'bumps the version to the next major value', + 'patch': + 'bumps the version to the next patch value, and sets the dev version to 0.', + 'minor': + 'bumps the version to the next minor value, and sets the dev version to 0.', + 'major': + 'bumps the version to the next major value, and sets the dev version to 0.', }, mandatory: true, help: 'Bumps the devtools version by the selected type.'); @@ -361,6 +364,8 @@ class AutoUpdateCommand extends Command { // Doing a proper version update so cycle the release notes await resetReleaseNotes( newVersion: SemanticVersion.parse(currentVersion)); + + newVersion = incrementDevVersion(newVersion!); } if (newVersion == null) { throw 'Failed to determine the newVersion.'; From 341b15a1ba7684c02b506019503357b67e461b75 Mon Sep 17 00:00:00 2001 From: Dan Chevalier Date: Tue, 15 Nov 2022 14:28:08 -0500 Subject: [PATCH 04/25] trailing comma --- packages/devtools_shared/test/semantic_version_test.dart | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/devtools_shared/test/semantic_version_test.dart b/packages/devtools_shared/test/semantic_version_test.dart index 52fcf04c36d..59e9156688a 100644 --- a/packages/devtools_shared/test/semantic_version_test.dart +++ b/packages/devtools_shared/test/semantic_version_test.dart @@ -211,7 +211,12 @@ void main() { test('json', () { final version = SemanticVersion( - major: 1, minor: 2, patch: 3, preReleaseMajor: 4, preReleaseMinor: 5); + major: 1, + minor: 2, + patch: 3, + preReleaseMajor: 4, + preReleaseMinor: 5, + ); final encodedVersion = jsonEncode(version); final decodedVersion = SemanticVersion.fromJson(jsonDecode(encodedVersion)); From 2ed1dfdae435a382b64400e48449a2999ff199df Mon Sep 17 00:00:00 2001 From: Dan Chevalier Date: Tue, 15 Nov 2022 14:33:41 -0500 Subject: [PATCH 05/25] remove comments --- tool/lib/release_note_classes.dart | 2 -- 1 file changed, 2 deletions(-) diff --git a/tool/lib/release_note_classes.dart b/tool/lib/release_note_classes.dart index 4640d8693f5..7e88a01adf1 100644 --- a/tool/lib/release_note_classes.dart +++ b/tool/lib/release_note_classes.dart @@ -145,5 +145,3 @@ class ReleaseNote { Map toJson() => _$ReleaseNoteToJson(this); } -// # Sementic line breaks of 80 chars or fewer -// # each line requires an PR command From d814da079befce7b9015765573adb5d66e246a04 Mon Sep 17 00:00:00 2001 From: Dan Chevalier Date: Tue, 15 Nov 2022 15:01:56 -0500 Subject: [PATCH 06/25] fix lints --- tool/lib/release_note_classes.dart | 5 ++--- tool/release_note_helper.dart | 9 +-------- tool/update_version.dart | 8 ++++---- 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/tool/lib/release_note_classes.dart b/tool/lib/release_note_classes.dart index 7e88a01adf1..1104efbd348 100644 --- a/tool/lib/release_note_classes.dart +++ b/tool/lib/release_note_classes.dart @@ -1,6 +1,5 @@ import 'dart:io'; -import 'package:devtools_repo/repo_tool.dart'; import 'package:devtools_shared/devtools_shared.dart'; import 'package:json_annotation/json_annotation.dart'; @@ -51,13 +50,13 @@ class Release { String toMarkdown() { String markdown = ''; markdown += '# DevTools $version release notes\n\n'; - sections.forEach((section) { + for (var section in sections) { markdown += '# ${section.name}\n\n'; for (var note in section.notes) { markdown += note.toMarkdown(); } markdown += '\n'; - }); + } return markdown; } diff --git a/tool/release_note_helper.dart b/tool/release_note_helper.dart index e2d10fc4bc1..3bb461832db 100755 --- a/tool/release_note_helper.dart +++ b/tool/release_note_helper.dart @@ -30,11 +30,6 @@ class MarkDownCommand extends Command { final description = 'Prints all versions listed in the `file`, in markdown.'; MarkDownCommand() { - argParser.addOption( - 'version', - abbr: 'v', - help: 'The released version to print the markdown for.', - ); argParser.addOption( 'file', abbr: 'f', @@ -46,7 +41,6 @@ class MarkDownCommand extends Command { @override void run() async { final filePath = argResults!['file'].toString(); - final version = argResults?['version']?.toString(); final fileContents = await File(filePath).readAsString(); Release release = Release.fromJson(jsonDecode(fileContents)); @@ -75,9 +69,8 @@ class VerifyCommand extends Command { @override void run() async { final filePath = argResults!['file'].toString(); - final url = argResults!['file'].toString(); - print("The filepath $filePath"); final fileContents = await File(filePath).readAsString(); + // This step will fail if the json is not valid, or can't be unserialized Release.fromJson(jsonDecode(fileContents)); diff --git a/tool/update_version.dart b/tool/update_version.dart index fd22923af11..2d2c528b7d3 100644 --- a/tool/update_version.dart +++ b/tool/update_version.dart @@ -365,10 +365,10 @@ class AutoUpdateCommand extends Command { await resetReleaseNotes( newVersion: SemanticVersion.parse(currentVersion)); - newVersion = incrementDevVersion(newVersion!); - } - if (newVersion == null) { - throw 'Failed to determine the newVersion.'; + if (newVersion == null) { + throw 'Failed to determine the newVersion.'; + } + newVersion = incrementDevVersion(newVersion); } performTheVersionUpdate( currentVersion: currentVersion, From 54411eabe1b167a69a5fd5aa8386ae6bdcc38db2 Mon Sep 17 00:00:00 2001 From: Dan Chevalier Date: Wed, 16 Nov 2022 15:42:18 -0500 Subject: [PATCH 07/25] jsdoc. copyright. remove extra class --- tool/lib/release_note_classes.dart | 35 +++++++++++----------------- tool/lib/release_note_classes.g.dart | 11 --------- tool/release_note_helper.dart | 4 +++- 3 files changed, 16 insertions(+), 34 deletions(-) diff --git a/tool/lib/release_note_classes.dart b/tool/lib/release_note_classes.dart index 1104efbd348..8b640648b72 100644 --- a/tool/lib/release_note_classes.dart +++ b/tool/lib/release_note_classes.dart @@ -1,3 +1,7 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + import 'dart:io'; import 'package:devtools_shared/devtools_shared.dart'; @@ -6,29 +10,8 @@ import 'package:json_annotation/json_annotation.dart'; part 'release_note_classes.g.dart'; @JsonSerializable() -class ReleaseNotes { - ReleaseNotes({ - required this.releases, - }); - - List releases; - String toMarkdown() { - String markdown = ''; - for (var release in releases) { - markdown += release.toMarkdown(); - markdown += '\n'; - } - return markdown; - } - - factory ReleaseNotes.fromJson(Map json) => - _$ReleaseNotesFromJson(json); - - Map toJson() => _$ReleaseNotesToJson(this); -} - -@JsonSerializable() +/// Stores all of the release note [sections] for a given [version]. class Release { Release({ required this.version, @@ -67,6 +50,8 @@ class Release { } @JsonSerializable() + +/// Represents a section of release [notes] with a given [name]. class ReleaseSection { ReleaseSection({ required this.name, @@ -87,6 +72,12 @@ class ReleaseSection { } @JsonSerializable() + +/// An individual release note entry, with a given [message]. +/// +/// The names of images relating to the releaseNote can be passed +/// in [imageNames]. WThe GitHub pull request url that the message is added to, +/// can be reflected through [githubPullRequestUrls]. class ReleaseNote { ReleaseNote({ required this.message, diff --git a/tool/lib/release_note_classes.g.dart b/tool/lib/release_note_classes.g.dart index de333082285..5624f17c571 100644 --- a/tool/lib/release_note_classes.g.dart +++ b/tool/lib/release_note_classes.g.dart @@ -6,17 +6,6 @@ part of 'release_note_classes.dart'; // JsonSerializableGenerator // ************************************************************************** -ReleaseNotes _$ReleaseNotesFromJson(Map json) => ReleaseNotes( - releases: (json['releases'] as List) - .map((e) => Release.fromJson(e as Map)) - .toList(), - ); - -Map _$ReleaseNotesToJson(ReleaseNotes instance) => - { - 'releases': instance.releases, - }; - Release _$ReleaseFromJson(Map json) => Release( version: SemanticVersion.fromJson(json['version'] as Map), diff --git a/tool/release_note_helper.dart b/tool/release_note_helper.dart index 3bb461832db..8862570836b 100755 --- a/tool/release_note_helper.dart +++ b/tool/release_note_helper.dart @@ -1,4 +1,6 @@ -#!/usr/bin/env dart +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. import 'dart:convert'; import 'dart:io'; From da9c23b04e55e54295b48f3b7dbfcdf9ed9dd842 Mon Sep 17 00:00:00 2001 From: Dan Chevalier Date: Wed, 14 Dec 2022 17:50:33 -0500 Subject: [PATCH 08/25] first cleanup --- .../lib/src/utils/semantic_version.dart | 18 --- .../test/semantic_version_test.dart | 16 -- tool/lib/release_note_classes.dart | 137 ----------------- tool/lib/release_note_classes.g.dart | 51 ------- tool/pubspec.yaml | 5 - tool/release_note_helper.dart | 143 ------------------ tool/release_notes/release_notes.json | 43 ------ 7 files changed, 413 deletions(-) delete mode 100644 tool/lib/release_note_classes.dart delete mode 100644 tool/lib/release_note_classes.g.dart delete mode 100755 tool/release_note_helper.dart delete mode 100644 tool/release_notes/release_notes.json diff --git a/packages/devtools_shared/lib/src/utils/semantic_version.dart b/packages/devtools_shared/lib/src/utils/semantic_version.dart index 5a4c078011e..0ecd9bb072d 100644 --- a/packages/devtools_shared/lib/src/utils/semantic_version.dart +++ b/packages/devtools_shared/lib/src/utils/semantic_version.dart @@ -14,16 +14,6 @@ class SemanticVersion with CompareMixin { this.preReleaseMajor, this.preReleaseMinor, }); - - factory SemanticVersion.fromJson(Map json) { - return SemanticVersion( - major: json['major'], - minor: json['minor'], - patch: json['patch'], - preReleaseMajor: json['preReleaseMajor'], - preReleaseMinor: json['preReleaseMinor'], - ); - } factory SemanticVersion.parse(String? versionString) { if (versionString == null) return SemanticVersion(); @@ -158,14 +148,6 @@ class SemanticVersion with CompareMixin { return -1; } - Map toJson() => { - 'major': major, - 'minor': minor, - 'patch': patch, - 'preReleaseMajor': preReleaseMajor, - 'preReleaseMinor': preReleaseMinor, - }; - @override String toString() { final semVer = [major, minor, patch].join('.'); diff --git a/packages/devtools_shared/test/semantic_version_test.dart b/packages/devtools_shared/test/semantic_version_test.dart index 59e9156688a..38eefb87490 100644 --- a/packages/devtools_shared/test/semantic_version_test.dart +++ b/packages/devtools_shared/test/semantic_version_test.dart @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'dart:convert'; - import 'package:devtools_shared/devtools_shared.dart'; import 'package:test/test.dart'; @@ -208,19 +206,5 @@ void main() { equals('1.1.1-0.1'), ); }); - - test('json', () { - final version = SemanticVersion( - major: 1, - minor: 2, - patch: 3, - preReleaseMajor: 4, - preReleaseMinor: 5, - ); - final encodedVersion = jsonEncode(version); - final decodedVersion = - SemanticVersion.fromJson(jsonDecode(encodedVersion)); - expect(version.compareTo(decodedVersion), equals(0)); - }); }); } diff --git a/tool/lib/release_note_classes.dart b/tool/lib/release_note_classes.dart deleted file mode 100644 index 8b640648b72..00000000000 --- a/tool/lib/release_note_classes.dart +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright 2022 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'dart:io'; - -import 'package:devtools_shared/devtools_shared.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'release_note_classes.g.dart'; - -@JsonSerializable() - -/// Stores all of the release note [sections] for a given [version]. -class Release { - Release({ - required this.version, - required this.sections, - }) { - for (var element in sections) { - _sectionMap[element.name] = element; - } - } - - final SemanticVersion version; - List sections = []; - final Map _sectionMap = {}; - - void addNote(String sectionName, ReleaseNote note) { - _sectionMap[sectionName]!.notes.add(note); - } - - String toMarkdown() { - String markdown = ''; - markdown += '# DevTools $version release notes\n\n'; - for (var section in sections) { - markdown += '# ${section.name}\n\n'; - for (var note in section.notes) { - markdown += note.toMarkdown(); - } - markdown += '\n'; - } - return markdown; - } - - factory Release.fromJson(Map json) => - _$ReleaseFromJson(json); - - Map toJson() => _$ReleaseToJson(this); -} - -@JsonSerializable() - -/// Represents a section of release [notes] with a given [name]. -class ReleaseSection { - ReleaseSection({ - required this.name, - List? notes, - }) : notes = notes ?? []; - - ReleaseSection.emptyNotes({ - required this.name, - }) : notes = []; - - final String name; - final List notes; - - factory ReleaseSection.fromJson(Map json) => - _$ReleaseSectionFromJson(json); - - Map toJson() => _$ReleaseSectionToJson(this); -} - -@JsonSerializable() - -/// An individual release note entry, with a given [message]. -/// -/// The names of images relating to the releaseNote can be passed -/// in [imageNames]. WThe GitHub pull request url that the message is added to, -/// can be reflected through [githubPullRequestUrls]. -class ReleaseNote { - ReleaseNote({ - required this.message, - this.imageNames, - this.githubPullRequestUrls, - }) { - if (imageNames != null) { - for (var name in imageNames!) { - final path = "release_notes/files/$name"; - //TODO: get the proper path? - if (!File(path).existsSync()) { - throw Exception( - "Could not find image file $path for note: \n${toMarkdown()}"); - } - } - } - } - - List? githubPullRequestUrls; - final String message; - final List? imageNames; - - String toMarkdown() { - String markdown = ''; - markdown += '- $message'; - if (githubPullRequestUrls != null) { - List prUrls = []; - for (var url in githubPullRequestUrls!) { - final match = RegExp( - r'^https://github.com/flutter/devtools/pull/(?\d+)$') - .firstMatch(url); - if (match == null) { - throw Exception( - "Invalid github PR Url($url) found in message: $message}"); - } - final prNumber = match.namedGroup('pr_number'); - prUrls.add('[#$prNumber]($url)'); - } - markdown += ' - ${prUrls.join(", ")}'; - } - - markdown += '\n'; - - if (imageNames != null) { - for (var imageName in imageNames!) { - markdown += '![](files/$imageName)\n'; - } - } - - return markdown; - } - - factory ReleaseNote.fromJson(Map json) => - _$ReleaseNoteFromJson(json); - - Map toJson() => _$ReleaseNoteToJson(this); -} diff --git a/tool/lib/release_note_classes.g.dart b/tool/lib/release_note_classes.g.dart deleted file mode 100644 index 5624f17c571..00000000000 --- a/tool/lib/release_note_classes.g.dart +++ /dev/null @@ -1,51 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'release_note_classes.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -Release _$ReleaseFromJson(Map json) => Release( - version: - SemanticVersion.fromJson(json['version'] as Map), - sections: (json['sections'] as List) - .map((e) => ReleaseSection.fromJson(e as Map)) - .toList(), - ); - -Map _$ReleaseToJson(Release instance) => { - 'version': instance.version, - 'sections': instance.sections, - }; - -ReleaseSection _$ReleaseSectionFromJson(Map json) => - ReleaseSection( - name: json['name'] as String, - notes: (json['notes'] as List?) - ?.map((e) => ReleaseNote.fromJson(e as Map)) - .toList(), - ); - -Map _$ReleaseSectionToJson(ReleaseSection instance) => - { - 'name': instance.name, - 'notes': instance.notes, - }; - -ReleaseNote _$ReleaseNoteFromJson(Map json) => ReleaseNote( - message: json['message'] as String, - imageNames: (json['imageNames'] as List?) - ?.map((e) => e as String) - .toList(), - githubPullRequestUrls: (json['githubPullRequestUrls'] as List?) - ?.map((e) => e as String) - .toList(), - ); - -Map _$ReleaseNoteToJson(ReleaseNote instance) => - { - 'githubPullRequestUrls': instance.githubPullRequestUrls, - 'message': instance.message, - 'imageNames': instance.imageNames, - }; diff --git a/tool/pubspec.yaml b/tool/pubspec.yaml index b102309fd8d..736f05ae63b 100644 --- a/tool/pubspec.yaml +++ b/tool/pubspec.yaml @@ -9,14 +9,9 @@ dependencies: cli_util: ^0.3.3 devtools_shared: ^2.18.0 http: ^0.13.3 - json_annotation: ^4.4.0 lints: any path: ^1.8.0 dependency_overrides: devtools_shared: path: ../packages/devtools_shared - -dev_dependencies: - build_runner: ^2.0.0 - json_serializable: ^6.0.0 diff --git a/tool/release_note_helper.dart b/tool/release_note_helper.dart deleted file mode 100755 index 8862570836b..00000000000 --- a/tool/release_note_helper.dart +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright 2022 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'dart:convert'; -import 'dart:io'; - -import 'package:args/command_runner.dart'; -import 'lib/release_note_classes.dart'; - -void main(List args) { - final runner = CommandRunner( - 'release_note_helper', - 'Helps manage version notes for release.', - ) - ..addCommand(VerifyCommand()) - ..addCommand(MarkDownCommand()) - ..addCommand(BackfillPullRequestUrlCommand()); - - runner.run(args).catchError((error) { - if (error is! UsageException) throw error; - print(error); - exit(64); // Exit code 64 indicates a usage error. - }); - return; -} - -class MarkDownCommand extends Command { - @override - final name = 'markdown'; - @override - final description = 'Prints all versions listed in the `file`, in markdown.'; - - MarkDownCommand() { - argParser.addOption( - 'file', - abbr: 'f', - mandatory: true, - help: 'The json release file to operate on.', - ); - } - - @override - void run() async { - final filePath = argResults!['file'].toString(); - - final fileContents = await File(filePath).readAsString(); - Release release = Release.fromJson(jsonDecode(fileContents)); - - print(release.toMarkdown()); - } -} - -class VerifyCommand extends Command { - @override - final name = 'verify'; - @override - final description = - 'Verifies that the release_notes.json file is still readable with the serializable dart classes.'; - - VerifyCommand() { - argParser.addOption( - 'file', - abbr: 'f', - mandatory: true, - help: - 'The json release file to verify. The file will be decoded and parsed to ensure that it\'s format is still what is expected.', - ); - } - - @override - void run() async { - final filePath = argResults!['file'].toString(); - final fileContents = await File(filePath).readAsString(); - - // This step will fail if the json is not valid, or can't be unserialized - Release.fromJson(jsonDecode(fileContents)); - - print('Release notes were successfully decoded and serialized'); - } -} - -class BackfillPullRequestUrlCommand extends Command { - @override - final name = 'pr-url'; - - @override - final description = - 'Checks if all entries in the release notes have pr urls. If a -u ' - 'parameter is passed along, any entries missing a pr url, will be given ' - 'that pr url.'; - - BackfillPullRequestUrlCommand() { - argParser.addOption( - 'url', - abbr: 'u', - mandatory: false, - help: - 'Add the url to any note, that does NOT already have an URL assigned to it.', - ); - argParser.addOption( - 'file', - abbr: 'f', - mandatory: true, - help: 'The json release file to operate on.', - ); - } - - @override - void run() async { - final filePath = argResults!['file'].toString(); - final url = argResults!['url']?.toString(); - - final file = File(filePath); - final fileContents = await file.readAsString(); - // This step will fail if the json is not valid, or can't be unserialized - final release = Release.fromJson(jsonDecode(fileContents)); - - var foundMissingPrUrl = false; - for (var section in release.sections) { - for (var note in section.notes) { - if (note.githubPullRequestUrls == null || - note.githubPullRequestUrls!.isEmpty) { - foundMissingPrUrl = true; - if (url != null) { - note.githubPullRequestUrls = [url]; - } - } - } - } - if (foundMissingPrUrl) { - if (url != null) { - final encoder = JsonEncoder.withIndent(" "); - await file.writeAsString(encoder.convert( - release.toJson(), - )); - } - print('Missing PR urls found in $filePath'); - exit(1); - } - print('No Missing PR Urls Found.'); - } -} diff --git a/tool/release_notes/release_notes.json b/tool/release_notes/release_notes.json deleted file mode 100644 index ff9782c7397..00000000000 --- a/tool/release_notes/release_notes.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "version": { - "major": 2, - "minor": 19, - "patch": 0, - "preReleaseMajor": null, - "preReleaseMinor": null - }, - "sections": [ - { - "name": "General updates", - "notes": [] - }, - { - "name": "Inspector update", - "notes": [] - }, - { - "name": "Performance updates", - "notes": [] - }, - { - "name": "CPU profiler updates", - "notes": [] - }, - { - "name": "Memory updates", - "notes": [] - }, - { - "name": "Network profiler updates", - "notes": [] - }, - { - "name": "Logging updates", - "notes": [] - }, - { - "name": "App size tool updates", - "notes": [] - } - ] -} \ No newline at end of file From d3a6341e705031dd083f6bca3d785b5d6b65443f Mon Sep 17 00:00:00 2001 From: Dan Chevalier Date: Wed, 14 Dec 2022 18:01:43 -0500 Subject: [PATCH 09/25] Initial workflow changes for simplified release note process --- .github/workflows/release-notes.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-notes.yaml b/.github/workflows/release-notes.yaml index 2842f8ff71e..3d66f11253d 100644 --- a/.github/workflows/release-notes.yaml +++ b/.github/workflows/release-notes.yaml @@ -4,7 +4,7 @@ on: pull_request: types: [ assigned, opened, synchronize, reopened, edited ] env: - CURRENT_RELEASE_JSON_FILE_PATH: tool/release_notes/release_notes.json + CURRENT_RELEASE_JSON_FILE_PATH: tool/release_notes/RELEASE_NOTES.md jobs: release-preparedness: runs-on: ubuntu-latest @@ -17,7 +17,7 @@ jobs: PULL_REQUEST_NUMBER=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH") echo "PULL_REQUEST_NUMBER=$PULL_REQUEST_NUMBER" >> $GITHUB_OUTPUT - - name: Check if we have modified release_notes.json + - name: Check if we have modified release note file id: get-modified-files env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -38,7 +38,7 @@ jobs: PULLS_RESPONSE=$(gh api /repos/flutter/devtools/pulls/$PULL_NUMBER) DESCRIPTION_BODY=$(echo $PULLS_RESPONSE | jq '.body') echo $DESCRIPTION_BODY - if $(echo $DESCRIPTION_BODY | grep -q "> NO RELEASE NOTE CHANGES:"); then + if $(echo $DESCRIPTION_BODY | grep -Eq "^TEST="); then HAS_RELEASE_NOTE_EXCEPTION_STRING=true else HAS_RELEASE_NOTE_EXCEPTION_STRING=false From 61b053724f545a5458ae0819f01d2149dabb418f Mon Sep 17 00:00:00 2001 From: Dan Chevalier Date: Wed, 14 Dec 2022 18:37:46 -0500 Subject: [PATCH 10/25] move the template` --- .../release_notes/helpers/release_notes_template.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename packages/devtools_app/lib/src/framework/release_notes/release-notes-template.md => tool/release_notes/helpers/release_notes_template.md (100%) diff --git a/packages/devtools_app/lib/src/framework/release_notes/release-notes-template.md b/tool/release_notes/helpers/release_notes_template.md similarity index 100% rename from packages/devtools_app/lib/src/framework/release_notes/release-notes-template.md rename to tool/release_notes/helpers/release_notes_template.md From edbf28892b5e426383d0415ed31da3764df1d6ce Mon Sep 17 00:00:00 2001 From: Dan Chevalier Date: Wed, 14 Dec 2022 21:52:41 -0500 Subject: [PATCH 11/25] markdown release note behaviour --- tool/update_version.dart | 41 +++++++++++++--------------------------- 1 file changed, 13 insertions(+), 28 deletions(-) diff --git a/tool/update_version.dart b/tool/update_version.dart index f9c6e3d85d8..d855814d775 100644 --- a/tool/update_version.dart +++ b/tool/update_version.dart @@ -8,8 +8,6 @@ import 'dart:io'; import 'package:args/command_runner.dart'; import 'package:devtools_shared/devtools_shared.dart'; -import 'lib/release_note_classes.dart' as rn; - // This script must be executed from the top level devtools/ directory. // TODO(kenz): If changes are made to this script, first consider refactoring to // use https://github.com/dart-lang/pubspec_parse. @@ -51,6 +49,7 @@ Future performTheVersionUpdate( print('Updating CHANGELOG to version $newVersion...'); writeVersionToChangelog(File('CHANGELOG.md'), newVersion); + resetReleaseNotes(); print('Updating index.html to version $newVersion...'); writeVersionToIndexHtml( @@ -62,35 +61,21 @@ Future performTheVersionUpdate( }); } -Future resetReleaseNotes({ - required SemanticVersion newVersion, -}) async { - final release = rn.Release(version: newVersion, sections: [ - rn.ReleaseSection(name: 'General updates'), - rn.ReleaseSection(name: 'Inspector update'), - rn.ReleaseSection(name: 'Performance updates'), - rn.ReleaseSection(name: 'CPU profiler updates'), - rn.ReleaseSection(name: 'Memory updates'), - rn.ReleaseSection(name: 'Network profiler updates'), - rn.ReleaseSection(name: 'Logging updates'), - rn.ReleaseSection(name: 'App size tool updates'), - ]); - +Future resetReleaseNotes() async { // Clear out the current notes - final releaseNotesDir = Directory('./tool/release_notes/'); - if (releaseNotesDir.existsSync()) { - releaseNotesDir.delete(recursive: true); + final imagesDir = Directory('./tool/release_notes/images'); + if (imagesDir.existsSync()) { + await imagesDir.delete(recursive: true); + } + final currentReleaseNotesFile = + File('./tool/release_notes/NEXT_RELEASE_NOTES.md'); + if (currentReleaseNotesFile.existsSync()) { + await currentReleaseNotesFile.delete(); } - final filesDir = Directory('./tool/release_notes/files'); - - await releaseNotesDir.create(); - await filesDir.create(); - // populate a blank release notes file - JsonEncoder encoder = JsonEncoder.withIndent(' '); - await File('./tool/release_notes/release_notes.json').writeAsString( - encoder.convert(release), - ); + final templateFile = + File('./tool/release_notes/helpers/release-notes-template.md'); + templateFile.copy('./tool/release_notes/NEXT_RELEASE_NOTES.md'); } String? incrementVersionByType(String version, String type) { From faef47815748f22a9c900fdd2f330fd2b0f1a866 Mon Sep 17 00:00:00 2001 From: Dan Chevalier Date: Wed, 14 Dec 2022 22:35:26 -0500 Subject: [PATCH 12/25] gitkeep and small changes --- tool/release_notes/NEXT_RELEASE_NOTES.md | 37 ++++++++++++++++++++++++ tool/release_notes/images/.gitkeep | 0 tool/update_version.dart | 11 +++++-- 3 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 tool/release_notes/NEXT_RELEASE_NOTES.md create mode 100644 tool/release_notes/images/.gitkeep diff --git a/tool/release_notes/NEXT_RELEASE_NOTES.md b/tool/release_notes/NEXT_RELEASE_NOTES.md new file mode 100644 index 00000000000..a3a4ef40939 --- /dev/null +++ b/tool/release_notes/NEXT_RELEASE_NOTES.md @@ -0,0 +1,37 @@ +This is draft for future release notes, that are going to land on +[the Flutter website](https://docs.flutter.dev/development/tools/devtools/release-notes). + +# DevTools release notes + +Dart & Flutter DevTools - A Suite of Performance Tools for Dart and Flutter + +## General updates +TODO: Remove this section if there are not any general updates. + +## Inspector updates +TODO: Remove this section if there are not any general updates. + +## Performance updates +TODO: Remove this section if there are not any general updates. + +## CPU profiler updates +TODO: Remove this section if there are not any general updates. + +## Memory updates +TODO: Remove this section if there are not any general updates. + +## Debugger updates +TODO: Remove this section if there are not any general updates. + +## Network profiler updates +TODO: Remove this section if there are not any general updates. + +## Logging updates +TODO: Remove this section if there are not any general updates. + +## App size tool updates +TODO: Remove this section if there are not any general updates. + +## Changelog +More details about changes and fixes are available in the DevTools +[changelog](https://github.com/flutter/devtools/blob/master/CHANGELOG.md). diff --git a/tool/release_notes/images/.gitkeep b/tool/release_notes/images/.gitkeep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tool/update_version.dart b/tool/update_version.dart index d855814d775..8a5bfc805c3 100644 --- a/tool/update_version.dart +++ b/tool/update_version.dart @@ -49,7 +49,9 @@ Future performTheVersionUpdate( print('Updating CHANGELOG to version $newVersion...'); writeVersionToChangelog(File('CHANGELOG.md'), newVersion); - resetReleaseNotes(); + resetReleaseNotes( + version: newVersion, + ); print('Updating index.html to version $newVersion...'); writeVersionToIndexHtml( @@ -61,7 +63,9 @@ Future performTheVersionUpdate( }); } -Future resetReleaseNotes() async { +Future resetReleaseNotes({ + required String version, +}) async { // Clear out the current notes final imagesDir = Directory('./tool/release_notes/images'); if (imagesDir.existsSync()) { @@ -74,8 +78,9 @@ Future resetReleaseNotes() async { } final templateFile = - File('./tool/release_notes/helpers/release-notes-template.md'); + File('./tool/release_notes/helpers/release_notes_template.md'); templateFile.copy('./tool/release_notes/NEXT_RELEASE_NOTES.md'); + // TODO: Replace with new version } String? incrementVersionByType(String version, String type) { From 58f9f413000420ef5eba884cd0ec8d258b402223 Mon Sep 17 00:00:00 2001 From: Dan Chevalier Date: Thu, 15 Dec 2022 10:44:57 -0500 Subject: [PATCH 13/25] release note wipe --- tool/update_version.dart | 59 +++++++++++++++++++++++++++++++++------- 1 file changed, 49 insertions(+), 10 deletions(-) diff --git a/tool/update_version.dart b/tool/update_version.dart index 8a5bfc805c3..4ee233a9f84 100644 --- a/tool/update_version.dart +++ b/tool/update_version.dart @@ -24,7 +24,8 @@ void main(List args) async { 'A program for updating the devtools version', ) ..addCommand(ManualUpdateCommand()) - ..addCommand(AutoUpdateCommand()); + ..addCommand(AutoUpdateCommand()) + ..addCommand(CurrentVersionCommand()); runner.run(args).catchError((error) { if (error is! UsageException) throw error; print(error); @@ -33,8 +34,11 @@ void main(List args) async { return; } -Future performTheVersionUpdate( - {required String currentVersion, required String newVersion}) async { +Future performTheVersionUpdate({ + required String currentVersion, + required String newVersion, + bool modifyChangeLog = true, +}) async { print('Updating pubspecs from $currentVersion to version $newVersion...'); for (final pubspec in _pubspecs) { @@ -47,11 +51,10 @@ Future performTheVersionUpdate( newVersion, ); - print('Updating CHANGELOG to version $newVersion...'); - writeVersionToChangelog(File('CHANGELOG.md'), newVersion); - resetReleaseNotes( - version: newVersion, - ); + if (modifyChangeLog) { + print('Updating CHANGELOG to version $newVersion...'); + writeVersionToChangelog(File('CHANGELOG.md'), newVersion); + } print('Updating index.html to version $newVersion...'); writeVersionToIndexHtml( @@ -77,10 +80,25 @@ Future resetReleaseNotes({ await currentReleaseNotesFile.delete(); } + // Normalize the version number so that it onl + final semVerMatch = RegExp(r'^(?\d+)\.(?\d+)\.(?\d+)') + .firstMatch(version); + if (semVerMatch == null) { + throw 'Version format is unexpected'; + } + var major = int.parse(semVerMatch.namedGroup('major')!, radix: 10); + var minor = int.parse(semVerMatch.namedGroup('minor')!, radix: 10); + final normalizedVersionNumber = '$major.$minor.0'; + final templateFile = File('./tool/release_notes/helpers/release_notes_template.md'); - templateFile.copy('./tool/release_notes/NEXT_RELEASE_NOTES.md'); - // TODO: Replace with new version + final templateFileContents = await templateFile.readAsString(); + templateFile.writeAsString( + templateFileContents.replaceAll( + RegExp(r''), + normalizedVersionNumber, + ), + ); } String? incrementVersionByType(String version, String type) { @@ -308,6 +326,18 @@ class ManualUpdateCommand extends Command { } } +class CurrentVersionCommand extends Command { + @override + final name = 'current-version'; + @override + final description = 'Print the current devtools_app version.'; + + @override + void run() async { + print(versionFromPubspecFile()); + } +} + class AutoUpdateCommand extends Command { @override final name = 'auto'; @@ -367,6 +397,7 @@ class AutoUpdateCommand extends Command { final type = argResults!['type'].toString(); final isDryRun = argResults!['dry-run']; final currentVersion = versionFromPubspecFile(); + bool modifyChangeLog = true; String? newVersion; if (currentVersion == null) { throw 'Could not automatically determine current version.'; @@ -377,6 +408,7 @@ class AutoUpdateCommand extends Command { break; case 'dev': newVersion = incrementDevVersion(currentVersion); + modifyChangeLog = false; break; default: newVersion = incrementVersionByType(currentVersion, type); @@ -393,6 +425,13 @@ class AutoUpdateCommand extends Command { performTheVersionUpdate( currentVersion: currentVersion, newVersion: newVersion, + modifyChangeLog: modifyChangeLog, ); + if (['minor', 'major'].contains(type)) { + // Only cycle the release notes when doing a minor or major version bump + resetReleaseNotes( + version: newVersion, + ); + } } } From 46c55dbb5ce41ac47dc3552f245a5f22c25b501f Mon Sep 17 00:00:00 2001 From: Dan Chevalier Date: Thu, 15 Dec 2022 11:04:59 -0500 Subject: [PATCH 14/25] better image dir management. Writing the proper file --- tool/update_version.dart | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tool/update_version.dart b/tool/update_version.dart index 4ee233a9f84..e0ea910e5f1 100644 --- a/tool/update_version.dart +++ b/tool/update_version.dart @@ -69,11 +69,16 @@ Future performTheVersionUpdate({ Future resetReleaseNotes({ required String version, }) async { + print('Resetting the release notes'); + // Clear out the current notes final imagesDir = Directory('./tool/release_notes/images'); if (imagesDir.existsSync()) { await imagesDir.delete(recursive: true); } + + await File('./tool/release_notes/images/.gitkeep').create(); + final currentReleaseNotesFile = File('./tool/release_notes/NEXT_RELEASE_NOTES.md'); if (currentReleaseNotesFile.existsSync()) { @@ -93,7 +98,7 @@ Future resetReleaseNotes({ final templateFile = File('./tool/release_notes/helpers/release_notes_template.md'); final templateFileContents = await templateFile.readAsString(); - templateFile.writeAsString( + currentReleaseNotesFile.writeAsString( templateFileContents.replaceAll( RegExp(r''), normalizedVersionNumber, From 0634cb39307cadaa073d3f057b42f716dcd2ee9a Mon Sep 17 00:00:00 2001 From: Dan Chevalier Date: Thu, 15 Dec 2022 11:06:22 -0500 Subject: [PATCH 15/25] RN version --- tool/release_notes/NEXT_RELEASE_NOTES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tool/release_notes/NEXT_RELEASE_NOTES.md b/tool/release_notes/NEXT_RELEASE_NOTES.md index a3a4ef40939..a7a256aa52e 100644 --- a/tool/release_notes/NEXT_RELEASE_NOTES.md +++ b/tool/release_notes/NEXT_RELEASE_NOTES.md @@ -1,7 +1,7 @@ This is draft for future release notes, that are going to land on [the Flutter website](https://docs.flutter.dev/development/tools/devtools/release-notes). -# DevTools release notes +# DevTools 2.21.0 release notes Dart & Flutter DevTools - A Suite of Performance Tools for Dart and Flutter From aea5d79ea3b935cc98c02fef9fe3b624ee41dae8 Mon Sep 17 00:00:00 2001 From: Dan Chevalier Date: Thu, 15 Dec 2022 11:46:57 -0500 Subject: [PATCH 16/25] better grep --- .github/workflows/release-notes.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-notes.yaml b/.github/workflows/release-notes.yaml index 3d66f11253d..a880a61eee0 100644 --- a/.github/workflows/release-notes.yaml +++ b/.github/workflows/release-notes.yaml @@ -38,7 +38,7 @@ jobs: PULLS_RESPONSE=$(gh api /repos/flutter/devtools/pulls/$PULL_NUMBER) DESCRIPTION_BODY=$(echo $PULLS_RESPONSE | jq '.body') echo $DESCRIPTION_BODY - if $(echo $DESCRIPTION_BODY | grep -Eq "^TEST="); then + if $(echo $DESCRIPTION_BODY | grep -Eq "RELEASE_NOTE_EXCEPTION="); then HAS_RELEASE_NOTE_EXCEPTION_STRING=true else HAS_RELEASE_NOTE_EXCEPTION_STRING=false From b0a588df0282dc1afbe0e9d6ae1c04d8848033fc Mon Sep 17 00:00:00 2001 From: Dan Chevalier Date: Thu, 15 Dec 2022 11:48:34 -0500 Subject: [PATCH 17/25] fix description --- .github/workflows/release-notes.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-notes.yaml b/.github/workflows/release-notes.yaml index a880a61eee0..c1527d1e96c 100644 --- a/.github/workflows/release-notes.yaml +++ b/.github/workflows/release-notes.yaml @@ -52,7 +52,7 @@ jobs: run: | if [ "$HAS_CHANGED_RELEASE_NOTES" != "true" ] && [ "$HAS_RELEASE_NOTE_EXCEPTION_STRING" != "true" ] ; then echo "Release Preparedness check failed" - echo "::error file=$CURRENT_RELEASE_JSON_FILE_PATH,line=0,col=0,endColumn=0,title='Release Notes Weren\'t Modified'::Please add a release note entry or a reason to your description using: \`> NO RELEASE NOTE CHANGES: [reason goes here]\`" + echo "::error file=$CURRENT_RELEASE_JSON_FILE_PATH,line=0,col=0,endColumn=0,title='Release Notes Weren\'t Modified'::Please add a release note entry or a reason to your description using: \`RELEASE_NOTE_EXCEPTION=[reason goes here]\`" exit 1 fi From 492102597e34b23cdec1012fcb66085440780ba3 Mon Sep 17 00:00:00 2001 From: Dan Chevalier Date: Thu, 15 Dec 2022 11:59:11 -0500 Subject: [PATCH 18/25] making sure we use the repo the PR is in --- .github/workflows/release-notes.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-notes.yaml b/.github/workflows/release-notes.yaml index c1527d1e96c..30b7fc1b2ee 100644 --- a/.github/workflows/release-notes.yaml +++ b/.github/workflows/release-notes.yaml @@ -35,7 +35,7 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} PULL_NUMBER: ${{steps.get-pull-request-number.outputs.PULL_REQUEST_NUMBER}} run: | - PULLS_RESPONSE=$(gh api /repos/flutter/devtools/pulls/$PULL_NUMBER) + PULLS_RESPONSE=$(gh api /repos/${{GITHUB_REPOSITORY}}/pulls/$PULL_NUMBER) DESCRIPTION_BODY=$(echo $PULLS_RESPONSE | jq '.body') echo $DESCRIPTION_BODY if $(echo $DESCRIPTION_BODY | grep -Eq "RELEASE_NOTE_EXCEPTION="); then From 0ea9dcead1859292df337170933b875d4929cc0e Mon Sep 17 00:00:00 2001 From: Dan Chevalier Date: Thu, 15 Dec 2022 12:02:05 -0500 Subject: [PATCH 19/25] oops this is an env var --- .github/workflows/release-notes.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-notes.yaml b/.github/workflows/release-notes.yaml index 30b7fc1b2ee..aa2e6ebf710 100644 --- a/.github/workflows/release-notes.yaml +++ b/.github/workflows/release-notes.yaml @@ -35,7 +35,7 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} PULL_NUMBER: ${{steps.get-pull-request-number.outputs.PULL_REQUEST_NUMBER}} run: | - PULLS_RESPONSE=$(gh api /repos/${{GITHUB_REPOSITORY}}/pulls/$PULL_NUMBER) + PULLS_RESPONSE=$(gh api /repos/$GITHUB_REPOSITORY/pulls/$PULL_NUMBER) DESCRIPTION_BODY=$(echo $PULLS_RESPONSE | jq '.body') echo $DESCRIPTION_BODY if $(echo $DESCRIPTION_BODY | grep -Eq "RELEASE_NOTE_EXCEPTION="); then From fed9ecdaf0aeaa649a2de12dba2f6e5dde16dc59 Mon Sep 17 00:00:00 2001 From: Dan Chevalier Date: Thu, 15 Dec 2022 12:09:20 -0500 Subject: [PATCH 20/25] update the RN file --- .github/workflows/release-notes.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-notes.yaml b/.github/workflows/release-notes.yaml index aa2e6ebf710..fdc5d10b606 100644 --- a/.github/workflows/release-notes.yaml +++ b/.github/workflows/release-notes.yaml @@ -4,7 +4,7 @@ on: pull_request: types: [ assigned, opened, synchronize, reopened, edited ] env: - CURRENT_RELEASE_JSON_FILE_PATH: tool/release_notes/RELEASE_NOTES.md + CURRENT_RELEASE_JSON_FILE_PATH: tool/release_notes/NEXT_RELEASE_NOTES.md jobs: release-preparedness: runs-on: ubuntu-latest From 4f70111af489686aea2839dc4a0149013639cc9f Mon Sep 17 00:00:00 2001 From: Dan Chevalier Date: Thu, 15 Dec 2022 12:11:56 -0500 Subject: [PATCH 21/25] make sure both api reqs are on the right branch --- .github/workflows/release-notes.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-notes.yaml b/.github/workflows/release-notes.yaml index fdc5d10b606..268b42186c1 100644 --- a/.github/workflows/release-notes.yaml +++ b/.github/workflows/release-notes.yaml @@ -23,7 +23,7 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} PULL_NUMBER: ${{steps.get-pull-request-number.outputs.PULL_REQUEST_NUMBER}} run: | - FILES_RESPONSE=$(gh api /repos/flutter/devtools/pulls/$PULL_NUMBER/files) + FILES_RESPONSE=$(gh api /repos/$GITHUB_REPOSITORY/pulls/$PULL_NUMBER/files) echo "FILES_RESPONSE: $FILES_RESPONSE" HAS_CHANGED_RELEASE_NOTES=$(echo $FILES_RESPONSE | jq '.[].filename' | jq -s '. | any(. == env.CURRENT_RELEASE_JSON_FILE_PATH)') From 4bcc3b3821273f27682f0d418419ca9a4a17a707 Mon Sep 17 00:00:00 2001 From: Dan Chevalier Date: Thu, 15 Dec 2022 13:07:27 -0500 Subject: [PATCH 22/25] remove validation --- .github/workflows/release-notes.yaml | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/.github/workflows/release-notes.yaml b/.github/workflows/release-notes.yaml index 268b42186c1..f9c6fe984ab 100644 --- a/.github/workflows/release-notes.yaml +++ b/.github/workflows/release-notes.yaml @@ -55,31 +55,3 @@ jobs: echo "::error file=$CURRENT_RELEASE_JSON_FILE_PATH,line=0,col=0,endColumn=0,title='Release Notes Weren\'t Modified'::Please add a release note entry or a reason to your description using: \`RELEASE_NOTE_EXCEPTION=[reason goes here]\`" exit 1 fi - - release-note-validation: - runs-on: ubuntu-latest - name: Release Note Validation - steps: - - name: Get Pull Request Number - id: get-pull-request-number - run: | - PULL_REQUEST_NUMBER=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH") - echo "PULL_REQUEST_NUMBER=$PULL_REQUEST_NUMBER" >> $GITHUB_OUTPUT - - uses: dart-lang/setup-dart@9a04e6d73cca37bd455e0608d7e5092f881fd603 - - uses: actions/checkout@v3 - - name: Verify the release note integrity - run: | - cd tool/ - dart pub get - dart release_note_helper.dart verify -f "../$CURRENT_RELEASE_JSON_FILE_PATH" - - - name: Check PR Urls - env: - PULL_NUMBER: ${{steps.get-pull-request-number.outputs.PULL_REQUEST_NUMBER}} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - cd tool/ - dart pub get - dart ./release_note_helper.dart pr-url \ - -f "../$CURRENT_RELEASE_JSON_FILE_PATH" \ - -u https://github.com/flutter/devtools/pull/$PULL_NUMBER From 18a37da390500ccbb98067681515ecb1f23ec34e Mon Sep 17 00:00:00 2001 From: Dan Chevalier Date: Thu, 15 Dec 2022 13:10:49 -0500 Subject: [PATCH 23/25] Single change --- .../lib/src/screens/inspector/inspector_screen.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/devtools_app/lib/src/screens/inspector/inspector_screen.dart b/packages/devtools_app/lib/src/screens/inspector/inspector_screen.dart index 5a4b994a993..5b4a15f3b73 100644 --- a/packages/devtools_app/lib/src/screens/inspector/inspector_screen.dart +++ b/packages/devtools_app/lib/src/screens/inspector/inspector_screen.dart @@ -84,7 +84,7 @@ class InspectorScreenBodyState extends State SearchTargetType searchTarget = SearchTargetType.widget; - static const summaryTreeKey = Key('Summary Tree'); + static const summaryTreeKey = Key('Summary Tree DAKE'); static const detailsTreeKey = Key('Details Tree'); static const minScreenWidthForTextBeforeScaling = 900.0; static const unscaledIncludeRefreshTreeWidth = 1255.0; From 5faf4b4e756ebc3cb1a510b50a5d9d6c7d03c920 Mon Sep 17 00:00:00 2001 From: Dan Chevalier Date: Thu, 15 Dec 2022 13:21:02 -0500 Subject: [PATCH 24/25] unused import --- tool/update_version.dart | 1 - 1 file changed, 1 deletion(-) diff --git a/tool/update_version.dart b/tool/update_version.dart index e0ea910e5f1..61e42229c9d 100644 --- a/tool/update_version.dart +++ b/tool/update_version.dart @@ -6,7 +6,6 @@ import 'dart:convert'; import 'dart:io'; import 'package:args/command_runner.dart'; -import 'package:devtools_shared/devtools_shared.dart'; // This script must be executed from the top level devtools/ directory. // TODO(kenz): If changes are made to this script, first consider refactoring to From 41d06fe054419716a0313dc092c928ac6dc13166 Mon Sep 17 00:00:00 2001 From: Daniel Chevalier Date: Thu, 15 Dec 2022 13:28:17 -0500 Subject: [PATCH 25/25] an release note change --- tool/release_notes/NEXT_RELEASE_NOTES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tool/release_notes/NEXT_RELEASE_NOTES.md b/tool/release_notes/NEXT_RELEASE_NOTES.md index a7a256aa52e..005bb62105a 100644 --- a/tool/release_notes/NEXT_RELEASE_NOTES.md +++ b/tool/release_notes/NEXT_RELEASE_NOTES.md @@ -9,7 +9,7 @@ Dart & Flutter DevTools - A Suite of Performance Tools for Dart and Flutter TODO: Remove this section if there are not any general updates. ## Inspector updates -TODO: Remove this section if there are not any general updates. +- We are making a change ## Performance updates TODO: Remove this section if there are not any general updates.