Skip to content

Commit 9a81185

Browse files
nateboschCommit Queue
authored andcommitted
Start section on external packages in monorepos
Having multiple packages in a single repository can add some challenges. Start a section with docs on these situations and include the first section on working around blocked SDK package rolls. Change-Id: Ia008436047cb8cd83e3df7ef66c373b728b40721 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/421544 Commit-Queue: Nate Bosch <[email protected]> Reviewed-by: Devon Carew <[email protected]>
1 parent 8eba93e commit 9a81185

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

docs/External-Package-Maintenance.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,38 @@ at a time and then the old behavior can be removed once everything is migrated.
121121
"Conversation" view.
122122
- The [gh cli tool](https://cli.github.com/) makes it easy to checkout a PR
123123
in cases where a change may be easier to understand in an IDE.
124+
125+
# Working with Monorepos
126+
127+
## Syncing an individual package update to the SDK
128+
129+
Typical package rolls into the Dart SDK are atomic for all packages in a mono
130+
repo. If some change in the history of the main branch for the repository is
131+
blocking the roll and a required fix was committed after the roll became blocked
132+
there are extra steps to roll only specific changes to the SDK.
133+
134+
The goal is to have a commit with the contents that need to be synced to the
135+
SDK, and put _exactly_ that commit in the history of the main branch.
136+
137+
- Create a branch from a commit which is known safe to roll to the SDK, this
138+
may be the same commit which is currently rolled, or a forward roll of other
139+
changes expected to be safe that are earlier than the known breakage.
140+
`git checkout -b <branch name> <SHA>`.
141+
- Cherry pick any required fixes for the package that needs the update.
142+
Typically this should not involve merge conflicts, but if they occur resolve
143+
them in favor of the version that should be synced to the SDK. Do not make
144+
any commits that are not cherry picks. Picking a base commit close to the
145+
breaking commit reduces risk of conflicts from the commits in between.
146+
- Open a PR to merge this branch into the main branch but _do not submit it_.
147+
Run CI like normal on this PR.
148+
- After a passing CI run sync with an admin for the repo to get help with
149+
merging. In most repositories this will require a change to the settings.
150+
Do _not_ use a rebase or squash merge. Ask a repo admin to create a _merge_
151+
commit, either by temporarily enabling PR merging, or by creating the commit
152+
on the CLI and pushing. The merge should not have conflicts and should not
153+
be pushed if it did.
154+
- Wait for the repository mirror to update and update DEPS to reference the
155+
SHA of the commit from the PR.
156+
157+
If there is any confusion, reach out to an admin for the repo early and they
158+
will be able to help.

0 commit comments

Comments
 (0)