Skip to content

Commit 723e32a

Browse files
captainsafiadougbu
andauthored
Update documentation on darc (#24487)
* Update documentation on darc * Apply suggestions from code review Co-authored-by: Doug Bunting <[email protected]> * Update code blocks in referenced assemblies Co-authored-by: Doug Bunting <[email protected]>
1 parent 6f7a3df commit 723e32a

File tree

1 file changed

+61
-13
lines changed

1 file changed

+61
-13
lines changed

docs/ReferenceResolution.md

Lines changed: 61 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -100,16 +100,64 @@ is changing to `Microsoft.AspNetCore.BetterThanOrange`, you would need to make t
100100
</ItemGroup>
101101
```
102102

103-
## Updating dependencies manually
104-
105-
If the `dotnet-maestro` bot has not correctly updated the dependencies, it may be worthwhile running `darc` manually:
106-
107-
1. Install `darc` as described in <https://github.com/dotnet/arcade/blob/master/Documentation/Darc.md#setting-up-your-darc-client>
108-
2. Run `darc update-dependencies --channel '.NET Core 3.1 Release'`
109-
* Use `'trigger-subscriptions'` to prod the bot to create a PR if you do not want to make local changes
110-
* Use `'.NET 3 Eng''` to update dependencies from dotnet/arcade
111-
* Use `'.NET Eng - Latest'` to update dependencies from dotnet/arcade in the `master` branch
112-
* Use `'VS Master'` to update dependencies from dotnet/roslyn in the `master` branch
113-
* Use `'.NET 5 Dev'` to update dependencies from dotnet/efcore or dotnet/runtime in the `master` branch
114-
3. `git diff` to confirm the tool's changes
115-
4. Proceed with usual commit and PR
103+
## A darc cheatsheet
104+
105+
`darc` is a command-line tool that is used for dependency management in the dotnet ecosystem of repos. `darc` can be installed using the `darc-init` scripts located inside the `eng/common` directory. Once `darc` is installed, you'll need to set up the appropriate access tokens as outlined [in the official Darc docs](https://github.com/dotnet/arcade/blob/master/Documentation/Darc.md#setting-up-your-darc-client).
106+
107+
Once `darc` is installed and set-up, it can be used to modify the subscriptions and dependencies in a project.
108+
109+
**Getting the list of subscriptions in a repo**
110+
111+
Subscriptions are objects that define the ecosystem repos we are listening for updates to, the frequency we are looking for updates, and more.
112+
113+
```bash
114+
darc get-subscriptions --target-branch master --target-repo aspnetcore$ --regex
115+
```
116+
117+
**Disable/enable a subscription**
118+
119+
```bash
120+
darc subscription-status --id {subscriptionIdHere} --enable
121+
darc subscription-status --id {subscriptionIdHere} --disable
122+
```
123+
124+
**Trigger a subscription**
125+
126+
Triggering a subscription will search for updates in its dependencies and open a PR in the target repo via the dotnet-maestro bot with these changes.
127+
128+
```bash
129+
darc trigger-subscriptions --id {subscriptionIdHere}
130+
```
131+
132+
**Manually update dependencies**
133+
134+
If the `dotnet-maestro` bot has not correctly updated the dependencies, `darc update-dependencies` may be used to update the dependencies manually. Note, you'll need to run the commands below in a separate branch and submit a PR with the changes. These are the things that the bot should do for you if you use `trigger-subscriptions` or automatically (when the subscription fires e.g. about 15 minutes after a dependency's build completes if `Update Frequency: EveryBuild`).
135+
136+
```bash
137+
darc update-dependencies --channel '.NET Core 3.1 Release'
138+
darc update-dependencies --channel '.NET 5 Dev' --source-repo efcore
139+
```
140+
141+
Generally, using `trigger-subscriptions` is preferred for creating dependency updates instead of manually updating dependencies in your own PR.
142+
143+
**Toggling batchability of subscription**
144+
145+
Subscriptions can be batched. When a dependency update is detected, `darc` will bundle the commits for that update with existing dependency PRs. To toggle whether a subscription is batched or not, you will need to use the `update-subscription` command.
146+
147+
```bash
148+
darc update-subscription --id {subscriptionIdHere}
149+
```
150+
151+
Your shell's default editor will open and allow you to edit the metadata of the subscription.
152+
153+
To disable batching, set `Batchable` to `False` and update the `Merge Policies` section with the following YAML.
154+
155+
```
156+
- Name: Standard
157+
Properties: {}
158+
```
159+
160+
To enable batching, set `Batchable` to `True` and remove any `Merge Policies` set on the subscription.
161+
162+
Note: Merge policies can only be set on unbatched subscriptions. Be sure to set/unset the `Merge Policies` field properly as you toggle batchability.
163+

0 commit comments

Comments
 (0)