Skip to content

Commit

Permalink
chore: run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
secustor committed Feb 24, 2025
1 parent 98cd0d9 commit 2d564a3
Show file tree
Hide file tree
Showing 10 changed files with 66 additions and 110 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Install pnpm
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0

- name: Setup Node.js
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
with:
Expand Down
30 changes: 18 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,34 @@
# backstage-renovate-config

Holds Renovate presets targeted at Backstage repos

> [!NOTE]
> Be aware that this requires significant trust in the owner of this repository as it always the case for external Renovate presets!
This is as it can introduce changes without your input in case you are not requiring approval for PRs or allow merging changes in without PRs.
YOU HAVE BEEN WARNED!
> This is as it can introduce changes without your input in case you are not requiring approval for PRs or allow merging changes in without PRs.
> YOU HAVE BEEN WARNED!
## Usage

This repository contains a set of Renovate presets that can be used to configure Renovate for Backstage repositories.

To use these presets, you need to add a `renovate.json` file to your repository that looks like this:

```json
{
"extends": [
"github>secustor/backstage-renovate-config"
]
"extends": ["github>secustor/backstage-renovate-config"]
}
```

The above config will use the `default` preset.

If you want to use different presets, you can specify them like this:

```json
{
"extends": [
"github>secustor/backstage-renovate-config:self-hosted.json5"
]
"extends": ["github>secustor/backstage-renovate-config:self-hosted.json5"]
}
```

The above config will use the `self-hosted` preset.

For more information on how to configure Renovate presets, see the [Renovate documentation](https://docs.renovatebot.com/config-presets/)
Expand All @@ -53,19 +55,23 @@ This means that [`allowedPostUpgradeCommands`](https://docs.renovatebot.com/self
## Feature presets

### Unsupported Framework Upgrades

Prevent upgrades to frameworks that are not supported by Backstage.

### Group by plugin
Groups all PRs based on the plugin. Therefore, all updates of the `catalog` are grouped together including `catalog`, `catalog-backend` and so on.

Groups all PRs based on the plugin. Therefore, all updates of the `catalog` are grouped together including `catalog`, `catalog-backend` and so on.

### Exclude ESM updates
Backstage does not support ESM at the moment. This means updates which are ESM-only will break the setup.
This rule prevents updates to known ESM-only packages.

Backstage does not support ESM at the moment. This means updates which are ESM-only will break the setup.
This rule prevents updates to known ESM-only packages.

### Update `backstage.json`

This rule will update the `backstage.json` file in the repository to the latest Backstage release.
It is used by full config presets, but can also be used standalone.

## Contributing
If you want to propose a new preset or modify an existing one, you can open a PR with the changes.

If you want to propose a new preset or modify an existing one, you can open a PR with the changes.
10 changes: 5 additions & 5 deletions app.json5
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
extends: [
"github>secustor/backstage-renovate-config//presets/no-esm",
"github>secustor/backstage-renovate-config//presets/unsupported-framework-upgrades",
"github>secustor/backstage-renovate-config//presets/update-backstage-json"
"github>secustor/backstage-renovate-config//presets/update-backstage-json",
],

// create a single PR to update all in range upgrades, to save CI minutes
Expand All @@ -12,7 +12,7 @@
},
postUpdateOptions: [
// run `yarn dedupe --strategy highest` after every npm package upgrade
'yarnDedupeHighest',
"yarnDedupeHighest",
],

packageRules: [
Expand All @@ -21,7 +21,7 @@
// update Backstage packages immediately, this is to prevent to update backstage.json only but not the packages
minimumReleaseAge: null,
// group all Backstage packages together
groupName: "Backstage Core"
}
groupName: "Backstage Core",
},
],
}
}
6 changes: 2 additions & 4 deletions default.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"github>secustor/backstage-renovate-config:app.json5"
]
}
"extends": ["github>secustor/backstage-renovate-config:app.json5"]
}
2 changes: 1 addition & 1 deletion presets/group-by-plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
"groupName": "Backstage plugin {{ lookup (split packageName '-') 1 }}"
}
]
}
}
82 changes: 20 additions & 62 deletions presets/no-esm.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,17 @@
{
"packageRules": [
{
"matchDatasources": [
"npm"
],
"matchPackageNames": [
"node-fetch"
],
"matchDatasources": ["npm"],
"matchPackageNames": ["node-fetch"],
"allowedVersions": "<3.0.0"
},
{
"matchDatasources": [
"npm"
],
"matchPackageNames": [
"nanoid",
"octokit",
"p-limit"
],
"matchDatasources": ["npm"],
"matchPackageNames": ["nanoid", "octokit", "p-limit"],
"allowedVersions": "<4.0.0"
},
{
"matchDatasources": [
"npm"
],
"matchDatasources": ["npm"],
"matchPackageNames": [
"@octokit/webhooks-methods",
"@sindresorhus/is",
Expand All @@ -34,69 +22,39 @@
"allowedVersions": "<5.0.0"
},
{
"matchDatasources": [
"npm"
],
"matchPackageNames": [
"find-up"
],
"matchDatasources": ["npm"],
"matchPackageNames": ["find-up"],
"allowedVersions": "<6.0.0"
},
{
"matchDatasources": [
"npm"
],
"matchPackageNames": [
"@octokit/auth-app",
"@octokit/oauth-app"
],
"matchDatasources": ["npm"],
"matchPackageNames": ["@octokit/auth-app", "@octokit/oauth-app"],
"allowedVersions": "<7.0.0"
},
{
"matchDatasources": [
"npm"
],
"matchPackageNames": [
"@octokit/graphql"
],
"matchDatasources": ["npm"],
"matchPackageNames": ["@octokit/graphql"],
"allowedVersions": "<8.0.0"
},
{
"matchDatasources": [
"npm"
],
"matchPackageNames": [
"@octokit/plugin-throttling",
"@octokit/request"
],
"matchDatasources": ["npm"],
"matchPackageNames": ["@octokit/plugin-throttling", "@octokit/request"],
"allowedVersions": "<9.0.0"
},
{
"matchDatasources": [
"npm"
],
"matchPackageNames": [
"@octokit/graphql-schema"
],
"matchDatasources": ["npm"],
"matchPackageNames": ["@octokit/graphql-schema"],
"allowedVersions": "<15.0.0"
},
{
"matchDatasources": [
"npm"
],
"matchPackageNames": [
"@octokit/webhooks"
],
"matchDatasources": ["npm"],
"matchPackageNames": ["@octokit/webhooks"],
"allowedVersions": "<13.0.0"
},
{
"matchDatasources": [
"npm"
],
"matchPackageNames": [
"@octokit/rest"
],
"matchDatasources": ["npm"],
"matchPackageNames": ["@octokit/rest"],
"allowedVersions": "<21.0.0"
}
]
}
}
14 changes: 4 additions & 10 deletions presets/unsupported-framework-upgrades.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
"Do not upgrade to Express v5",
"https://github.com/backstage/backstage/issues/27808"
],
"matchDatasources": [
"npm"
],
"matchDatasources": ["npm"],
"matchPackageNames": [
"express",
"@types/express",
Expand All @@ -21,20 +19,16 @@
"Do not upgrade to React 19",
"https://github.com/backstage/backstage/issues/28080"
],
"extends": [
"packages:react"
],
"extends": ["packages:react"],
"allowedVersions": "<19.0.0"
},
{
"description": [
"Do not upgrade to React Router v7",
"https://github.com/backstage/backstage/issues/27927"
],
"matchSourceUrls": [
"https://github.com/remix-run/react-router"
],
"matchSourceUrls": ["https://github.com/remix-run/react-router"],
"allowedVersions": "<7.0.0"
}
]
}
}
2 changes: 1 addition & 1 deletion presets/update-backstage-json.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
"versioningTemplate": "semver-coerced"
}
]
}
}
4 changes: 1 addition & 3 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended"
]
"extends": ["config:recommended"]
}
22 changes: 12 additions & 10 deletions self-hosted.json5
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
extends: [
"github>secustor/backstage-renovate-config//presets/no-esm",
"github>secustor/backstage-renovate-config//presets/unsupported-framework-upgrades",
"github>secustor/backstage-renovate-config//presets/update-backstage-json"
"github>secustor/backstage-renovate-config//presets/update-backstage-json",
],

// create a single PR to update all in range upgrades, to save CI minutes
Expand All @@ -13,23 +13,25 @@

postUpdateOptions: [
// run `yarn dedupe --strategy highest` after every npm package upgrade
'yarnDedupeHighest',
"yarnDedupeHighest",
],

packageRules: [
{
// disable updating NPM packages of Backstage Core as these are updated by Backstage CLI
matchDatasources: ["npm"],
matchSourceUrls: ["https://github.com/backstage/backstage"],
enabled: false
enabled: false,
},
{
// run backstage upgrade command if there is a new Backstage release
matchPackageNames: ["backstage/backstage"],
"postUpgradeTasks": {
"commands": ["yarn backstage-cli versions:bump --pattern '@{backstage}/*' --release {{{newVersion}}}"],
"executionMode": "branch"
}
}
postUpgradeTasks: {
commands: [
"yarn backstage-cli versions:bump --pattern '@{backstage}/*' --release {{{newVersion}}}",
],
executionMode: "branch",
},
},
],
}
}

0 comments on commit 2d564a3

Please sign in to comment.