Skip to content

ISSUE-368: Renovate Drupal presets #831

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 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
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,25 @@ upstream dependencies e.g. https://github.com/go-task/task/releases

---

## Renovate Presets

If you are using [Renovate](https://docs.renovatebot.com/) (for automated dependency updates) you can use/extend our Drupal presets by doing the following:

```
{
"extends": [
"github>Lullabot/drainpipe//renovate-presets/presets/drupal-10.json5"
]
}
```

This preset offers safe automation with flexibility and control for teams maintaining Drupal applications.
It minimizes risk by requiring approval for major changes, speeds up security patches through automerging minor updates, and organizes updates for easier review and management.

The `renovate-updates` branch is a dedicated branch where Renovate creates all its update pull requests instead of directly targeting the main development branch (like `main` or `develop`). This setup helps keep automated dependency updates isolated from the main codebase, making it safer and easier for teams to review, test, and merge updates without risking unintended changes to production or active development. It also provides a controlled environment where update PRs can be grouped, rebased, and tested before being manually promoted to the primary branches.

---

## Database Updates

The `drupal:update` command follows the same procedure as the
Expand Down
94 changes: 94 additions & 0 deletions renovate-presets/drupal-10.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not have a version specific one since we're doing the bare minimum configuration for Drupal best practices that we'll push up to Renovate defaults.

"$schema": "https://docs.renovatebot.com/renovate-schema.json",
// The `renovate-updates` branch is a dedicated branch for Renovate's update
// pull requests. This setup isolates automated updates from the main
// codebase, ensuring safer and easier review. For more details, refer to the
//"Renovate Presets" section in the README.md.
"baseBranches": ["renovate-updates"],

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Consider adding a description of what this branch is used for, as well as a link to the documentation for it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@deviantintegral were you expecting our preset to live in Drainpipe or was there a registry we could submit it to so more people were aware of it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had been thinking we'd contribute a Drupal preset upstream to Renovate itself.

https://github.com/renovatebot/renovate/blob/main/docs/development/creating-editing-renovate-presets.md

I don't think we should set "baseBranches": ["renovate-updates"], by default, as that's a project level decision. It also doesn't play well with automerging dev dependencies, or automerging in general.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@beto-aveiga Next step is to commit a very basic version of this to Renovate that only addresses things that ship with Drupal core. Evaluate what is in "group:symfony" as an example of how we should structure the Drupal specific preset.

Avoid setting automerge. We may want to do that on our projects, but we shouldn't impose that on other projects using Drainpipe.

"extends": [
":automergeDisabled",
":renovatePrefix",
":timezone(America/New_York)",
"config:base",
"group:symfony",
"schedule:automergeWeekends"
],
"labels": ["renovate"],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessary because you can filter pull requests by authors and Renovate will always be the author by default.

"packageRules": [
{
"matchManagers": ["composer"],
"enabled": true
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not need to declare these because it won't pick up other package managers like npm with this being set.

{
"matchPackagePatterns": "^.*",
"matchCurrentValue": "!/^\\^.*/",
"dependencyDashboardApproval": true,
"addLabels": ["pinned-package"]
},
{
"matchUpdateTypes": ["major"],
"automerge": false,
"addLabels": ["major"]
},
{
"matchUpdateTypes": ["patch", "minor"],
"matchCurrentVersion": "!/^0/",
"automerge": true,
"addLabels": ["patch/minor"]
},
{
"matchUpdateTypes": ["major"],
"matchPackagePatterns": ["^drupal/core-.*"],
"matchPackageNames": ["drupal/core"],
"groupName": "Drupal Core Major",
"automerge": false,
"addLabels": ["drupal-core"]
},
{
"matchUpdateTypes": ["patch", "minor"],
"matchPackagePatterns": ["^drupal/core-.*"],
"matchPackageNames": ["drupal/core"],
"groupName": "Drupal Core",
"automerge": true,
"addLabels": ["drupal-core"]
},
{
"matchPackagePrefixes": ["jquery"],
"groupName": "jQuery packages",
"addLabels": ["jquery"]
},
{
"groupName": "Location modules",
"matchPackagePrefixes": ["drupal/geo"],
"matchManagers": ["composer"]
},
{
"groupName": "Drupal Migrate",
"addLabels": [
"drupal-migrate"
],
"matchPackageNames": [
"/^drupal/migrate-.*/"
]
},
{
"groupName": "Metatag modules",
"matchPackageNames": [
"drupal/metatag",
"drupal/schema_metatag"
]
},

{
"groupName": "File media",
"matchPackageNames": [
"drupal/file_mdm",
"drupal/imagemagick"
]
},
],
"platform": "github",
"prConcurrentLimit": 3,
"rangeStrategy": "bump",
"rebaseWhen": "auto"
}
Loading