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 1 commit
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
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,20 @@ 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"
]
}
```

---

## Database Updates

The `drupal:update` command follows the same procedure as the
Expand Down Expand Up @@ -815,3 +829,4 @@ To generate new NPM package releases:
2. Run `yarn install && yarn lerna publish`
3. Create a pull request with the changes
4. Once merged, locally switch to the main branch and run `yarn lerna exec -- npm publish`

90 changes: 90 additions & 0 deletions renovate-presets/drupal-10.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
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",
"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