Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
278 changes: 0 additions & 278 deletions skills/github-project/references/dependency-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,6 @@ Dependabot and Renovate configuration patterns, auto-merge workflows, and troubl

## Dependabot

### Basic Configuration
```yaml
# .github/dependabot.yml
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "06:00"
timezone: "Europe/Berlin"
```

### Package Ecosystems

| Ecosystem | Languages/Tools |
|-----------|-----------------|
| gomod | Go modules |
| npm | JavaScript/Node.js |
| composer | PHP |
| pip | Python |
| cargo | Rust |
| maven | Java |
| gradle | Java/Kotlin |
| nuget | .NET |
| bundler | Ruby |
| docker | Dockerfiles |
| github-actions | GitHub Actions |
| terraform | Terraform |

### Ecosystem Hygiene — Only Declare What the Repo Actually Has

Dependabot's update job runs on the ecosystems configured, whether or not the manifest files exist. Some ecosystems **hard-fail** when their manifest is missing; others silently no-op. Declaring ecosystems that don't apply turns main red on every scheduled Dependabot run, for no benefit:
Expand Down Expand Up @@ -122,121 +91,8 @@ updates:
dependency-type: "development"
```

### Commit Message Prefixes
```yaml
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "weekly"
commit-message:
prefix: "deps"
prefix-development: "deps(dev)"
include: "scope"
labels:
- "dependencies"
```

### Multiple Ecosystems
```yaml
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "weekly"
groups:
dependencies:
patterns:
- "*"
commit-message:
prefix: "deps"
labels:
- "dependencies"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
groups:
github-actions:
patterns:
- "*"
commit-message:
prefix: "ci"
labels:
- "dependencies"
- "github-actions"

- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "weekly"
commit-message:
prefix: "docker"
labels:
- "dependencies"
- "docker"
```

### Ignoring Dependencies
```yaml
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
ignore:
- dependency-name: "lodash"
versions: [">=5.0.0"]
- dependency-name: "react"
update-types: ["version-update:semver-major"]
```

### Reviewers and Assignees
```yaml
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "weekly"
reviewers:
- "username"
- "org/team-name"
assignees:
- "username"
```

## Renovate

### Basic Configuration
```json
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended"
]
}
```

### Extended Configuration
```json
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended",
":semanticCommits",
":semanticCommitTypeAll(chore)",
"group:allNonMajor"
],
"labels": ["dependencies"],
"prHourlyLimit": 2,
"prConcurrentLimit": 5,
"timezone": "Europe/Berlin",
"schedule": ["before 7am on monday"]
}
```

### Auto-merge Configuration (Recommended)

**IMPORTANT:** Use `platformAutomerge: true` to leverage Renovate's bypass permissions:
Expand All @@ -262,93 +118,6 @@ updates:
| `platformAutomerge` | `true` | Use GitHub's auto-merge (Renovate enables it) |
| `automerge` | `true` | Enable auto-merge for matching packages |

### Lock File Maintenance

Use Renovate for lock file updates instead of CI workflows that push directly to main:

```json
{
"lockFileMaintenance": {
"enabled": true,
"schedule": ["before 6am on monday"]
}
}
```

**Why:** CI workflows cannot push to protected branches. Renovate creates PRs that go through normal review/merge process.

### Grouping Rules
```json
{
"extends": ["config:recommended"],
"packageRules": [
{
"matchPackagePatterns": ["^@types/"],
"groupName": "TypeScript types"
},
{
"matchPackagePatterns": ["eslint"],
"groupName": "ESLint"
},
{
"matchPackagePatterns": ["^react"],
"groupName": "React"
}
]
}
```

### Security Updates
```json
{
"extends": [
"config:recommended",
":enableVulnerabilityAlerts"
],
"vulnerabilityAlerts": {
"labels": ["security"],
"automerge": true
}
}
```

### PHP/Composer Configuration
```json
{
"extends": ["config:recommended"],
"composer": {
"enabled": true
},
"packageRules": [
{
"matchPackagePatterns": ["^typo3/"],
"groupName": "TYPO3"
},
{
"matchPackagePatterns": ["^phpstan/", "^phpunit/"],
"groupName": "PHP dev tools"
}
]
}
```

### Go Configuration
```json
{
"extends": ["config:recommended"],
"gomod": {
"enabled": true
},
"packageRules": [
{
"matchManagers": ["gomod"],
"matchUpdateTypes": ["minor", "patch"],
"automerge": true
}
]
}
```

## Auto-merge Workflow

### Auto-merge Decision Matrix
Expand Down Expand Up @@ -740,50 +509,3 @@ PRs modifying workflow files require manual merge by a repository admin.
```

The lockfile `name` then stays stable regardless of which worktree folder you run `npm install` in. This bites specifically in git worktree workflows; a plain clone (dir == repo name) masks it.

## Comparison: Dependabot vs Renovate

| Feature | Dependabot | Renovate |
|---------|------------|----------|
| Hosting | GitHub native | Self-hosted or app |
| Configuration | YAML | JSON/JSON5 |
| Grouping | Basic | Advanced |
| Auto-merge | Via workflow | Native `platformAutomerge` |
| Bypass permissions | Via `GITHUB_TOKEN` | Direct (when in bypass list) |
| Lock file maintenance | Manual | Built-in |
| Custom managers | Limited | Regex support |
| Dashboard | Basic | Dependency Dashboard |
| Presets | Limited | Extensive |
| Update types | All | Granular control |
| Rebase on demand | `@dependabot rebase` | `@renovate rebase` |

### When to Use Dependabot
- GitHub-only projects
- Simple dependency management
- Native GitHub integration preferred
- Limited configuration needs

### When to Use Renovate
- Complex grouping requirements
- Multiple repositories
- Advanced auto-merge rules (use `platformAutomerge`)
- Custom package managers
- Dependency Dashboard needed
- Cross-platform support
- Need bypass permissions for auto-merge

## Best Practices

1. **Use Renovate's `platformAutomerge`**: For bypass permissions to work correctly
2. **Avoid `require_code_owner_reviews`**: With dependency auto-merge
3. **Match check names exactly**: In branch protection rules
4. **Use lock file maintenance**: Instead of CI pushing to main
5. **Group related updates**: Reduce PR noise
6. **Use semantic commit prefixes**: Better changelogs
7. **Enable auto-merge for safe updates**: minor/patch/pin/digest
8. **Require CI checks**: Before auto-merge
9. **Review major updates manually**: Breaking changes
10. **Schedule updates**: Off-peak hours
11. **Label PRs**: Easy filtering
12. **Limit concurrent PRs**: Avoid CI overload
13. **Add `workflow_dispatch`**: For manual workflow triggers
Loading
Loading