-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[flutter_plugin_tools] Check for missing version and CHANGELOG updates #4530
[flutter_plugin_tools] Check for missing version and CHANGELOG updates #4530
Conversation
late GitVersionFinder _gitVersionFinder; | ||
late String _mergeBase; | ||
late List<String> _changedFiles; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These can be late final since they are only set once, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call, done.
_gitVersionFinder = await retrieveVersionFinder(); | ||
_mergeBase = await _gitVersionFinder.getBaseSha(); | ||
_changedFiles = await _gitVersionFinder.getChangedFiles(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: These could be parallelized, right? No need to serialize them.
mergeBase = _gitVersionFinder.getBaseSha().then((x) { _mergeBase = x; });
...
await Futures.wait([mergeBase, changedFiles])
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In theory yes, but getChangedFiles
needs the base SHA, so it would make the code more complex without actually changing anything.
submit-queue incorrectly showing red; landing. |
flutter#4530) The currently documented repository policy is to: - require version updates for packages changes that don't meet specific exemptions, and - require CHANGELOG changes for essentially all changes. This adds tooling that enforces that policy, with a mechanism for overriding it via PR descriptions, to avoid cases where they are accidentally omitted without reviewers catching it. In order to facilitate testing (which require mocking another `git` command), this also updates the existing `version-check` tests: - Replaces the custom git result injection/validating with the newer bind-to-process-mocks approach that is now used in the rest of the tool tests. - Fixes some tests that were only checking for `ToolExit` to also check the error output, in order to ensure that failure tests are not accidentally passing for the wrong reason (as is being done in general as tests in the tooling are updated). Fixes flutter/flutter#93790
flutter#4530) The currently documented repository policy is to: - require version updates for packages changes that don't meet specific exemptions, and - require CHANGELOG changes for essentially all changes. This adds tooling that enforces that policy, with a mechanism for overriding it via PR descriptions, to avoid cases where they are accidentally omitted without reviewers catching it. In order to facilitate testing (which require mocking another `git` command), this also updates the existing `version-check` tests: - Replaces the custom git result injection/validating with the newer bind-to-process-mocks approach that is now used in the rest of the tool tests. - Fixes some tests that were only checking for `ToolExit` to also check the error output, in order to ensure that failure tests are not accidentally passing for the wrong reason (as is being done in general as tests in the tooling are updated). Fixes flutter/flutter#93790
The currently documented repository policy is to:
This adds tooling that enforces that policy, with a mechanism for overriding it via PR descriptions, to avoid cases where they are accidentally omitted without reviewers catching it.
In order to facilitate testing (which require mocking another
git
command), this also updates the existingversion-check
tests:ToolExit
to also check the error output, in order to ensure that failure tests are not accidentally passing for the wrong reason (as is being done in general as tests in the tooling are updated).Fixes flutter/flutter#93790
Pre-launch Checklist
dart format
.)[shared_preferences]
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.md
to add a description of the change, following repository CHANGELOG style.///
).