Skip to content

Commit 2e2587a

Browse files
authored
Add hotfix instructions to DWDS (#1876)
1 parent fe39123 commit 2e2587a

File tree

1 file changed

+65
-10
lines changed

1 file changed

+65
-10
lines changed

dwds/CONTRIBUTING.md

Lines changed: 65 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ alias flutter_tools='/YOUR_PATH/flutter/bin/dart --observe /YOUR_PATH/flutter/pa
1919
> - `/PATH_TO_YOUR_FLUTTER_REPO/packages/flutter_tools/bin/flutter_tools.dart`:
2020
> This is the path to Flutter Tools itself
2121
>
22-
> *More details can be found at the Flutter Tools
23-
> [README](https://github.com/flutter/flutter/blob/master/packages/flutter_tools/README.md).*
22+
> _More details can be found at the Flutter Tools
23+
> [README](https://github.com/flutter/flutter/blob/master/packages/flutter_tools/README.md)._
2424
2525
3. In your Flutter Tools
2626
[`pubspec.yaml`](https://github.com/flutter/flutter/blob/master/packages/flutter_tools/pubspec.yaml),
@@ -73,8 +73,8 @@ the example app and connect to DWDS.
7373

7474
### Step 1: Roll DWDS into g3
7575

76-
> *NOTE: You must be a Googler to do this step. If you are not, please ask
77-
> someone for help.*
76+
> _NOTE: You must be a Googler to do this step. If you are not, please ask
77+
> someone for help._
7878
7979
- See directions at: go/roll-dwds
8080
- Wait a few days after rolling into g3 before continuing to step 2. We do so to
@@ -91,21 +91,21 @@ the example app and connect to DWDS.
9191
- From `/dwds` run `dart run build_runner build`, this will build and update the
9292
version in `/dwds/lib/src/version.dart`
9393
- Submit a PR with those changes (example PR:
94-
https://github.com/dart-lang/webdev/pull/1456). *Note: Ensure your PR doesn’t
95-
have any dependency overrides.*
94+
https://github.com/dart-lang/webdev/pull/1456). _Note: Ensure your PR doesn’t
95+
have any dependency overrides._
9696
- Once the PR is submitted, pull from master and `run dart pub publish`
9797
- Finally, go to https://github.com/dart-lang/webdev/releases and create a new
9898
release, eg https://github.com/dart-lang/webdev/releases/tag/dwds-v12.0.0. You
9999
might need to delete some of the content of the autogenerated notes.
100100

101-
> *Note: To have the right permissions for publishing, you need to be invited to
101+
> _Note: To have the right permissions for publishing, you need to be invited to
102102
> the tools.dart.dev. A member of the Dart team should be able to add you at
103-
> https://pub.dev/publishers/tools.dart.dev/admin.*
103+
> https://pub.dev/publishers/tools.dart.dev/admin._
104104
105105
## Step 3: Publish Webdev to pub
106106

107-
> *Note: DWDS is a dependency of Webdev, which is why DWDS must be published
108-
> before Webdev can be published.*
107+
> _Note: DWDS is a dependency of Webdev, which is why DWDS must be published
108+
> before Webdev can be published._
109109
110110
Follow instructions in the `webdev/webdev`
111111
[CONTRIBUTING](/webdev/CONTRIBUTING.md) to release Webdev.
@@ -138,3 +138,58 @@ you need to:
138138
> run tests for all earlier stable releases of the SDK that match the
139139
> constraint, which would have differences in functionality and therefore need
140140
> different tests.
141+
142+
## Hotfixes
143+
144+
Sometimes you might need to do a hotfix release of DWDS. An example of why this
145+
might be necessary is if you need to do a hotfix of DWDS into Flutter, but don't
146+
want to release a new version of DWDS with the current untested changes on the
147+
master branch. Instead you only want to apply a fix to the current version of
148+
DWDS in Flutter.
149+
150+
### Instructions:
151+
152+
1. Create a branch off the release that needs a hotfix:
153+
154+
a. In the Github UI's
155+
[commit history view](https://github.com/dart-lang/webdev/commits/master),
156+
find the commit that prepared the release of DWDS that you would like to
157+
hotfix.
158+
159+
b. Click on `< >` ("Browse the repository at this point in history").
160+
161+
c. At the top-left, you should see the commit hash in a dropdown. Click the
162+
dropdown, and type in a name for your hotfix branch (e.g.
163+
`16.0.2-hotfix-release`). Then select "Create branch `16.0.2-hotfix-release`
164+
from `commit_hash`".
165+
166+
d. From your local clone of DWDS, run `git fetch upstream`. (_Note: this
167+
assumes you have already configured git to sync your fork with the `upstream`
168+
repository. If you haven't, follow
169+
[these instructions](https://docs.github.com/en/get-started/quickstart/fork-a-repo#configuring-git-to-sync-your-fork-with-the-upstream-repository).)_
170+
171+
e. Search for the branch that you just created, e.g.
172+
`git branch -a | grep 16.0.2-hotfix-release` f. Track that branch with
173+
`git checkout --track branch_name` (e.g.
174+
`remotes/upstream/16.0.2-hotfix-release`)
175+
176+
1. Update the CI tests so that the branch tests against the appropriate Dart
177+
SDKs:
178+
179+
a. Make the appropriate changes to DWDS' `mono_pkg.yaml` then run
180+
`mono_repo generate`. Submit this change to the branch you created in step
181+
#3, **not** `master`.
182+
183+
1. Make the fix:
184+
185+
a. You can now make the change you would like to hotfix. From the Github UI,
186+
open a PR to merge your change into the branch you created in step #3,
187+
**not** `master`. See https://github.com/dart-lang/webdev/pull/1867 as an
188+
example.
189+
190+
1. Once it's merged, you can follow the instructions to
191+
[publish DWDS to pub](#step-2-publish-dwds-to-pub), except instead of pulling
192+
from `master`, pull from the branch your created in step #3.
193+
194+
1. If necessary, open a cherry-pick request in Flutter to update the version.
195+
See https://github.com/flutter/flutter/issues/118122 for an example.

0 commit comments

Comments
 (0)