Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit 6398441

Browse files
author
Chris Yang
authored
Update PULL_REQUEST_TEMPLATE.md (#3801)
1 parent e2844d2 commit 6398441

File tree

3 files changed

+72
-58
lines changed

3 files changed

+72
-58
lines changed

.github/PULL_REQUEST_TEMPLATE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
- [ ] I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
1010
- [ ] I read the [Tree Hygiene] wiki page, which explains my responsibilities.
11-
- [ ] I read and followed the [Flutter Style Guide] and the [C++, Objective-C, Java style guides].
11+
- [ ] I read and followed the [Flutter Style Guide] and the [C++, Objective-C, Java style guides]. (Note that unlike the flutter/flutter repo, the flutter/plugins repo does use `dart format`. See [plugin_tool format](../script/tool/README.md#format-code))
1212
- [ ] I signed the [CLA].
1313
- [ ] The title of the PR starts with the name of the plugin surrounded by square brackets, e.g. `[shared_preferences]`
1414
- [ ] I listed at least one issue that this PR fixes in the description above.

CONTRIBUTING.md

+16-55
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Contributing to Flutter Plugins
22

3-
43
[![Build Status](https://api.cirrus-ci.com/github/flutter/plugins.svg)](https://cirrus-ci.com/github/flutter/plugins/master)
54

65
_See also: [Flutter's code of conduct](https://github.com/flutter/flutter/blob/master/CODE_OF_CONDUCT.md)_
@@ -26,14 +25,12 @@ for any of the following plugins, we encourage you to submit it
2625

2726
## Things you will need
2827

29-
3028
* Linux, Mac OS X, or Windows.
3129
* git (used for source version control).
3230
* An ssh client (used to authenticate with GitHub).
3331

3432
## Getting the code and configuring your environment
3533

36-
3734
* Ensure all the dependencies described in the previous section are installed.
3835
* Fork `https://github.com/flutter/plugins` into your own GitHub account. If
3936
you already have a fork, and are now installing a development environment on
@@ -48,8 +45,13 @@ for any of the following plugins, we encourage you to submit it
4845
fetch from the master repository, not your clone, when running `git fetch`
4946
et al.)
5047

51-
## Running the examples
5248

49+
## Setting up tools
50+
51+
There are scripts for many common tasks (testing, formatting, etc.) that will likely be useful in preparing a PR.
52+
See [plugin_tools](./script/tool/README.MD) for more details.
53+
54+
## Running the examples
5355

5456
To run an example with a prebuilt binary from the cloud, switch to that
5557
example's directory, run `pub get` to make sure its dependencies have been
@@ -137,13 +139,7 @@ pod lib lint --allow-warnings
137139
XCUITests aren't usually configured with cocoapods in this repo. They are configured in a xcode workspace target named RunnerUITests.
138140
To run all the XCUITests in a plugin, follow the steps in a regular iOS development workflow [here](https://developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/testing_with_xcode/chapters/05-running_tests.html)
139141

140-
For convenience, a [flutter_plugin_tools](https://pub.dev/packages/flutter_plugin_tools) command `xctest` could also be used to run all the XCUITests in the repo:
141-
142-
```console
143-
pub global activate flutter_plugin_tools
144-
cd <path_to_plugins>/packages
145-
pub global run flutter_plugin_tools xctest --target RunnerUITests --skip <plugins_to_skip>
146-
```
142+
For convenience, a [plugin_tools](./script/tool/README.MD) command [xctest](./script/tool/README.MD#run-xctests) could also be used to run all the XCUITests in the repo.
147143

148144
## Contributing code
149145

@@ -159,12 +155,12 @@ To start working on a patch:
159155
* `git fetch upstream`
160156
* `git checkout upstream/master -b <name_of_your_branch>`
161157
* Hack away.
162-
* Verify changes with [flutter_plugin_tools](https://pub.dev/packages/flutter_plugin_tools)
163-
```
164-
pub global activate flutter_plugin_tools
165-
pub global run flutter_plugin_tools format --plugins plugin_name
166-
pub global run flutter_plugin_tools analyze --plugins plugin_name
167-
pub global run flutter_plugin_tools test --plugins plugin_name
158+
* Verify changes with [plugin_tools](./script/tool/README.MD).
159+
```sh
160+
cd script/tool && pub get && cd ../../
161+
dart ./script/tool/lib/src/main.dart format --plugins plugin_name
162+
dart ./script/tool/lib/src/main.dart analyze --plugins plugin_name
163+
dart ./script/tool/lib/src/main.dart test --plugins plugin_name
168164
```
169165
* `git commit -a -m "<your informative commit message>"`
170166
* `git push origin <name_of_your_branch>`
@@ -194,8 +190,6 @@ You may also add it to the AUTHORS file for [the repository](AUTHORS).
194190

195191
### The review process
196192

197-
* This is a new process we are currently experimenting with, feedback on the process is welcomed at the Gitter contributors channel. *
198-
199193
Reviewing PRs often requires a non trivial amount of time. We prioritize issues, not PRs, so that we use our maintainers' time in the most impactful way. Issues pertaining to this repository are managed in the [flutter/flutter issue tracker and are labeled with "plugin"](https://github.com/flutter/flutter/issues?q=is%3Aopen+is%3Aissue+label%3Aplugin+sort%3Areactions-%2B1-desc). Non trivial PRs should have an associated issue that will be used for prioritization. See the [prioritization section](https://github.com/flutter/flutter/wiki/Issue-hygiene#prioritization) in the Flutter wiki to understand how issues are prioritized.
200194

201195
Newly opened PRs first go through initial triage which results in one of:
@@ -237,45 +231,12 @@ Some things to keep in mind before publishing the release:
237231
from people that immediately adopt it, and uncovering and resolving those
238232
support issues will take more time if you're unavailable.
239233

240-
Releasing a package is a two-step process.
234+
To release a package, a [publish-plugin](./script/tool/README.MD#publish-and-tag-release) tool script should be used. This command publishes the new version to pub.dev, and tags the commit in the format of `<package_name>-v<package_version>` then pushes it to upstream.
235+
236+
Alternatively, one can release a package in the below 2-step process.
241237

242238
1. Push the package update to [pub.dev](https://pub.dev) using `pub publish`.
243239
2. Tag the commit with git in the format of `<package_name>-v<package_version>`,
244240
and then push the tag to the `flutter/plugins` master branch. This can be
245241
done manually with `git tag $tagname && git push upstream $tagname` while
246242
checked out on the commit that updated `version` in `pubspec.yaml`.
247-
248-
We've recently updated
249-
[flutter_plugin_tools](https://github.com/flutter/plugin_tools) to wrap both of
250-
those steps into one command to make it a little easier. This new tool is
251-
experimental. Feel free to fall back on manually running `pub publish` and
252-
creating and pushing the tag in git if there are issues with it.
253-
254-
Install the tool by running:
255-
256-
```terminal
257-
$ pub global activate flutter_plugin_tools
258-
```
259-
260-
Then, from the root of your local `flutter/plugins` repo, use the tool to
261-
publish a release.
262-
263-
```terminal
264-
$ pub global run flutter_plugin_tools publish-plugin --package $package
265-
```
266-
267-
By default the tool tries to push tags to the `upstream` remote, but that and
268-
some additional settings can be configured. Run `pub global activate
269-
flutter_plugin_tools --help` for more usage information.
270-
271-
The tool wraps `pub publish` for pushing the package to pub, and then will
272-
automatically use git to try and create and push tags. It has some additional
273-
safety checking around `pub publish` too. By default `pub publish` publishes
274-
_everything_, including untracked or uncommitted files in version control.
275-
`flutter_plugin_tools publish-plugin` will first check the status of the local
276-
directory and refuse to publish if there are any mismatched files with version
277-
control present.
278-
279-
There is a lot about this process that is still to be desired. Some top level
280-
items are being tracked in
281-
[flutter/flutter#27258](https://github.com/flutter/flutter/issues/27258).

script/tool/README.md

+55-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,61 @@
11
# Flutter Plugin Tools
22

3+
Note: The commands in tools are designed to run at the root of the repository or `<repository-root>/packages/`.
4+
35
To run the tool:
46

57
```sh
6-
dart pub get
7-
dart run lib/src/main.dart <args>
8+
cd <path_to_plugins>/script/tool && dart pub get && cd ../../
9+
dart run ./script/tool/lib/src/main.dart <args>
10+
```
11+
12+
## Format Code
13+
14+
```sh
15+
cd <path_to_plugins>
16+
dart run /script/tool/lib/src/main.dart format --plugins plugin_name
17+
```
18+
19+
## Run static analyzer
20+
21+
```sh
22+
cd <path_to_plugins>
23+
pub run ./script/tool/lib/src/main.dart analyze --plugins plugin_name
24+
```
25+
26+
## Run Dart unit tests
27+
28+
```sh
29+
cd <path_to_plugins>
30+
pub run ./script/tool/lib/src/main.dart test --plugins plugin_name
31+
```
32+
33+
## Run XCTests
34+
35+
```sh
36+
cd <path_to_plugins>
37+
dart run lib/src/main.dart xctest --target RunnerUITests --skip <plugins_to_skip>
838
```
39+
40+
## Publish and tag release
41+
42+
``sh
43+
cd <path_to_plugins>
44+
git checkout <commit_hash_to_publish>
45+
dart run ./script/tool/lib/src/main.dart publish-plugin --package <package>
46+
``
47+
48+
By default the tool tries to push tags to the `upstream` remote, but some
49+
additional settings can be configured. Run `dart run ./script/tool/lib/src/main.dart publish-plugin --help` for more usage information.
50+
51+
The tool wraps `pub publish` for pushing the package to pub, and then will
52+
automatically use git to try to create and push tags. It has some additional
53+
safety checking around `pub publish` too. By default `pub publish` publishes
54+
_everything_, including untracked or uncommitted files in version control.
55+
`publish-plugin` will first check the status of the local
56+
directory and refuse to publish if there are any mismatched files with version
57+
control present.
58+
59+
There is a lot about this process that is still to be desired. Some top level
60+
items are being tracked in
61+
[flutter/flutter#27258](https://github.com/flutter/flutter/issues/27258).

0 commit comments

Comments
 (0)