Skip to content

TEST #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 28 commits into
base: simple-release-notes
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
327a068
Adding release note behaviour
CoderDake Nov 15, 2022
3155fa0
unleash the PR
CoderDake Nov 15, 2022
a53ccea
Fix update version so we start with a dev version when bumping
CoderDake Nov 15, 2022
341b15a
trailing comma
CoderDake Nov 15, 2022
2ed1dfd
remove comments
CoderDake Nov 15, 2022
d814da0
fix lints
CoderDake Nov 15, 2022
54411ea
jsdoc. copyright. remove extra class
CoderDake Nov 16, 2022
88b1d72
Merge remote-tracking branch 'origin/master' into br-squashed-dake
CoderDake Dec 14, 2022
da9c23b
first cleanup
CoderDake Dec 14, 2022
d3a6341
Initial workflow changes for simplified release note process
CoderDake Dec 14, 2022
61b0537
move the template`
CoderDake Dec 14, 2022
edbf288
markdown release note behaviour
CoderDake Dec 15, 2022
faef478
gitkeep and small changes
CoderDake Dec 15, 2022
58f9f41
release note wipe
CoderDake Dec 15, 2022
0918ef6
Merge remote-tracking branch 'origin/master' into simple-release-notes
CoderDake Dec 15, 2022
46c55db
better image dir management.
CoderDake Dec 15, 2022
0634cb3
RN version
CoderDake Dec 15, 2022
aea5d79
better grep
CoderDake Dec 15, 2022
b0a588d
fix description
CoderDake Dec 15, 2022
4921025
making sure we use the repo the PR is in
CoderDake Dec 15, 2022
0ea9dce
oops this is an env var
CoderDake Dec 15, 2022
fed9ecd
update the RN file
CoderDake Dec 15, 2022
4f70111
make sure both api reqs are on the right branch
CoderDake Dec 15, 2022
4bcc3b3
remove validation
CoderDake Dec 15, 2022
18a37da
Single change
CoderDake Dec 15, 2022
5faf4b4
unused import
CoderDake Dec 15, 2022
e264f19
Merge branch 'simple-release-notes' into simple-release-notes-test
CoderDake Dec 15, 2022
41d06fe
an release note change
Dec 15, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -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].*

<!-- Uncomment and modify the following section if your PR does not require changes to the release notes -->
<!--
> NO RELEASE NOTE CHANGES: <REASON GOES HERE>
-->

## 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].

<!-- Links -->
[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
57 changes: 57 additions & 0 deletions .github/workflows/release-notes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Release Notes

on:
pull_request:
types: [ assigned, opened, synchronize, reopened, edited ]
env:
CURRENT_RELEASE_JSON_FILE_PATH: tool/release_notes/NEXT_RELEASE_NOTES.md
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 note file
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/$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)')
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/$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
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: \`RELEASE_NOTE_EXCEPTION=[reason goes here]\`"
exit 1
fi
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class InspectorScreenBodyState extends State<InspectorScreenBody>

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;
Expand Down
29 changes: 20 additions & 9 deletions tool/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -51,15 +71,6 @@ Run the `tool/update_version.dart` script to update the DevTools version.
dart tool/update_version.dart auto --type release
```

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.
Expand Down
37 changes: 37 additions & 0 deletions tool/release_notes/NEXT_RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -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 2.21.0 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
- We are making a change

## 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).
Empty file.
46 changes: 46 additions & 0 deletions tool/update_version.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,46 @@ Future<void> performTheVersionUpdate({
});
}

Future<void> 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()) {
await currentReleaseNotesFile.delete();
}

// Normalize the version number so that it onl
final semVerMatch = RegExp(r'^(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\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');
final templateFileContents = await templateFile.readAsString();
currentReleaseNotesFile.writeAsString(
templateFileContents.replaceAll(
RegExp(r'<number>'),
normalizedVersionNumber,
),
);
}

String? incrementVersionByType(String version, String type) {
final semVerMatch = RegExp(r'^(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)')
.firstMatch(version);
Expand Down Expand Up @@ -391,5 +431,11 @@ class AutoUpdateCommand extends Command {
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,
);
}
}
}