Skip to content

Commit 3b1d76a

Browse files
committed
Update dependency configuration and documentation.
1 parent b395a89 commit 3b1d76a

3 files changed

Lines changed: 111 additions & 1 deletion

File tree

.notes/justin/worklogs/2025-0-17-dependency-greenkeeping-strategy.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,22 @@ The `renovate.json` configuration has been updated to address these findings:
3232
1. The conflicting exclusion for `@cloudflare/workers-types` has been removed.
3333
2. `separateMajorMinor: false` has been added to the root of the configuration to keep major updates within their defined groups.
3434
3. A new "catch-all" rule has been added to the end of the `packageRules` array. This rule will group all previously unmatched dependencies into a single weekly "repository-maintenance" PR.
35+
36+
### Step 13: Implementing Dashboard-Driven Fixes
37+
38+
The initial run of the Renovate App with the corrected pointer syntax revealed several issues with our grouping rules. The Dependency Dashboard provided all the necessary information to diagnose and fix them.
39+
40+
**Findings:**
41+
42+
1. **Incorrect Grouping**: A single, overly broad "catch-all" rule was grouping all dependencies into a single `repository-maintenance` PR, overriding all other specific rules.
43+
2. **Deprecated Filename**: A warning indicated that when a configuration is used as a preset (as ours is via the pointer), it should be named `default.json`, not `renovate.json`.
44+
3. **Missing "Infrastructure" Group**: Several dependencies related to repository infrastructure (e.g., GitHub Actions, Docker) were not explicitly grouped.
45+
46+
**Actions:**
47+
48+
1. **Renamed Config File**: `renovate.json` has been renamed to `default.json` to align with Renovate's preset conventions and resolve the warning.
49+
2. **Refined Grouping Rules**: The `default.json` file has been significantly updated. The overly broad catch-all rule was removed and replaced with several explicit rules to correctly group dependencies from the `sdk`, `starters`, `docs`, and root `package.json` files.
50+
3. **Added Infrastructure Group**: A new `infrastructure-dependencies` group was created to handle updates for GitHub Actions, Dockerfiles, and the repository's Node.js version.
51+
4. **Updated Documentation**: The `CONTRIBUTING.md` file has been updated with a section explaining how to use the Dependency Dashboard to monitor and manually trigger updates.
52+
53+
With these changes, the configuration should now be correct and robust. The next run of Renovate should produce the correctly grouped PRs as originally intended.

CONTRIBUTING.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,4 +360,25 @@ The release workflow and underlying script (`sdk/sdk/scripts/release.sh`) follow
360360
* Smoke tests are then run for this same test project, validating that the installed tarball is working correctly
361361
5. **Publish**: Only if all smoke tests and verification checks pass, the script publishes the `.tgz` tarball to npm. This guarantees the exact package that was tested is the one that gets published.
362362
6. **Finalize Commit**: For non-prerelease versions, the script updates dependencies in the monorepo, amends the version commit with these changes, tags the commit, and pushes everything to the remote repository.
363-
7. **Rollback**: If any step fails, the script reverts the version commit and cleans up all temporary files, leaving the repository in a clean state.
363+
7. **Rollback**: If any step fails, the script reverts the version commit and cleans up all temporary files, leaving the repository in a clean state.
364+
365+
* **A Note on Mocking**: The term "dependency" is used in two ways. This document primarily concerns package management (e.g., `npm` packages). For guidance on writing testable code by avoiding mocks in favor of dependency injection, please see the "Dependency Injection over Mocking" section.
366+
367+
### Using the Dependency Dashboard
368+
369+
After a new dependency update is available, Renovate will create a Pull Request. For managing all available updates, Renovate also creates a special issue in the repository titled "Dependency Dashboard". You can find this in the "Issues" tab.
370+
371+
This dashboard is the central place to manage the greenkeeping process. It provides:
372+
* A list of all new dependency versions that have been discovered.
373+
* The status of current open Pull Requests for dependency updates.
374+
* A list of updates that are waiting for their scheduled time to run.
375+
376+
#### Manually Triggering Updates
377+
378+
Our configuration schedules most updates to run weekly to reduce noise. However, you can trigger any scheduled update immediately from the dashboard.
379+
380+
To do this, find the update group you wish to run in the "Awaiting Schedule" section of the dashboard and click the checkbox next to it. Renovate will detect this change and create the corresponding Pull Request within a few minutes. This is particularly useful for forcing a one-time update of all dependencies to establish a new baseline or to test a specific update, such as the `starter-peer-dependencies` group.
381+
382+
### Failure Protocol for Peer Dependencies
383+
384+
If a peer dependency update in a starter project fails the CI smoke tests, it signifies a potential regression. The failure could be due to one of two causes:

default.json

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": ["config:recommended"],
4+
"separateMajorMinor": false,
5+
"packageRules": [
6+
{
7+
"description": "Group Cloudflare dependencies together as they are often released in tandem.",
8+
"matchPackageNames": ["/^@cloudflare\\//", "wrangler"],
9+
"groupName": "cloudflare"
10+
},
11+
{
12+
"description": "Group React-related packages together.",
13+
"matchPackageNames": ["/^react/", "/^@types\\/react/"],
14+
"groupName": "react"
15+
},
16+
{
17+
"description": "Group infrastructure dependencies (Actions, Docker, Node.js, pnpm).",
18+
"matchManagers": ["github-actions", "dockerfile", "nodenv"],
19+
"groupName": "infrastructure-dependencies",
20+
"schedule": ["on saturday"]
21+
},
22+
{
23+
"description": "Group pnpm version from root package.json with other infra deps",
24+
"matchFileNames": ["package.json"],
25+
"matchPackageNames": ["pnpm"],
26+
"groupName": "infrastructure-dependencies",
27+
"schedule": ["on saturday"]
28+
},
29+
{
30+
"description": "Group all SDK internal dependencies into a single weekly PR.",
31+
"matchFileNames": ["sdk/package.json"],
32+
"groupName": "sdk-internal-dependencies",
33+
"schedule": ["on saturday"]
34+
},
35+
{
36+
"description": "Group all starter application dependencies into a single weekly PR.",
37+
"matchFileNames": ["starters/**/package.json"],
38+
"excludePackageNames": ["@cloudflare/vite-plugin", "wrangler", "vite"],
39+
"groupName": "starter-app-dependencies",
40+
"schedule": ["on saturday"]
41+
},
42+
{
43+
"description": "Update peer dependencies in starter projects as soon as they are available.",
44+
"matchFileNames": ["starters/**/package.json"],
45+
"matchPackageNames": ["@cloudflare/vite-plugin", "wrangler", "vite"],
46+
"groupName": "starter-peer-dependencies",
47+
"schedule": ["every weekend"],
48+
"prPriority": 1
49+
},
50+
{
51+
"description": "Group dependencies for the docs site.",
52+
"matchFileNames": ["docs/package.json"],
53+
"groupName": "docs-dependencies",
54+
"schedule": ["on saturday"]
55+
},
56+
{
57+
"description": "Group dependencies from the root package.json.",
58+
"matchFileNames": ["package.json"],
59+
"excludePackageNames": ["pnpm"],
60+
"groupName": "root-dependencies",
61+
"schedule": ["on saturday"]
62+
}
63+
],
64+
"prHeader": " chore(deps): {{{prTitle}}}",
65+
"prBodyNotes": "This PR updates the following dependencies:\n\n{{{table}}}",
66+
"automerge": false,
67+
"major": { "automerge": false },
68+
"minor": { "automerge": false },
69+
"patch": { "automerge": false }
70+
}

0 commit comments

Comments
 (0)