diff --git a/docs/development/adding-a-package-manager.md b/docs/development/adding-a-package-manager.md index 6c70ba8e00fe60..5d3fefbfc49775 100644 --- a/docs/development/adding-a-package-manager.md +++ b/docs/development/adding-a-package-manager.md @@ -1,6 +1,6 @@ # Adding a Package Manager -This document explains how to add a new language/package manager. +This document explains how to add a new package manager. ## Code structure @@ -21,7 +21,7 @@ The manager's `index.ts` file supports the following values or functions: | `extractPackageFile` | | yes | | `extractAllPackageFiles` | yes | yes | | `getRangeStrategy` | yes | | -| `language` | yes | | +| `categories` | yes | | | `supportsLockFileMaintenance` | yes | | | `updateArtifacts` | yes | yes | | `updateDependency` | yes | | @@ -80,10 +80,6 @@ The `npm` manager uses the `getRangeStrategy` function to pin `devDependencies` If left undefined, then a default `getRangeStrategy` will be used that always returns "replace". -### `language` (optional) - -This is used when more than one package manager shares settings from a common language. - ### `supportsLockFileMaintenance` (optional) Set to `true` if this package manager needs to update lock files in addition to package files. diff --git a/docs/development/creating-editing-renovate-presets.md b/docs/development/creating-editing-renovate-presets.md index 2e7c5468a9c609..1d4e59ad8f87bf 100644 --- a/docs/development/creating-editing-renovate-presets.md +++ b/docs/development/creating-editing-renovate-presets.md @@ -27,7 +27,7 @@ We have multiple kinds of `group:` presets, with different rules. ##### Rules for `group:*` presets 1. Finally, any other `group:*` presets can be added if they are beneficial to a wide number of users -1. They don't need to be added to `group:recommended`, meaning that users will "opt in" to them one by one and not get them automatically from `config:base`, which includes `group:monorepo` and `group:recommended` +1. They don't need to be added to `group:recommended`, meaning that users will "opt in" to them one by one and not get them automatically from `config:recommended`, which includes `group:monorepo` and `group:recommended` #### Replacement presets diff --git a/docs/usage/config-presets.md b/docs/usage/config-presets.md index 0afcd775de8299..7322f498100153 100644 --- a/docs/usage/config-presets.md +++ b/docs/usage/config-presets.md @@ -101,7 +101,7 @@ You can set a Git tag (like a SemVer) to use a specific release of your shared c An example of a small rule is `:preserveSemverRanges`, which has the description "Preserve (but continue to upgrade) any existing SemVer ranges.". It simply sets the configuration option `rangeStrategy` to `replace`. -An example of a full config is `config:base`, which is Renovate's default configuration. +An example of a full config is `config:recommended`, which is Renovate's default configuration. It mostly uses Renovate config defaults but adds a few smart customizations such as grouping monorepo packages together. @@ -111,8 +111,8 @@ It mostly uses Renovate config defaults but adds a few smart customizations such ## How to Use Preset Configs -By default, Renovate App's onboarding PR suggests the `["config:base]"` preset. -If you're self hosting, and want to use the `config:base` preset, then you must add `"onboardingConfig": { "extends": ["config:base"] }` to your bot's config. +By default, Renovate App's onboarding PR suggests the `["config:recommended]"` preset. +If you're self hosting, and want to use the `config:recommended` preset, then you must add `"onboardingConfig": { "extends": ["config:recommended"] }` to your bot's config. Read the [Full Config Presets](https://docs.renovatebot.com/presets-config/) page to learn more about our `config:` presets. @@ -120,18 +120,18 @@ A typical onboarding `renovate.json` looks like this: ```json { - "extends": ["config:base"] + "extends": ["config:recommended"] } ``` Here's an example of using presets to change Renovate's behavior. -You're happy with the `config:base` preset, but want Renovate to create PRs when you're not at the office. +You're happy with the `config:recommended` preset, but want Renovate to create PRs when you're not at the office. You look at our `schedule:` presets, and find the `schedule:nonOfficeHours` preset. You put `schedule:nonOfficeHours` in the `extends` array of your `renovate.json` file, like this: ```json { - "extends": ["config:base", "schedule:nonOfficeHours"] + "extends": ["config:recommended", "schedule:nonOfficeHours"] } ``` @@ -256,7 +256,7 @@ For example: "version": "0.0.1", "renovate-config": { "default": { - "extends": ["config:base", "schedule:nonOfficeHours"] + "extends": ["config:recommended", "schedule:nonOfficeHours"] } } } diff --git a/docs/usage/configuration-options.md b/docs/usage/configuration-options.md index 2a5f8152aee86c..18d9aa4cfcc51e 100644 --- a/docs/usage/configuration-options.md +++ b/docs/usage/configuration-options.md @@ -320,7 +320,7 @@ Configuring this to `true` means that Renovate will detect and apply the default ## branchConcurrentLimit By default, Renovate won't enforce any concurrent branch limits. -The `config:base` preset that many extend from limits the number of concurrent branches to 10, but in many cases a limit as low as 3 or 5 can be most efficient for a repository. +The `config:recommended` preset that many extend from limits the number of concurrent branches to 10, but in many cases a limit as low as 3 or 5 can be most efficient for a repository. If you want the same limit for both concurrent branches and concurrent PRs, then set a value for `prConcurrentLimit` and it will be re-used for branch calculations too. But if you want to allow more concurrent branches than concurrent PRs, you can configure both values (e.g. `branchConcurrentLimit=5` and `prConcurrentLimit=3`). @@ -602,11 +602,37 @@ Renovate supports two options: - `none`: No release filtering (all releases allowed) - `strict`: If the release's constraints match the package file constraints, then it's included -We are working on adding more advanced filtering options. +More advanced filtering options may come in future. -Note: There must be a `constraints` object in your Renovate config for this to work. +There must be a `constraints` object in your Renovate config, or constraints detected from package files, for this to work. This feature is limited to `packagist`, `npm`, and `pypi` datasources. + +!!! warning + Enabling this feature may result in many package updates being filtered out silently. + See below for a description of how it works. + +When `constraintsFiltering=strict`, the following logic applies: + +- Are there `constraints` for this repository, either detected from source or from config? +- Does this package's release declare constraints of its own (e.g. `engines` in Node.js)? +- If so, filter out this release unless the repository constraint is a _subset_ of the release constraint + +Here are some examples: + +| Your repo engines.node | Dependency release engines.node | Result | +| ------------------------ | ------------------------------- | -------- | +| `18` | `16 \|\| 18` | allowed | +| `^18.10.0` | `>=18` | allowed | +| `^16.10.0 \|\| >=18.0.0` | `>= 16.0.0` | allowed | +| `>=16` | `16 \|\| 18` | filtered | +| `16` | `^16.10.0` | filtered | + +When using with `npm`, we recommend you: + +- Use `constraintsFiltering` on `dependencies`, not `devDependencies` (usually you do not need to be strict about development dependencies) +- Do _not_ enable `rollbackPrs` at the same time (otherwise your _current_ version may be rolled back if it's incompatible) + ## defaultRegistryUrls Override a datasource's default registries with this config option. @@ -622,13 +648,13 @@ Compare that to `registryUrls`, which are a way to _override_ registries. ## dependencyDashboard -Starting from version `v26.0.0` the "Dependency Dashboard" is enabled by default as part of the commonly-used `config:base` preset. +Starting from version `v26.0.0` the "Dependency Dashboard" is enabled by default as part of the commonly-used `config:recommended` preset. To disable the Dependency Dashboard, add the preset `:disableDependencyDashboard` or set `dependencyDashboard` to `false`. ```json { - "extends": ["config:base", ":disableDependencyDashboard"] + "extends": ["config:recommended", ":disableDependencyDashboard"] } ``` @@ -737,24 +763,6 @@ Descriptions fields embedded within presets are also collated as part of the onb Add to this object if you wish to define rules that apply only to PRs that update digests. -## docker - -Add config here if you wish it to apply to Docker package managers Dockerfile and Docker Compose. -If instead you mean to apply settings to any package manager that updates using the Docker _datasource_, use a package rule instead, e.g. - -```json -{ - "packageRules": [ - { - "matchDatasources": ["docker"], - "labels": ["docker-update"] - } - ] -} -``` - -## dotnet - ## draftPR If you want the PRs created by Renovate to be considered as drafts rather than normal PRs, you could add this property to your `renovate.json`: @@ -931,7 +939,14 @@ A similar one could strip leading `v` prefixes: ## fetchReleaseNotes -Set this to `false` if you want to disable release notes fetching. +Use this config option to configure release notes fetching. +The available options are: + +- `off` - disable release notes fetching +- `branch` - fetch release notes while creating/updating branch +- `pr`(default) - fetches release notes while creating/updating pull-request + +It is not recommended to set fetchReleaseNotes=branch unless you are embedding release notes in commit information, because it results in a performance decrease. Renovate can fetch release notes when they are hosted on one of these platforms: @@ -1099,16 +1114,6 @@ If you need to modify this path, for example in order to ignore directories, you } ``` -## golang - -Configuration added here applies for all Go-related updates. -The only supported package manager for Go is the native Go Modules (the `gomod` manager). - -For self-hosted users, `GOPROXY`, `GONOPROXY`, `GOPRIVATE` and `GOINSECURE` environment variables are supported ([reference](https://go.dev/ref/mod#module-proxy)). - -Usage of `direct` will fallback to the Renovate-native release fetching mechanism. -Also we support the `off` keyword which will stop any fetching immediately. - ## group The default configuration for groups are essentially internal to Renovate and you normally shouldn't need to modify them. @@ -1541,7 +1546,7 @@ For instance if you have a project with an `"examples/"` directory you wish to i ``` Renovate's default ignore is `node_modules` and `bower_components` only. -If you are extending from the popular `config:base` preset then it adds ignore patterns for `vendor`, `examples`, `test(s)` and `fixtures` directories too. +If you are extending from the popular `config:recommended` preset then it adds ignore patterns for `vendor`, `examples`, `test(s)` and `fixtures` directories too. ## ignorePlugins @@ -1562,12 +1567,12 @@ For example, consider this config: ```json { - "extends": ["config:base"], + "extends": ["config:recommended"], "ignorePresets": [":prHourlyLimit2"] } ``` -It would take the entire `"config:base"` preset - which has a lot of sub-presets - but ignore the `":prHourlyLimit2"` rule. +It would take the entire `"config:recommended"` preset - which has a lot of sub-presets - but ignore the `":prHourlyLimit2"` rule. ## ignoreReviewers @@ -1631,14 +1636,6 @@ Currently this applies to the `minimumReleaseAge` check only. The `flexible` mode can result in "flapping" of Pull Requests, for example: a pending PR with version `1.0.3` is first released but then downgraded to `1.0.2` once it passes `minimumReleaseAge`. We recommend that you use the `strict` mode, and enable the `dependencyDashboard` so that you can see suppressed PRs. -## java - -Use this configuration option for shared config across all Java projects (Gradle and Maven). - -## js - -Use this configuration option for shared config across npm/Yarn/pnpm and meteor package managers. - ## labels By default, Renovate won't add any labels to PRs. @@ -1777,12 +1774,6 @@ This works because Renovate will add a "renovate/stability-days" pending status Add to this object if you wish to define rules that apply only to minor updates. -## node - -Using this configuration option allows you to apply common configuration and policies across all Node.js version updates even if managed by different package managers (`npm`, `yarn`, etc.). - -Check out our [Node.js documentation](https://docs.renovatebot.com/node) for a comprehensive explanation of how the `node` option can be used. - ## npmToken See [Private npm module support](./getting-started/private-packages.md) for details on how this is used. @@ -1872,28 +1863,28 @@ Example: The above rule will group together the `neutrino` package and any package matching `@neutrino/*`. -Path rules are convenient to use if you wish to apply configuration rules to certain package files using patterns. +File name matches are convenient to use if you wish to apply configuration rules to certain package or lock files using patterns. For example, if you have an `examples` directory and you want all updates to those examples to use the `chore` prefix instead of `fix`, then you could add this configuration: ```json { "packageRules": [ { - "matchPaths": ["examples/**"], + "matchFileNames": ["examples/**"], "extends": [":semanticCommitTypeAll(chore)"] } ] } ``` -If you wish to limit Renovate to apply configuration rules to certain files in the root repository directory, you have to use `matchPaths` with a `minimatch` pattern or use [`matchFiles`](#matchfiles) with an exact match. +If you wish to limit Renovate to apply configuration rules to certain files in the root repository directory, you have to use `matchFileNames` with a `minimatch` pattern (which can include an exact file name match). For example you have multiple `package.json` and want to use `dependencyDashboardApproval` only on the root `package.json`: ```json { "packageRules": [ { - "matchFiles": ["package.json"], + "matchFileNames": ["package.json"], "dependencyDashboardApproval": true } ] @@ -2022,17 +2013,23 @@ See also `matchPackagePrefixes`. The above will match all package names starting with `eslint` but exclude ones starting with `eslint-foo`. -### matchLanguages +### matchCategories -Use this field to restrict rules to a particular language. e.g. +Use `matchCategories` to restrict rules to a particular language or group. +Matching is done using "any" logic, i.e. "match any of the following categories". +The categories can be found in the [manager documentation](./modules/manager/index.md). + + +!!! note + Rules with `matchCategories` are only applied _after_ extraction of dependencies. + If you want to configure which managers are being extracted at all, use `enabledManagers` instead. ```json { "packageRules": [ { - "matchPackageNames": ["request"], - "matchLanguages": ["python"], - "enabled": false + "matchCategories": ["python"], + "addLabels": ["py"] } ] } @@ -2188,23 +2185,50 @@ Use the syntax `!/ /` like this: } ``` -### matchFiles +### matchFileNames + +Renovate will compare `matchFileNames` glob matching against the dependency's package file or lock file. + +The following example matches `package.json` but _not_ `package/frontend/package.json`: -Renovate will compare `matchFiles` for an exact match against the dependency's package file or lock file. +```json +{ + "packageRules": [ + { + "matchFileNames": ["package.json"], + "labels": ["npm"] + } + ] +} +``` -For example the following would match `package.json` but not `package/frontend/package.json`: +The following example matches any `package.json`, including files like `backend/package.json`: ```json { "packageRules": [ { - "matchFiles": ["package.json"] + "description": "Group dependencies from package.json files", + "matchFileNames": ["**/package.json"], + "groupName": "All package.json changes" } ] } ``` -Use [`matchPaths`](#matchpaths) instead if you need more flexible matching. +The following example matches any file in directories starting with `app/`: + +```json +{ + "packageRules": [ + { + "description": "Group all dependencies from the app directory", + "matchFileNames": ["app/**"], + "groupName": "App dependencies" + } + ] +} +``` ### matchDepNames @@ -2264,43 +2288,6 @@ See also `excludePackagePrefixes`. Like the earlier `matchPackagePatterns` example, the above will configure `rangeStrategy` to `replace` for any package starting with `angular`. -### matchPaths - -Renovate finds the file(s) listed in `matchPaths` with a `minimatch` glob pattern. - -For example the following matches any `package.json`, including files like `backend/package.json`: - -```json -{ - "packageRules": [ - { - "description": "Group dependencies from package.json files", - "matchPaths": ["**/package.json"], - "groupName": "All package.json changes" - } - ] -} -``` - -The following matches any file in directories starting with `app/`: - -```json -{ - "packageRules": [ - { - "description": "Group all dependencies from the app directory", - "matchPaths": ["app/**"], - "groupName": "App dependencies" - } - ] -} -``` - - -!!! warning - Partial matches for `matchPaths` are deprecated. - Please use a `minimatch` glob pattern or switch to [`matchFiles`](#matchfiles) if you need exact matching. - ### matchSourceUrlPrefixes Here's an example of where you use this to group together all packages from the `renovatebot` GitHub org: @@ -2505,8 +2492,6 @@ For example to replace the npm package `jade` with version `2.0.0` of the packag Add to this object if you wish to define rules that apply only to patch updates. -## php - ## pin Add to this object if you wish to define rules that apply only to PRs that pin dependencies. @@ -2522,28 +2507,28 @@ If enabled Renovate will pin Docker images or GitHub Actions by means of their S ## platformAutomerge -!!! warning - Before you enable `platformAutomerge` you should enable your Git hosting platform's capabilities to enforce test passing before PR merge. +!!! note + If you use the default `platformAutomerge=true` then you should enable your Git hosting platform's capabilities to enforce test passing before PR merge. If you don't do this, the platform might merge Renovate PRs even if the repository's tests haven't started, are in still in progress, or possibly even when they have failed. On GitHub this is called "Require status checks before merging", which you can find in the "Branch protection rules" section of the settings for your repository. [GitHub docs, about protected branches](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/about-protected-branches) [GitHub docs, require status checks before merging](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/about-protected-branches#require-status-checks-before-merging) If you're using another platform, search their documentation for a similar feature. -If you have enabled `automerge` and set `automergeType=pr` in the Renovate config, then you can also set `platformAutomerge` to `true` to speed up merging via the platform's native automerge functionality. +If you have enabled `automerge` and set `automergeType=pr` in the Renovate config, then leaving `platformAutomerge` as `true` speeds up merging via the platform's native automerge functionality. Renovate tries platform-native automerge only when it initially creates the PR. Any PR that is being updated will be automerged with the Renovate-based automerge. `platformAutomerge` will configure PRs to be merged after all (if any) branch policies have been met. -This option is available for Azure, GitHub and GitLab. +This option is available for Azure, Gitea, GitHub and GitLab. It falls back to Renovate-based automerge if the platform-native automerge is not available. You can also fine-tune the behavior by setting `packageRules` if you want to use it selectively (e.g. per-package). Note that the outcome of `rebaseWhen=auto` can differ when `platformAutomerge=true`. Normally when you set `rebaseWhen=auto` Renovate rebases any branch that's behind the base branch automatically, and some people rely on that. -This behavior is no longer guaranteed when you enable `platformAutomerge` because the platform might automerge a branch which is not up-to-date. +This behavior is no longer guaranteed when `platformAutomerge` is `true` because the platform might automerge a branch which is not up-to-date. For example, GitHub might automerge a Renovate branch even if it's behind the base branch at the time. Please check platform specific docs for version requirements. @@ -2606,7 +2591,7 @@ The `postUpgradeTasks` configuration consists of three fields: A list of commands that are executed after Renovate has updated a dependency but before the commit is made. -You can use variable templating in your commands if [`allowPostUpgradeCommandTemplating`](./self-hosted-configuration.md#allowpostupgradecommandtemplating) is enabled. +You can use variable templating in your commands as long as [`allowPostUpgradeCommandTemplating`](./self-hosted-configuration.md#allowpostupgradecommandtemplating) is enabled. !!! note @@ -2615,6 +2600,10 @@ You can use variable templating in your commands if [`allowPostUpgradeCommandTem ### fileFilters A list of glob-style matchers that determine which files will be included in the final commit made by Renovate. +Dotfiles are included. + +Optional field which defaults to any non-ignored file in the repo (`**/*` glob pattern). +Specify a custom value for this if you wish to exclude certain files which are modified by your `postUpgradeTasks` and you don't want committed. ### executionMode @@ -2840,10 +2829,6 @@ Set `pruneBranchAfterAutomerge` to `false` to keep the branch after automerging. Configure to `false` to disable deleting orphan branches and autoclosing PRs. Defaults to `true`. -## python - -Currently the only Python package manager is `pip` - specifically for `requirements.txt` and `requirements.pip` files, or any file that matches the pattern `requirements-*.(txt|pip)` - so adding any config to this `python` object is essentially the same as adding it to the `pip_requirements` object instead. - ## rangeStrategy Behavior: @@ -3287,13 +3272,8 @@ There are times when a dependency version in use by a project gets removed from For some registries, existing releases or even whole packages can be removed or "yanked" at any time, while for some registries only very new or unused releases can be removed. Renovate's "rollback" feature exists to propose a downgrade to the next-highest release if the current release is no longer found in the registry. -Renovate does not create these rollback PRs by default, with one exception: npm packages get a rollback PR if needed. - -You can configure the `rollbackPrs` property globally, per-language, or per-package to override the default behavior. - -## ruby - -## rust +Renovate does not create these rollback PRs by default, so this functionality needs to be opted-into. +We recommend you do this selectively with `packageRules` and not globally. ## schedule diff --git a/docs/usage/docker.md b/docs/usage/docker.md index 665a0088ffe7cf..6428eaa91cc7f7 100644 --- a/docs/usage/docker.md +++ b/docs/usage/docker.md @@ -185,7 +185,7 @@ Add all paths to ignore into the `ignorePaths` configuration field. e.g. ```json { - "extends": ["config:base"], + "extends": ["config:recommended"], "ignorePaths": ["docker/old-files/"] } ``` diff --git a/docs/usage/examples/self-hosting.md b/docs/usage/examples/self-hosting.md index 93c32c663cc48e..8d52d603baa2bf 100644 --- a/docs/usage/examples/self-hosting.md +++ b/docs/usage/examples/self-hosting.md @@ -248,7 +248,7 @@ module.exports = { token: '**gitlab_token**', platform: 'gitlab', onboardingConfig: { - extends: ['config:base'], + extends: ['config:recommended'], }, repositories: ['username/repo', 'orgname/repo'], }; diff --git a/docs/usage/getting-started/installing-onboarding.md b/docs/usage/getting-started/installing-onboarding.md index 5aa5c0d3d7e4d2..1cfcb77976747f 100644 --- a/docs/usage/getting-started/installing-onboarding.md +++ b/docs/usage/getting-started/installing-onboarding.md @@ -108,7 +108,7 @@ Sometimes Renovate detects that an override to these defaults is needed, and wil Please check the docs on this website for an exhaustive Configuration Reference. To help you get started, here are some of the most commonly changed (overridden) configuration settings: -- **rangeStrategy**: By default (with zero config) it's `"replace"` but the `"config:base"` preset overrides it to `"auto"`. Some prefer `"bump"`. +- **rangeStrategy**: By default (with zero config) it's `"replace"` but the `"config:recommended"` preset overrides it to `"auto"`. Some prefer `"bump"`. - **labels**: Labels to assign to Pull Requests - **assignees**: GitHub user(s) to assign the Pull Requests to diff --git a/docs/usage/getting-started/use-cases.md b/docs/usage/getting-started/use-cases.md index b2e48f4e4347ad..095d72521d0007 100644 --- a/docs/usage/getting-started/use-cases.md +++ b/docs/usage/getting-started/use-cases.md @@ -213,7 +213,7 @@ This also means that you might want a similar config for all of your repositorie You can use configuration "presets" to avoid duplicating your configuration across your repositories. Configuration presets are JSON configuration files which are committed to repositories and then referenced from others. -Renovate includes over 100 built-in presets, like the default recommended `config:base` preset. +Renovate includes over 100 built-in presets, like the default recommended `config:recommended` preset. The typical workflow for a company is: diff --git a/docs/usage/golang.md b/docs/usage/golang.md index 64535f9499aaf1..d9edec8e713b8f 100644 --- a/docs/usage/golang.md +++ b/docs/usage/golang.md @@ -7,6 +7,15 @@ description: Go modules support in Renovate Renovate supports upgrading dependencies in `go.mod` files and their accompanying `go.sum` checksums. +If you're self-hosting Renovate, you may use these environment variables: + +- `GOPROXY` +- `GONOPROXY` +- `GOPRIVATE` +- `GOINSECURE` + +To learn what these variables do, read the [Go Modules Reference about the`GOPROXY` protocol](https://go.dev/ref/mod#module-proxy). + ## How It Works 1. Renovate searches in each repository for any `go.mod` files diff --git a/docs/usage/java.md b/docs/usage/java.md index 405df5c50cedb1..6f3b4624aff914 100644 --- a/docs/usage/java.md +++ b/docs/usage/java.md @@ -10,14 +10,14 @@ This includes libraries and plugins as well as the Gradle Wrapper. ## LTS releases -The `config:base` preset includes the `workarounds:javaLTSVersions` preset. +The `config:recommended` preset includes the `workarounds:javaLTSVersions` preset. The workaround limits Renovate to upgrade to LTS versions of the Java runtime only. If you want Renovate to offer all `major` Java updates then add `workarounds:javaLTSVersions` to the `ignorePreset` array: ```json { - "extends": ["config:base"], + "extends": ["config:recommended"], "ignorePresets": ["workarounds:javaLTSVersions"] } ``` diff --git a/docs/usage/key-concepts/automerge.md b/docs/usage/key-concepts/automerge.md index 579ebc8a9bc948..d4203845fb680c 100644 --- a/docs/usage/key-concepts/automerge.md +++ b/docs/usage/key-concepts/automerge.md @@ -100,9 +100,8 @@ Say you want to automerge `patch` and `minor` updates for packages in the `group ### Faster merges with platform-native automerge -You can speed up merges by letting Renovate use your platform's native automerge. -The config option is called `platformAutomerge`. -If `automerge=true` and `automergeType=pr` then you can set `platformAutomerge=true`. +By default, Renovate uses platform-native automerge to speed up automerging. +If you don't want Renovate to use the platform-native automerge, then set `platformAutomerge` to `false`. For example: @@ -112,7 +111,7 @@ For example: "enabled": true, "automerge": true, "automergeType": "pr", - "platformAutomerge": true + "platformAutomerge": false } } ``` @@ -155,11 +154,10 @@ On `github.com`, go to your repository's "homepage", click on Settings, scroll d Then go to your repository's branch protection rules for your base branch (usually `main`) and enable the "Require merge queue" setting. Confirm you've set the correct "required checks" for your base branch. -Finally, allow Renovate to automerge by setting `automerge=true` and `platformAutomerge=true` in your Renovate config file, for example: +Finally, allow Renovate to automerge by setting `automerge=true` in your Renovate config file, for example: ```json { - "platformAutomerge": true, "packageRules": [ { "description": "Automerge non-major updates", @@ -180,7 +178,7 @@ On `github.com`, go to your repository's "homepage", click on Settings, scroll d Go to your repository's branch protection rules for your base branch (usually `main`) and enable the "Require merge queue" setting. Confirm you've set the correct "required checks" for your base branch. -Finally, allow Renovate to automerge by setting `automerge=true` and `platformAutomerge=true` in your Renovate config file (see earlier example). +Finally, allow Renovate to automerge by setting `automerge=true` in your Renovate config file (see earlier example). ## Automerging and scheduling diff --git a/docs/usage/key-concepts/dashboard.md b/docs/usage/key-concepts/dashboard.md index 2e9ff58cb87677..a564d63dc9f41f 100644 --- a/docs/usage/key-concepts/dashboard.md +++ b/docs/usage/key-concepts/dashboard.md @@ -23,7 +23,7 @@ To turn on the Dashboard manually, add the `:dependencyDashboard` preset to your ```json { - "extends": ["config:base", ":dependencyDashboard"] + "extends": ["config:recommended", ":dependencyDashboard"] } ``` @@ -41,7 +41,7 @@ To disable the Dependency Dashboard, add the preset `:disableDependencyDashboard ```json { - "extends": ["config:base", ":disableDependencyDashboard"] + "extends": ["config:recommended", ":disableDependencyDashboard"] } ``` @@ -86,7 +86,7 @@ To require manual approval for _all updates_, add the `:dependencyDashboardAppro ```json { - "extends": ["config:base", ":dependencyDashboardApproval"] + "extends": ["config:recommended", ":dependencyDashboardApproval"] } ``` diff --git a/docs/usage/key-concepts/presets.md b/docs/usage/key-concepts/presets.md index d9906d7f120639..8efa6357948020 100644 --- a/docs/usage/key-concepts/presets.md +++ b/docs/usage/key-concepts/presets.md @@ -18,17 +18,17 @@ Use presets to: ## How to use presets -Let's say you're using the `config:base` preset, and want to pin your GitHub Action digests. +Let's say you're using the `config:recommended` preset, and want to pin your GitHub Action digests. Instead of writing your own Renovate config, you search through Renovate's built-in presets. You find the the `helpers:pinGitHubActionDigests` preset and add it to the `extends` array: ```json { - "extends": ["config:base", "helpers:pinGitHubActionDigests"] + "extends": ["config:recommended", "helpers:pinGitHubActionDigests"] } ``` -Renovate now follows the rules for `config:base` plus the rules for `helpers:pinGitHubActionDigests`. +Renovate now follows the rules for `config:recommended` plus the rules for `helpers:pinGitHubActionDigests`. If there is a logical conflict between presets, then the last preset in the array wins. ## Managing config for many repositories diff --git a/docs/usage/modules/manager/index.md b/docs/usage/modules/manager/index.md index d6051b6c54eb2d..dbf5a0aadac4c3 100644 --- a/docs/usage/modules/manager/index.md +++ b/docs/usage/modules/manager/index.md @@ -52,7 +52,7 @@ Renovate will _extend_ the existing [`fileMatch`](/configuration-options/#filema In other words, the regular expression are "additive". If a manager matches a file that you _don't_ want it to, ignore it using the [`ignorePaths`](/configuration-options/#ignorepaths) configuration option. Also, if you ever find that Renovate is _not_ matching a file name that you're certain it should, check your preset config isn't the cause of it. -The `config:base` preset ignores common test and example directory names, for example. +The `config:recommended` preset ignores common test and example directory names, for example. ### Enabling and disabling managers diff --git a/docs/usage/reading-list.md b/docs/usage/reading-list.md index a862d5655e13b5..76ad793ead61b4 100644 --- a/docs/usage/reading-list.md +++ b/docs/usage/reading-list.md @@ -22,8 +22,8 @@ If you're self-hosting or need to update private packages, complete the relevant If you're new to Renovate, you should: - Use the Mend-hosted GitHub App, or let somebody else host Renovate for you -- Stick with the `config:base` preset -- Use the Dependency Dashboard (`config:base` enables it automatically) +- Stick with the `config:recommended` preset +- Use the Dependency Dashboard (`config:recommended` enables it automatically) - Read the pages in the "Beginners" list - Only create custom Renovate configuration when really needed diff --git a/docs/usage/self-hosted-configuration.md b/docs/usage/self-hosted-configuration.md index efbf6a1e5f1d9d..f090e9fcf3dbf4 100644 --- a/docs/usage/self-hosted-configuration.md +++ b/docs/usage/self-hosted-configuration.md @@ -19,15 +19,10 @@ Please also see [Self-Hosted Experimental Options](./self-hosted-experimental.md ## allowPostUpgradeCommandTemplating -Set to `true` to allow templating of dependency level post-upgrade commands. - Let's look at an example of configuring packages with existing Angular migrations. -Add two properties to `config.js`: `allowPostUpgradeCommandTemplating` and `allowedPostUpgradeCommands`: - ```javascript module.exports = { - allowPostUpgradeCommandTemplating: true, allowedPostUpgradeCommands: ['^npm ci --ignore-scripts$', '^npx ng update'], }; ``` @@ -45,8 +40,7 @@ The command to install dependencies (`npm ci --ignore-scripts`) is needed becaus "commands": [ "npm ci --ignore-scripts", "npx ng update {{{depName}}} --from={{{currentVersion}}} --to={{{newVersion}}} --migrate-only --allow-dirty --force" - ], - "fileFilters": ["**/**"] + ] } } ] @@ -60,6 +54,9 @@ npm ci --ignore-scripts npx ng update @angular/core --from=10.0.0 --to=11.0.0 --migrate-only --allow-dirty --force ``` +If you wish to disable templating because of any security or performance concern, you may set `allowPostUpgradeCommandTemplating` to `false`. +But before you disable templating completely, try the `allowedPostUpgradeCommands` config option to limit what commands are allowed to run. + ## allowScripts ## allowedPostUpgradeCommands @@ -314,17 +311,17 @@ For example, `{"dockerCliOptions": "--memory=4g"}` will add a CLI flag to the `d Read the [Docker Docs, configure runtime resource contraints](https://docs.docker.com/config/containers/resource_constraints/) to learn more. -## dockerImagePrefix +## dockerSidecarImage -By default Renovate pulls the sidecar Docker containers from `docker.io/containerbase`. -You can use the `dockerImagePrefix` option to override this default. +By default Renovate pulls the sidecar Docker containers from `ghcr.io/containerbase/sidecar`. +You can use the `dockerSidecarImage` option to override this default. -Say you want to pull your images from `ghcr.io/containerbase` to bypass Docker Hub limits. +Say you want to pull a custom image from `ghcr.io/your_company/sidecar`. You would put this in your configuration file: ```json { - "dockerImagePrefix": "ghcr.io/containerbase" + "dockerSidecarImage": "ghcr.io/your_company/sidecar" } ``` diff --git a/docs/usage/self-hosted-experimental.md b/docs/usage/self-hosted-experimental.md index 47fd66b1cfd0be..010813cb665080 100644 --- a/docs/usage/self-hosted-experimental.md +++ b/docs/usage/self-hosted-experimental.md @@ -78,15 +78,6 @@ You can set the config file Renovate should read with the `RENOVATE_CONFIG_FILE` The process that runs Renovate must have the correct permissions to delete the config file. -## `RENOVATE_X_MATCH_PACKAGE_NAMES_MORE` - -If set, you'll get the following behavior. - -When using `matchPackageNames` and `matchPackagePatterns` matchers: - -1. Renovate first tries to match against `depName` -2. If `depName` doesn't match then Renovate tries to match against `packageName` - ## `RENOVATE_X_MERGE_CONFIDENCE_API_BASE_URL` If set, Renovate will query this API for Merge Confidence data. diff --git a/docs/usage/semantic-commits.md b/docs/usage/semantic-commits.md index 5ba0f2e1f4f0e5..6d1d2e86ad7c24 100644 --- a/docs/usage/semantic-commits.md +++ b/docs/usage/semantic-commits.md @@ -16,7 +16,7 @@ When Renovate finds Angular-style commits, Renovate creates commit messages and By default, Renovate uses the `chore` prefix. -If you extend from `config:base` then Renovate: +If you extend from `config:recommended` then Renovate: - still defaults to the `chore` prefix - uses the `fix` prefix for npm production dependencies diff --git a/lib/config/__snapshots__/migration.spec.ts.snap b/lib/config/__snapshots__/migration.spec.ts.snap index 572cc3bbdb1787..c4df79d9deb94f 100644 --- a/lib/config/__snapshots__/migration.spec.ts.snap +++ b/lib/config/__snapshots__/migration.spec.ts.snap @@ -164,7 +164,7 @@ exports[`config/migration migrateConfig(config, parentConfig) migrates config 1` "extends": [ "node", ], - "matchPaths": [ + "matchFileNames": [ "node/**", ], }, @@ -211,7 +211,7 @@ exports[`config/migration migrateConfig(config, parentConfig) migrates config 1` "extends": [ "foo", ], - "matchPaths": [ + "matchFileNames": [ "examples/**", ], }, @@ -293,7 +293,7 @@ exports[`config/migration migrateConfig(config, parentConfig) migrates more pack "matchDepTypes": [ "devDependencies", ], - "matchPaths": [ + "matchFileNames": [ "package.json", ], "rangeStrategy": "pin", @@ -302,7 +302,7 @@ exports[`config/migration migrateConfig(config, parentConfig) migrates more pack "matchDepTypes": [ "dependencies", ], - "matchPaths": [ + "matchFileNames": [ "package.json", ], "rangeStrategy": "pin", @@ -332,13 +332,13 @@ exports[`config/migration migrateConfig(config, parentConfig) migrates packageFi ], "packageRules": [ { - "matchPaths": [ + "matchFileNames": [ "backend/package.json", ], "rangeStrategy": "replace", }, { - "matchPaths": [ + "matchFileNames": [ "frontend/package.json", ], "rangeStrategy": "pin", @@ -347,7 +347,7 @@ exports[`config/migration migrateConfig(config, parentConfig) migrates packageFi "matchDepTypes": [ "devDependencies", ], - "matchPaths": [ + "matchFileNames": [ "other/package.json", ], "rangeStrategy": "pin", @@ -356,7 +356,7 @@ exports[`config/migration migrateConfig(config, parentConfig) migrates packageFi "matchDepTypes": [ "dependencies", ], - "matchPaths": [ + "matchFileNames": [ "other/package.json", ], "rangeStrategy": "pin", diff --git a/lib/config/__snapshots__/validation.spec.ts.snap b/lib/config/__snapshots__/validation.spec.ts.snap index fd32097b86fbe2..41f8bd38992650 100644 --- a/lib/config/__snapshots__/validation.spec.ts.snap +++ b/lib/config/__snapshots__/validation.spec.ts.snap @@ -167,14 +167,10 @@ exports[`config/validation validateConfig(config) errors if invalid combinations ] `; -exports[`config/validation validateConfig(config) errors if language or manager objects are nested 1`] = ` +exports[`config/validation validateConfig(config) errors if manager objects are nested 1`] = ` [ { - "message": "The "docker" object can only be configured at the top level of a config but was found inside "major.minor"", - "topic": "Configuration Error", - }, - { - "message": "The "gradle" object can only be configured at the top level of a config but was found inside "java"", + "message": "The "gradle" object can only be configured at the top level of a config but was found inside "maven"", "topic": "Configuration Error", }, ] @@ -233,11 +229,11 @@ exports[`config/validation validateConfig(config) returns nested errors 1`] = ` exports[`config/validation validateConfig(config) selectors outside packageRules array trigger errors 1`] = ` [ { - "message": "docker.minor.matchDepNames: matchDepNames should be inside a \`packageRule\` only", + "message": "ansible.minor.matchDepNames: matchDepNames should be inside a \`packageRule\` only", "topic": "Configuration Error", }, { - "message": "docker.minor.matchPackageNames: matchPackageNames should be inside a \`packageRule\` only", + "message": "ansible.minor.matchPackageNames: matchPackageNames should be inside a \`packageRule\` only", "topic": "Configuration Error", }, { diff --git a/lib/config/global.ts b/lib/config/global.ts index fca000190956f2..7c6149d2a6e8a1 100644 --- a/lib/config/global.ts +++ b/lib/config/global.ts @@ -15,7 +15,7 @@ export class GlobalConfig { 'customEnvVariables', 'dockerChildPrefix', 'dockerCliOptions', - 'dockerImagePrefix', + 'dockerSidecarImage', 'dockerUser', 'dryRun', 'exposeAllEnv', diff --git a/lib/config/index.spec.ts b/lib/config/index.spec.ts index 001ea8c8b53488..94e6822cf72dfc 100644 --- a/lib/config/index.spec.ts +++ b/lib/config/index.spec.ts @@ -91,7 +91,6 @@ describe('config/index', () => { const config = getManagerConfig(parentConfig, 'npm'); expect(config).toContainEntries([ ['fileMatch', ['(^|/)package\\.json$']], - ['rollbackPrs', true], ]); expect(getManagerConfig(parentConfig, 'html')).toContainEntries([ ['fileMatch', ['\\.html?$']], diff --git a/lib/config/index.ts b/lib/config/index.ts index 886b0a688842fa..e612edc7de6fd4 100644 --- a/lib/config/index.ts +++ b/lib/config/index.ts @@ -1,5 +1,5 @@ import { logger } from '../logger'; -import { get, getLanguageList, getManagerList } from '../modules/manager'; +import { get, getManagerList } from '../modules/manager'; import * as options from './options'; import type { AllConfig, @@ -17,18 +17,15 @@ export function getManagerConfig( ): ManagerConfig { let managerConfig: ManagerConfig = { ...config, - language: null, manager, }; - const language = get(manager, 'language'); - if (language) { - // TODO: fix types #7154 - managerConfig = mergeChildConfig(managerConfig, config[language] as any); - managerConfig.language = language; + const categories = get(manager, 'categories'); + if (categories) { + managerConfig.categories = categories; } // TODO: fix types #7154 managerConfig = mergeChildConfig(managerConfig, config[manager] as any); - for (const i of getLanguageList().concat(getManagerList())) { + for (const i of getManagerList()) { delete managerConfig[i]; } return managerConfig; diff --git a/lib/config/migration.spec.ts b/lib/config/migration.spec.ts index fcb40a6609d2d6..02efcb1ce6b321 100644 --- a/lib/config/migration.spec.ts +++ b/lib/config/migration.spec.ts @@ -564,17 +564,45 @@ describe('config/migration', () => { matchBaseBranches: ['master'], matchDatasources: ['orb'], matchDepTypes: ['peerDependencies'], - matchLanguages: ['python'], + matchCategories: ['python'], matchManagers: ['dockerfile'], matchPackageNames: ['foo'], matchPackagePatterns: ['^bar'], - matchPaths: ['package.json'], + matchFileNames: ['package.json'], matchSourceUrlPrefixes: ['https://github.com/lodash'], matchUpdateTypes: ['major'], }, ], }); }); + + it('migrates in order of precedence', () => { + const config: TestRenovateConfig = { + packageRules: [ + { + matchFiles: ['matchFiles'], + matchPaths: ['matchPaths'], + }, + { + matchPaths: ['matchPaths'], + matchFiles: ['matchFiles'], + }, + ], + }; + const { isMigrated, migratedConfig } = + configMigration.migrateConfig(config); + expect(isMigrated).toBeTrue(); + expect(migratedConfig).toEqual({ + packageRules: [ + { + matchFileNames: ['matchPaths'], + }, + { + matchFileNames: ['matchFiles'], + }, + ], + }); + }); }); it('it migrates nested packageRules', () => { diff --git a/lib/config/migrations/custom/automerge-major-migration.spec.ts b/lib/config/migrations/custom/automerge-major-migration.spec.ts index 0d2a9a7d30ba60..9dd5ebd21c87d0 100644 --- a/lib/config/migrations/custom/automerge-major-migration.spec.ts +++ b/lib/config/migrations/custom/automerge-major-migration.spec.ts @@ -19,13 +19,13 @@ describe('config/migrations/custom/automerge-major-migration', () => { { automergeMajor: 'some-value', major: { - matchFiles: ['test'], + matchFileNames: ['test'], }, }, { major: { automerge: true, - matchFiles: ['test'], + matchFileNames: ['test'], }, } ); diff --git a/lib/config/migrations/custom/automerge-minor-migration.spec.ts b/lib/config/migrations/custom/automerge-minor-migration.spec.ts index 9597466a7b3682..5ce417773f84c6 100644 --- a/lib/config/migrations/custom/automerge-minor-migration.spec.ts +++ b/lib/config/migrations/custom/automerge-minor-migration.spec.ts @@ -19,13 +19,13 @@ describe('config/migrations/custom/automerge-minor-migration', () => { { automergeMinor: 'some-value', minor: { - matchFiles: ['test'], + matchFileNames: ['test'], }, }, { minor: { automerge: true, - matchFiles: ['test'], + matchFileNames: ['test'], }, } ); diff --git a/lib/config/migrations/custom/automerge-patch-migration.spec.ts b/lib/config/migrations/custom/automerge-patch-migration.spec.ts index bc7014fa541f61..124f599fe921b3 100644 --- a/lib/config/migrations/custom/automerge-patch-migration.spec.ts +++ b/lib/config/migrations/custom/automerge-patch-migration.spec.ts @@ -19,13 +19,13 @@ describe('config/migrations/custom/automerge-patch-migration', () => { { automergePatch: 'some-value', patch: { - matchFiles: ['test'], + matchFileNames: ['test'], }, }, { patch: { automerge: true, - matchFiles: ['test'], + matchFileNames: ['test'], }, } ); diff --git a/lib/config/migrations/custom/fetch-release-notes-migration.spec.ts b/lib/config/migrations/custom/fetch-release-notes-migration.spec.ts new file mode 100644 index 00000000000000..2e17148597eec2 --- /dev/null +++ b/lib/config/migrations/custom/fetch-release-notes-migration.spec.ts @@ -0,0 +1,22 @@ +import { FetchReleaseNotesMigration } from './fetch-release-notes-migration'; + +describe('config/migrations/custom/fetch-release-notes-migration', () => { + it('migrates', () => { + expect(FetchReleaseNotesMigration).toMigrate( + { + fetchReleaseNotes: false as never, + }, + { + fetchReleaseNotes: 'off', + } + ); + expect(FetchReleaseNotesMigration).toMigrate( + { + fetchReleaseNotes: true as never, + }, + { + fetchReleaseNotes: 'pr', + } + ); + }); +}); diff --git a/lib/config/migrations/custom/fetch-release-notes-migration.ts b/lib/config/migrations/custom/fetch-release-notes-migration.ts new file mode 100644 index 00000000000000..60b7afe6eaa1a4 --- /dev/null +++ b/lib/config/migrations/custom/fetch-release-notes-migration.ts @@ -0,0 +1,12 @@ +import is from '@sindresorhus/is'; +import { AbstractMigration } from '../base/abstract-migration'; + +export class FetchReleaseNotesMigration extends AbstractMigration { + override readonly propertyName = 'fetchReleaseNotes'; + + override run(value: unknown): void { + if (is.boolean(value)) { + this.rewrite(value ? 'pr' : 'off'); + } + } +} diff --git a/lib/config/migrations/custom/package-rules-migration.spec.ts b/lib/config/migrations/custom/package-rules-migration.spec.ts index e77f20476fab5e..3e6ee625006361 100644 --- a/lib/config/migrations/custom/package-rules-migration.spec.ts +++ b/lib/config/migrations/custom/package-rules-migration.spec.ts @@ -48,7 +48,7 @@ describe('config/migrations/custom/package-rules-migration', () => { { packageRules: [ { - matchPaths: [], + matchFileNames: [], packgageRules: { languages: ['javascript'], }, @@ -57,4 +57,54 @@ describe('config/migrations/custom/package-rules-migration', () => { } ); }); + + it('should migrate languages to categories', () => { + expect(PackageRulesMigration).toMigrate( + { + packageRules: [ + { + matchLanguages: ['docker', 'js'], + addLabels: ['docker'], + }, + { + languages: ['java'], + addLabels: ['java'], + }, + ], + }, + { + packageRules: [ + { + matchCategories: ['docker', 'js'], + addLabels: ['docker'], + }, + { + matchCategories: ['java'], + addLabels: ['java'], + }, + ], + } + ); + }); + + it('should migrate single match rule', () => { + expect(PackageRulesMigration).toMigrate( + { + packageRules: [ + { + matchLanguages: ['python'], + addLabels: ['py'], + }, + ], + }, + { + packageRules: [ + { + matchCategories: ['python'], + addLabels: ['py'], + }, + ], + } + ); + }); }); diff --git a/lib/config/migrations/custom/package-rules-migration.ts b/lib/config/migrations/custom/package-rules-migration.ts index e3be4c4c910ac0..a1e0712ea470dc 100644 --- a/lib/config/migrations/custom/package-rules-migration.ts +++ b/lib/config/migrations/custom/package-rules-migration.ts @@ -2,8 +2,11 @@ import type { PackageRule } from '../../types'; import { AbstractMigration } from '../base/abstract-migration'; export const renameMap = { - paths: 'matchPaths', - languages: 'matchLanguages', + matchFiles: 'matchFileNames', + matchPaths: 'matchFileNames', + paths: 'matchFileNames', + languages: 'matchCategories', + matchLanguages: 'matchCategories', baseBranchList: 'matchBaseBranches', managers: 'matchManagers', datasources: 'matchDatasources', diff --git a/lib/config/migrations/migrations-service.ts b/lib/config/migrations/migrations-service.ts index e7e3b314bb51d1..4818e0f2c2a55b 100644 --- a/lib/config/migrations/migrations-service.ts +++ b/lib/config/migrations/migrations-service.ts @@ -20,6 +20,7 @@ import { DepTypesMigration } from './custom/dep-types-migration'; import { DryRunMigration } from './custom/dry-run-migration'; import { EnabledManagersMigration } from './custom/enabled-managers-migration'; import { ExtendsMigration } from './custom/extends-migration'; +import { FetchReleaseNotesMigration } from './custom/fetch-release-notes-migration'; import { GoModTidyMigration } from './custom/go-mod-tidy-migration'; import { HostRulesMigration } from './custom/host-rules-migration'; import { IgnoreNodeModulesMigration } from './custom/ignore-node-modules-migration'; @@ -148,6 +149,7 @@ export class MigrationsService { DatasourceMigration, RecreateClosedMigration, StabilityDaysMigration, + FetchReleaseNotesMigration, ]; static run(originalConfig: RenovateConfig): RenovateConfig { diff --git a/lib/config/options/index.ts b/lib/config/options/index.ts index 5ae3071e580576..c26a8171a6b735 100644 --- a/lib/config/options/index.ts +++ b/lib/config/options/index.ts @@ -1,7 +1,6 @@ import { getManagers } from '../../modules/manager'; import { getPlatformList } from '../../modules/platform'; import { getVersioningList } from '../../modules/versioning'; -import * as dockerVersioning from '../../modules/versioning/docker'; import type { RenovateOptions } from '../types'; const options: RenovateOptions[] = [ @@ -24,9 +23,9 @@ const options: RenovateOptions[] = [ { name: 'allowPostUpgradeCommandTemplating', description: - 'Set this to `true` to allow templating for post-upgrade commands.', + 'Set this to `false` to disable template compilation for post-upgrade commands.', type: 'boolean', - default: false, + default: true, globalOnly: true, }, { @@ -66,7 +65,7 @@ const options: RenovateOptions[] = [ type: 'array', subType: 'string', parent: 'postUpgradeTasks', - default: [], + default: ['**/*'], cli: false, }, { @@ -351,11 +350,11 @@ const options: RenovateOptions[] = [ globalOnly: true, }, { - name: 'dockerImagePrefix', + name: 'dockerSidecarImage', description: - 'Change this value to override the default Renovate Docker sidecar image name prefix.', + 'Change this value to override the default Renovate sidecar image.', type: 'string', - default: 'docker.io/containerbase', + default: 'ghcr.io/containerbase/sidecar:8.0.2', globalOnly: true, }, { @@ -994,9 +993,9 @@ const options: RenovateOptions[] = [ env: false, }, { - name: 'matchLanguages', + name: 'matchCategories', description: - 'List of languages to match (e.g. `["python"]`). Valid only within a `packageRules` object.', + 'List of categories to match (for example: `["python"]`). Valid only within a `packageRules` object.', type: 'array', subType: 'string', allowString: true, @@ -1321,7 +1320,7 @@ const options: RenovateOptions[] = [ env: false, }, { - name: 'matchFiles', + name: 'matchFileNames', description: 'List of strings to do an exact match against package and lock files with full path. Only works inside a `packageRules` object.', type: 'array', @@ -1331,17 +1330,6 @@ const options: RenovateOptions[] = [ cli: false, env: false, }, - { - name: 'matchPaths', - description: - 'List of strings or glob patterns to match against package files. Only works inside a `packageRules` object.', - type: 'array', - subType: 'string', - stage: 'repository', - parent: 'packageRules', - cli: false, - env: false, - }, // Version behaviour { name: 'allowedVersions', @@ -2090,25 +2078,6 @@ const options: RenovateOptions[] = [ cli: false, env: false, }, - { - name: 'js', - description: 'Configuration object for JavaScript language.', - stage: 'package', - type: 'object', - default: {}, - mergeable: true, - }, - { - name: 'golang', - description: 'Configuration object for Go language.', - stage: 'package', - type: 'object', - default: { - commitMessageTopic: 'module {{depName}}', - }, - mergeable: true, - cli: false, - }, { name: 'postUpdateOptions', description: @@ -2133,64 +2102,6 @@ const options: RenovateOptions[] = [ env: false, mergeable: true, }, - { - name: 'ruby', - description: 'Configuration object for Ruby language.', - stage: 'package', - type: 'object', - default: {}, - mergeable: true, - cli: false, - }, - { - name: 'rust', - description: 'Configuration option for Rust package management.', - stage: 'package', - type: 'object', - default: {}, - mergeable: true, - cli: false, - }, - { - name: 'node', - description: 'Configuration object for Node version renovation.', - stage: 'package', - type: 'object', - default: { - commitMessageTopic: 'Node.js', - }, - mergeable: true, - cli: false, - }, - { - name: 'docker', - description: 'Configuration object for Docker language.', - stage: 'package', - type: 'object', - default: { - versioning: dockerVersioning.id, - }, - mergeable: true, - cli: false, - }, - { - name: 'php', - description: 'Configuration object for PHP.', - stage: 'package', - type: 'object', - default: {}, - mergeable: true, - cli: false, - }, - { - name: 'python', - description: 'Configuration object for Python.', - stage: 'package', - type: 'object', - default: {}, - mergeable: true, - cli: false, - }, { name: 'constraints', description: @@ -2209,24 +2120,6 @@ const options: RenovateOptions[] = [ 'poetry', ], }, - { - name: 'java', - description: 'Configuration object for all Java package managers.', - stage: 'package', - type: 'object', - default: {}, - mergeable: true, - cli: false, - }, - { - name: 'dotnet', - description: 'Configuration object for .NET language.', - stage: 'package', - type: 'object', - default: {}, - mergeable: true, - cli: false, - }, { name: 'hostRules', description: 'Host rules/configuration including credentials.', @@ -2578,9 +2471,10 @@ const options: RenovateOptions[] = [ }, { name: 'fetchReleaseNotes', - description: 'Controls if release notes are fetched.', - type: 'boolean', - default: true, + description: 'Controls if and when release notes are fetched.', + type: 'string', + allowedValues: ['off', 'branch', 'pr'], + default: 'pr', cli: false, env: false, }, @@ -2640,7 +2534,7 @@ const options: RenovateOptions[] = [ description: `Controls if platform-native auto-merge is used.`, type: 'boolean', supportedPlatforms: ['azure', 'gitea', 'github', 'gitlab'], - default: false, + default: true, }, { name: 'userStrings', diff --git a/lib/config/presets/common.ts b/lib/config/presets/common.ts index 8ae2839ed0b5c7..c7055516f6d8c0 100644 --- a/lib/config/presets/common.ts +++ b/lib/config/presets/common.ts @@ -3,7 +3,7 @@ export const removedPresets: Record = { ':autodetectRangeStrategy': null, ':automergeBranchMergeCommit': ':automergeBranch', ':automergeBranchPush': ':automergeBranch', - ':base': 'config:base', + ':base': 'config:recommended', ':app': 'config:js-app', ':enableGradleLite': null, ':js-app': 'config:js-app', @@ -12,12 +12,14 @@ export const removedPresets: Record = { ':masterIssueApproval': ':dependencyDashboardApproval', ':switchToGradleLite': null, ':unpublishSafe': 'npm:unpublishSafe', + 'compatibility:additionalBranchPrefix': null, 'config:application': 'config:js-app', - 'config:base-js': 'config:base', + 'config:base': 'config:recommended', + 'config:base-js': 'config:recommended', 'config:library': 'config:js-lib', 'default:automergeBranchMergeCommit': ':automergeBranch', 'default:automergeBranchPush': ':automergeBranch', - 'default:base': 'config:base', + 'default:base': 'config:recommended', 'default:app': 'config:js-app', 'default:js-app': 'config:js-app', 'default:library': 'config:js-lib', diff --git a/lib/config/presets/index.spec.ts b/lib/config/presets/index.spec.ts index cdd501aac0c7ec..5cd7c84922fbfd 100644 --- a/lib/config/presets/index.spec.ts +++ b/lib/config/presets/index.spec.ts @@ -144,7 +144,7 @@ describe('config/presets/index', () => { it('throws noconfig', async () => { config.foo = 1; - config.extends = ['noconfig:base']; + config.extends = ['noconfig:recommended']; let e: Error | undefined; try { await presets.resolveConfigPresets(config); @@ -154,7 +154,7 @@ describe('config/presets/index', () => { expect(e).toBeDefined(); expect(e!.validationSource).toBeUndefined(); expect(e!.validationError).toBe( - 'Preset package is missing a renovate-config entry (noconfig:base)' + 'Preset package is missing a renovate-config entry (noconfig:recommended)' ); expect(e!.validationMessage).toBeUndefined(); }); @@ -270,9 +270,9 @@ describe('config/presets/index', () => { }); it('ignores presets', async () => { - config.extends = ['config:base']; + config.extends = ['config:recommended']; const res = await presets.resolveConfigPresets(config, {}, [ - 'config:base', + 'config:recommended', ]); expect(config).toMatchObject(res); expect(res).toBeEmptyObject(); diff --git a/lib/config/presets/internal/compatibility.ts b/lib/config/presets/internal/compatibility.ts deleted file mode 100644 index 57e12a8d82fb2e..00000000000000 --- a/lib/config/presets/internal/compatibility.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { Preset } from '../types'; - -/* eslint sort-keys: ["error", "asc", {caseSensitive: false, natural: true}] */ - -export const presets: Record = { - additionalBranchPrefix: { - buildkite: { - additionalBranchPrefix: 'buildkite-', - }, - cargo: { - additionalBranchPrefix: 'rust-', - }, - description: - 'Backwards-compatibility preset to restore `additionalBranchPrefix` settings for multiple managers which were removed in Renovate `v25`.', - docker: { - additionalBranchPrefix: 'docker-', - }, - homebrew: { - additionalBranchPrefix: 'homebrew-', - }, - packageRules: [ - { - additionalBranchPrefix: 'helm-', - matchDatasources: ['helm'], - }, - ], - }, -}; diff --git a/lib/config/presets/internal/config.ts b/lib/config/presets/internal/config.ts index 540e6a9b593359..c4b865710fb6e5 100644 --- a/lib/config/presets/internal/config.ts +++ b/lib/config/presets/internal/config.ts @@ -3,18 +3,6 @@ import type { Preset } from '../types'; /* eslint sort-keys: ["error", "asc", {caseSensitive: false, natural: true}] */ export const presets: Record = { - base: { - description: 'Default base configuration for all languages.', - extends: [ - ':dependencyDashboard', - ':semanticPrefixFixDepsChoreOthers', - ':ignoreModulesAndTests', - 'group:monorepos', - 'group:recommended', - 'replacements:all', - 'workarounds:all', - ], - }, 'best-practices': { configMigration: true, description: 'Preset with best practices from the Renovate maintainers.', @@ -27,11 +15,24 @@ export const presets: Record = { }, 'js-app': { description: 'Default configuration for webapps.', - extends: ['config:base', ':pinAllExceptPeerDependencies'], + extends: ['config:recommended', ':pinAllExceptPeerDependencies'], }, 'js-lib': { description: 'Default configuration for libraries.', - extends: ['config:base', ':pinOnlyDevDependencies'], + extends: ['config:recommended', ':pinOnlyDevDependencies'], + }, + recommended: { + description: + 'Recommended configuration for most users. It does not matter what programming language you use.', + extends: [ + ':dependencyDashboard', + ':semanticPrefixFixDepsChoreOthers', + ':ignoreModulesAndTests', + 'group:monorepos', + 'group:recommended', + 'replacements:all', + 'workarounds:all', + ], }, semverAllMonthly: { description: diff --git a/lib/config/presets/internal/default.ts b/lib/config/presets/internal/default.ts index 039eb0a1529501..4605a2a232be9c 100644 --- a/lib/config/presets/internal/default.ts +++ b/lib/config/presets/internal/default.ts @@ -210,7 +210,10 @@ export const presets: Record = { }, docker: { description: 'Keep Dockerfile `FROM` sources updated.', - docker: { + 'docker-compose': { + enabled: true, + }, + dockerfile: { enabled: true, }, }, @@ -360,7 +363,10 @@ export const presets: Record = { }, onlyNpm: { description: 'Renovate only npm dependencies.', - docker: { + 'docker-compose': { + enabled: false, + }, + dockerfile: { enabled: false, }, meteor: { @@ -372,7 +378,7 @@ export const presets: Record = { 'Use semanticCommitType `{{arg0}}` for all package files matching path `{{arg1}}`.', packageRules: [ { - matchPaths: ['{{arg0}}'], + matchFileNames: ['{{arg0}}'], semanticCommitType: '{{arg1}}', }, ], diff --git a/lib/config/presets/internal/docker.ts b/lib/config/presets/internal/docker.ts index 3709be75a3f8a2..9fcce5afe127be 100644 --- a/lib/config/presets/internal/docker.ts +++ b/lib/config/presets/internal/docker.ts @@ -8,10 +8,10 @@ export const presets: Record = { enabled: false, }, description: 'Disable Docker updates.', - docker: { + 'docker-compose': { enabled: false, }, - 'docker-compose': { + dockerfile: { enabled: false, }, }, @@ -37,8 +37,12 @@ export const presets: Record = { }, pinDigests: { description: 'Pin Docker digests.', - docker: { - pinDigests: true, - }, + packageRules: [ + { + enabled: true, + matchDatasources: ['docker'], + pinDigests: true, + }, + ], }, }; diff --git a/lib/config/presets/internal/index.ts b/lib/config/presets/internal/index.ts index 63765664558b69..e37788d17fc4c8 100644 --- a/lib/config/presets/internal/index.ts +++ b/lib/config/presets/internal/index.ts @@ -1,5 +1,4 @@ import type { Preset, PresetConfig } from '../types'; -import * as compatibilityPreset from './compatibility'; import * as configPreset from './config'; import * as defaultPreset from './default'; import * as dockerPreset from './docker'; @@ -17,7 +16,6 @@ import * as workaroundsPreset from './workarounds'; /* eslint sort-keys: ["error", "asc", {caseSensitive: false, natural: true}] */ export const groups: Record> = { - compatibility: compatibilityPreset.presets, config: configPreset.presets, default: defaultPreset.presets, docker: dockerPreset.presets, diff --git a/lib/config/presets/internal/preview.ts b/lib/config/presets/internal/preview.ts index 513412af5ee824..1644850f950a71 100644 --- a/lib/config/presets/internal/preview.ts +++ b/lib/config/presets/internal/preview.ts @@ -17,7 +17,15 @@ export const presets: Record = { }, dockerVersions: { description: 'Upgrade Docker tags to newer versions.', - docker: { + 'docker-compose': { + major: { + enabled: true, + }, + minor: { + enabled: true, + }, + }, + dockerfile: { major: { enabled: true, }, diff --git a/lib/config/types.ts b/lib/config/types.ts index 148fc57e4c3ea2..e597c7217d1b22 100644 --- a/lib/config/types.ts +++ b/lib/config/types.ts @@ -128,7 +128,7 @@ export interface RepoGlobalConfig { customEnvVariables?: Record; dockerChildPrefix?: string; dockerCliOptions?: string; - dockerImagePrefix?: string; + dockerSidecarImage?: string; dockerUser?: string; dryRun?: DryRunConfig; executionTimeout?: number; @@ -261,7 +261,7 @@ export interface RenovateConfig vulnerabilitySeverity?: string; regexManagers?: RegExManager[]; - fetchReleaseNotes?: boolean; + fetchReleaseNotes?: FetchReleaseNotesOptions; secrets?: Record; constraints?: Record; @@ -302,6 +302,8 @@ export type UpdateType = | 'bump' | 'replacement'; +export type FetchReleaseNotesOptions = 'off' | 'branch' | 'pr'; + export type MatchStringsStrategy = 'any' | 'recursive' | 'combination'; export type MergeStrategy = @@ -318,9 +320,7 @@ export interface PackageRule Record { description?: string | string[]; isVulnerabilityAlert?: boolean; - matchFiles?: string[]; - matchPaths?: string[]; - matchLanguages?: string[]; + matchFileNames?: string[]; matchBaseBranches?: string[]; matchManagers?: string | string[]; matchDatasources?: string[]; @@ -340,6 +340,7 @@ export interface PackageRule matchSourceUrlPrefixes?: string[]; matchSourceUrls?: string[]; matchUpdateTypes?: UpdateType[]; + matchCategories?: string[]; matchConfidence?: MergeConfidence[]; registryUrls?: string[] | null; vulnerabilitySeverity?: string; @@ -464,6 +465,7 @@ export type RenovateOptions = export interface PackageRuleInputConfig extends Record { versioning?: string; packageFile?: string; + lockFiles?: string[]; depType?: string; depTypes?: string[]; depName?: string; @@ -475,7 +477,7 @@ export interface PackageRuleInputConfig extends Record { mergeConfidenceLevel?: MergeConfidence | undefined; isBump?: boolean; sourceUrl?: string | null; - language?: string; + categories?: string[]; baseBranch?: string; manager?: string; datasource?: string; @@ -503,7 +505,6 @@ export interface MigratedRenovateConfig extends RenovateConfig { export interface ManagerConfig extends RenovateConfig { manager: string; - language?: string | null; } export interface ValidationResult { diff --git a/lib/config/validation.spec.ts b/lib/config/validation.spec.ts index 1a9ad038a3d427..ca52f2919089de 100644 --- a/lib/config/validation.spec.ts +++ b/lib/config/validation.spec.ts @@ -276,7 +276,7 @@ describe('config/validation', () => { }, ], }, - docker: { + ansible: { minor: { matchDepNames: ['meteor'], matchPackageNames: ['testPackage'], @@ -631,28 +631,21 @@ describe('config/validation', () => { expect(warnings).toMatchSnapshot(); }); - it('errors if language or manager objects are nested', async () => { + it('errors if manager objects are nested', async () => { const config = { - python: { + pyenv: { enabled: false, }, - java: { + maven: { gradle: { enabled: false, }, }, - major: { - minor: { - docker: { - automerge: true, - }, - }, - }, } as never; const { warnings, errors } = await configValidation.validateConfig( config ); - expect(errors).toHaveLength(2); + expect(errors).toHaveLength(1); expect(warnings).toHaveLength(0); expect(errors).toMatchSnapshot(); }); diff --git a/lib/config/validation.ts b/lib/config/validation.ts index 34797bbb8b30f4..efc55ec8eb932c 100644 --- a/lib/config/validation.ts +++ b/lib/config/validation.ts @@ -1,5 +1,5 @@ import is from '@sindresorhus/is'; -import { getLanguageList, getManagerList } from '../modules/manager'; +import { getManagerList } from '../modules/manager'; import { configRegexPredicate, isConfigRegex, regEx } from '../util/regex'; import * as template from '../util/template'; import { @@ -24,7 +24,7 @@ let optionParents: Record; const managerList = getManagerList(); -const topLevelObjects = getLanguageList().concat(getManagerList()); +const topLevelObjects = managerList; const ignoredNodes = [ '$schema', @@ -302,9 +302,9 @@ export async function validateConfig( } const selectors = [ - 'matchFiles', - 'matchPaths', + 'matchFileNames', 'matchLanguages', + 'matchCategories', 'matchBaseBranches', 'matchManagers', 'matchDatasources', diff --git a/lib/constants/category.ts b/lib/constants/category.ts new file mode 100644 index 00000000000000..d04ee2f6d72156 --- /dev/null +++ b/lib/constants/category.ts @@ -0,0 +1,24 @@ +export type Category = + | 'ansible' + | 'batect' + | 'bazel' + | 'c' + | 'cd' + | 'ci' + | 'dart' + | 'docker' + | 'dotnet' + | 'elixir' + | 'golang' + | 'helm' + | 'iac' + | 'java' + | 'js' + | 'kubernetes' + | 'node' + | 'php' + | 'python' + | 'ruby' + | 'rust' + | 'swift' + | 'terraform'; diff --git a/lib/constants/index.ts b/lib/constants/index.ts index 9575afdf2a5cc7..cb5f74bc737bb7 100644 --- a/lib/constants/index.ts +++ b/lib/constants/index.ts @@ -1,2 +1,2 @@ export * from './platforms'; -export * from './programming-language'; +export type * from './category'; diff --git a/lib/constants/programming-language.ts b/lib/constants/programming-language.ts deleted file mode 100644 index 79f2ccff6ebecd..00000000000000 --- a/lib/constants/programming-language.ts +++ /dev/null @@ -1,16 +0,0 @@ -export const programmingLanguages = [ - 'dart', - 'docker', - 'elixir', - 'golang', - 'java', - 'js', - 'dotnet', - 'node', - 'php', - 'python', - 'ruby', - 'rust', -] as const; - -export type ProgrammingLanguage = (typeof programmingLanguages)[number]; diff --git a/lib/modules/datasource/flutter-version/index.ts b/lib/modules/datasource/flutter-version/index.ts index a28bb1839d08a7..803da054fa0cbc 100644 --- a/lib/modules/datasource/flutter-version/index.ts +++ b/lib/modules/datasource/flutter-version/index.ts @@ -1,4 +1,5 @@ import { regEx } from '../../../util/regex'; +import { id as semverId } from '../../versioning/semver'; import { Datasource } from '../datasource'; import type { GetReleasesConfig, ReleaseResult } from '../types'; import type { FlutterResponse } from './types'; @@ -18,6 +19,8 @@ export class FlutterVersionDatasource extends Datasource { override readonly caching = true; + override readonly defaultVersioning = semverId; + async getReleases({ registryUrl, }: GetReleasesConfig): Promise { diff --git a/lib/modules/datasource/go/index.ts b/lib/modules/datasource/go/index.ts index 4da9a69ae2bf8d..f3a3994070b039 100644 --- a/lib/modules/datasource/go/index.ts +++ b/lib/modules/datasource/go/index.ts @@ -20,6 +20,10 @@ export class GoDatasource extends Datasource { super(GoDatasource.id); } + override readonly defaultConfig = { + commitMessageTopic: 'module {{depName}}', + }; + override readonly customRegistrySupport = false; readonly goproxy = new GoProxyDatasource(); diff --git a/lib/modules/datasource/hexpm-bob/index.ts b/lib/modules/datasource/hexpm-bob/index.ts index b298cf39a94af6..fb07083aa1d51f 100644 --- a/lib/modules/datasource/hexpm-bob/index.ts +++ b/lib/modules/datasource/hexpm-bob/index.ts @@ -3,6 +3,7 @@ import { logger } from '../../../logger'; import { ExternalHostError } from '../../../types/errors/external-host-error'; import { cache } from '../../../util/cache/package/decorator'; import { HttpError } from '../../../util/http'; +import { id as semverId } from '../../versioning/semver'; import { Datasource } from '../datasource'; import type { GetReleasesConfig, ReleaseResult } from '../types'; import { datasource, defaultRegistryUrl } from './common'; @@ -21,6 +22,8 @@ export class HexpmBobDatasource extends Datasource { override readonly caching = true; + override readonly defaultVersioning = semverId; + @cache({ namespace: `datasource-${datasource}`, key: ({ registryUrl, packageName }: GetReleasesConfig) => diff --git a/lib/modules/datasource/index.spec.ts b/lib/modules/datasource/index.spec.ts index 8b8dac55d090c1..e5c91e2c88e8a2 100644 --- a/lib/modules/datasource/index.spec.ts +++ b/lib/modules/datasource/index.spec.ts @@ -114,7 +114,7 @@ describe('modules/datasource/index', () => { describe('getDefaultVersioning()', () => { it('returns semver if undefined', () => { - expect(getDefaultVersioning(undefined)).toBe('semver'); + expect(getDefaultVersioning(undefined)).toBe('semver-coerced'); }); }); diff --git a/lib/modules/datasource/index.ts b/lib/modules/datasource/index.ts index ec0f65099e4e9e..1daa4630569d72 100644 --- a/lib/modules/datasource/index.ts +++ b/lib/modules/datasource/index.ts @@ -10,6 +10,7 @@ import { regEx } from '../../util/regex'; import { Result } from '../../util/result'; import { uniq } from '../../util/uniq'; import { trimTrailingSlash } from '../../util/url'; +import { defaultVersioning } from '../versioning'; import * as allVersioning from '../versioning'; import datasources from './api'; import { addMetaData } from './metadata'; @@ -241,14 +242,14 @@ export function getDefaultVersioning( datasourceName: string | undefined ): string { if (!datasourceName) { - return 'semver'; + return defaultVersioning.id; } const datasource = getDatasourceFor(datasourceName); // istanbul ignore if: wrong regex manager config? if (!datasource) { logger.warn({ datasourceName }, 'Missing datasource!'); } - return datasource?.defaultVersioning ?? 'semver'; + return datasource?.defaultVersioning ?? defaultVersioning.id; } function applyReplacements( @@ -399,6 +400,7 @@ export async function getPkgReleases( res.releases = uniq(res.releases, (x, y) => x.version === y.version); if (config?.constraintsFiltering === 'strict') { + const filteredReleases: string[] = []; // Filter releases for compatibility for (const [constraintName, constraintValue] of Object.entries( config.constraints ?? {} @@ -411,7 +413,7 @@ export async function getPkgReleases( return true; } - return constraint.some( + const satisfiesConstraints = constraint.some( // If the constraint value is a subset of any release's constraints, then it's OK // fallback to release's constraint match if subset is not supported by versioning (releaseConstraint) => @@ -419,9 +421,22 @@ export async function getPkgReleases( (version.subset?.(constraintValue, releaseConstraint) ?? version.matches(constraintValue, releaseConstraint)) ); + if (!satisfiesConstraints) { + filteredReleases.push(release.version); + } + return satisfiesConstraints; }); } } + if (filteredReleases.length) { + logger.debug( + `Filtered ${ + filteredReleases.length + } releases for ${packageName} due to constraintsFiltering=strict: ${filteredReleases.join( + ', ' + )}` + ); + } } // Strip constraints from releases result res.releases.forEach((release) => { diff --git a/lib/modules/datasource/npm/get.spec.ts b/lib/modules/datasource/npm/get.spec.ts index c0a7850746ca9c..907ba35ab9d8a2 100644 --- a/lib/modules/datasource/npm/get.spec.ts +++ b/lib/modules/datasource/npm/get.spec.ts @@ -334,6 +334,9 @@ describe('modules/datasource/npm/get', () => { type: 'git', url: 'https://github.com/vuejs/vue-next.git', }, + engines: { + node: '>= 8.9.0', + }, }, }, 'dist-tags': { latest: '2.0.0' }, diff --git a/lib/modules/datasource/npm/get.ts b/lib/modules/datasource/npm/get.ts index 1ff4276dc02924..30f18299df4553 100644 --- a/lib/modules/datasource/npm/get.ts +++ b/lib/modules/datasource/npm/get.ts @@ -176,6 +176,10 @@ export async function getDependency( if (res.versions?.[version].deprecated) { release.isDeprecated = true; } + const nodeConstraint = res.versions?.[version].engines?.node; + if (is.nonEmptyString(nodeConstraint)) { + release.constraints = { node: [nodeConstraint] }; + } const source = PackageSource.parse(res.versions?.[version].repository); if (source.sourceUrl && source.sourceUrl !== dep.sourceUrl) { release.sourceUrl = source.sourceUrl; diff --git a/lib/modules/datasource/npm/types.ts b/lib/modules/datasource/npm/types.ts index 64a9764705f0e5..e67dd987a0e0ef 100644 --- a/lib/modules/datasource/npm/types.ts +++ b/lib/modules/datasource/npm/types.ts @@ -17,6 +17,7 @@ export interface NpmResponseVersion { gitHead?: string; dependencies?: Record; devDependencies?: Record; + engines?: Record; } export interface NpmResponse { diff --git a/lib/modules/manager/ansible-galaxy/index.ts b/lib/modules/manager/ansible-galaxy/index.ts index 426bef1ad220b0..5b468378b37828 100644 --- a/lib/modules/manager/ansible-galaxy/index.ts +++ b/lib/modules/manager/ansible-galaxy/index.ts @@ -1,9 +1,12 @@ +import type { Category } from '../../../constants'; import { GalaxyCollectionDatasource } from '../../datasource/galaxy-collection'; import { GitTagsDatasource } from '../../datasource/git-tags'; import { GithubTagsDatasource } from '../../datasource/github-tags'; export { extractPackageFile } from './extract'; +export const categories: Category[] = ['ansible', 'iac']; + export const defaultConfig = { fileMatch: ['(^|/)requirements\\.ya?ml$', '(^|/)galaxy\\.ya?ml$'], }; diff --git a/lib/modules/manager/ansible/index.ts b/lib/modules/manager/ansible/index.ts index c81d5468ca7b89..ca199ab883f426 100644 --- a/lib/modules/manager/ansible/index.ts +++ b/lib/modules/manager/ansible/index.ts @@ -1,8 +1,8 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { DockerDatasource } from '../../datasource/docker'; export { extractPackageFile } from './extract'; -export const language: ProgrammingLanguage = 'docker'; +export const categories: Category[] = ['ansible', 'iac']; export const defaultConfig = { fileMatch: ['(^|/)tasks/[^/]+\\.ya?ml$'], diff --git a/lib/modules/manager/argocd/index.ts b/lib/modules/manager/argocd/index.ts index 01a8942ad17173..a31a19c0ddb90b 100644 --- a/lib/modules/manager/argocd/index.ts +++ b/lib/modules/manager/argocd/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { DockerDatasource } from '../../datasource/docker'; import { GitTagsDatasource } from '../../datasource/git-tags'; import { HelmDatasource } from '../../datasource/helm'; @@ -11,6 +12,8 @@ export const defaultConfig = { fileMatch: [], }; +export const categories: Category[] = ['kubernetes', 'cd']; + export const supportedDatasources = [ DockerDatasource.id, GitTagsDatasource.id, diff --git a/lib/modules/manager/azure-pipelines/index.ts b/lib/modules/manager/azure-pipelines/index.ts index 8ceb6c32810ec0..6dffe661f22ec9 100644 --- a/lib/modules/manager/azure-pipelines/index.ts +++ b/lib/modules/manager/azure-pipelines/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { AzurePipelinesTasksDatasource } from '../../datasource/azure-pipelines-tasks'; import { GitTagsDatasource } from '../../datasource/git-tags'; export { extractPackageFile } from './extract'; @@ -7,6 +8,8 @@ export const defaultConfig = { enabled: false, }; +export const categories: Category[] = ['ci']; + export const supportedDatasources = [ AzurePipelinesTasksDatasource.id, GitTagsDatasource.id, diff --git a/lib/modules/manager/batect-wrapper/index.ts b/lib/modules/manager/batect-wrapper/index.ts index 80732b481d08a8..f5ec3853589f93 100644 --- a/lib/modules/manager/batect-wrapper/index.ts +++ b/lib/modules/manager/batect-wrapper/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { GithubReleasesDatasource } from '../../datasource/github-releases'; import { id as versioning } from '../../versioning/semver'; @@ -9,4 +10,6 @@ export const defaultConfig = { versioning, }; +export const categories: Category[] = ['batect']; + export const supportedDatasources = [GithubReleasesDatasource.id]; diff --git a/lib/modules/manager/batect/index.ts b/lib/modules/manager/batect/index.ts index 466b348d0c65a5..b08728a980e64a 100644 --- a/lib/modules/manager/batect/index.ts +++ b/lib/modules/manager/batect/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { GitTagsDatasource } from '../../datasource/git-tags'; import { extractAllPackageFiles, extractPackageFile } from './extract'; @@ -7,4 +8,6 @@ export const defaultConfig = { fileMatch: ['(^|/)batect(-bundle)?\\.ya?ml$'], }; +export const categories: Category[] = ['batect']; + export const supportedDatasources = [GitTagsDatasource.id]; diff --git a/lib/modules/manager/bazel/index.ts b/lib/modules/manager/bazel/index.ts index 3ff48cfeab9e4a..77b156c93b3469 100644 --- a/lib/modules/manager/bazel/index.ts +++ b/lib/modules/manager/bazel/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { DockerDatasource } from '../../datasource/docker'; import { GithubReleasesDatasource } from '../../datasource/github-releases'; import { GithubTagsDatasource } from '../../datasource/github-tags'; @@ -11,6 +12,8 @@ export const defaultConfig = { fileMatch: ['(^|/)WORKSPACE(|\\.bazel)$', '\\.bzl$'], }; +export const categories: Category[] = ['bazel']; + export const supportedDatasources = [ DockerDatasource.id, GithubReleasesDatasource.id, diff --git a/lib/modules/manager/bazelisk/index.ts b/lib/modules/manager/bazelisk/index.ts index 350125b3b3a06c..cf40a76e5b67e0 100644 --- a/lib/modules/manager/bazelisk/index.ts +++ b/lib/modules/manager/bazelisk/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { GithubReleasesDatasource } from '../../datasource/github-releases'; export { extractPackageFile } from './extract'; @@ -7,4 +8,6 @@ export const defaultConfig = { pinDigests: false, }; +export const categories: Category[] = ['bazel']; + export const supportedDatasources = [GithubReleasesDatasource.id]; diff --git a/lib/modules/manager/bitbucket-pipelines/index.ts b/lib/modules/manager/bitbucket-pipelines/index.ts index 86d39fd3e9f2e3..3d40503ce98119 100644 --- a/lib/modules/manager/bitbucket-pipelines/index.ts +++ b/lib/modules/manager/bitbucket-pipelines/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { DockerDatasource } from '../../datasource/docker'; import { extractPackageFile } from './extract'; @@ -7,6 +8,8 @@ export const defaultConfig = { fileMatch: ['(^|/)\\.?bitbucket-pipelines\\.ya?ml$'], }; +export const categories: Category[] = ['ci']; + export const supportedDatasources = [DockerDatasource.id]; export const urls = [ diff --git a/lib/modules/manager/buildkite/index.ts b/lib/modules/manager/buildkite/index.ts index d50a6e18b8d0c1..1a2d2d784de100 100644 --- a/lib/modules/manager/buildkite/index.ts +++ b/lib/modules/manager/buildkite/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { GithubTagsDatasource } from '../../datasource/github-tags'; import { extractPackageFile } from './extract'; @@ -10,4 +11,6 @@ export const defaultConfig = { 'to {{#if isMajor}}{{{prettyNewMajor}}}{{else}}{{{newValue}}}{{/if}}', }; +export const categories: Category[] = ['ci']; + export const supportedDatasources = [GithubTagsDatasource.id]; diff --git a/lib/modules/manager/bundler/artifacts.spec.ts b/lib/modules/manager/bundler/artifacts.spec.ts index 841f8ecc899d2d..225205793e3666 100644 --- a/lib/modules/manager/bundler/artifacts.spec.ts +++ b/lib/modules/manager/bundler/artifacts.spec.ts @@ -37,6 +37,7 @@ const adminConfig: RepoGlobalConfig = { localDir: join('/tmp/github/some/repo'), cacheDir: join('/tmp/cache'), containerbaseDir: join('/tmp/cache/containerbase'), + dockerSidecarImage: 'ghcr.io/containerbase/sidecar', }; const config: UpdateArtifactsConfig = {}; @@ -279,7 +280,7 @@ describe('modules/manager/bundler/artifacts', () => { }) ).toEqual([updatedGemfileLock]); expect(execSnapshots).toMatchObject([ - { cmd: 'docker pull containerbase/sidecar' }, + { cmd: 'docker pull ghcr.io/containerbase/sidecar' }, { cmd: 'docker ps --filter name=renovate_sidecar -aq' }, { cmd: @@ -287,10 +288,9 @@ describe('modules/manager/bundler/artifacts', () => { '-v "/tmp/github/some/repo":"/tmp/github/some/repo" ' + '-v "/tmp/cache":"/tmp/cache" ' + '-e GEM_HOME ' + - '-e BUILDPACK_CACHE_DIR ' + '-e CONTAINERBASE_CACHE_DIR ' + '-w "/tmp/github/some/repo" ' + - 'containerbase/sidecar' + + 'ghcr.io/containerbase/sidecar' + ' bash -l -c "' + 'install-tool ruby 1.2.0' + ' && ' + @@ -339,7 +339,7 @@ describe('modules/manager/bundler/artifacts', () => { }) ).toEqual([updatedGemfileLock]); expect(execSnapshots).toMatchObject([ - { cmd: 'docker pull containerbase/sidecar' }, + { cmd: 'docker pull ghcr.io/containerbase/sidecar' }, { cmd: 'docker ps --filter name=renovate_sidecar -aq' }, { cmd: @@ -347,10 +347,9 @@ describe('modules/manager/bundler/artifacts', () => { '-v "/tmp/github/some/repo":"/tmp/github/some/repo" ' + '-v "/tmp/cache":"/tmp/cache" ' + '-e GEM_HOME ' + - '-e BUILDPACK_CACHE_DIR ' + '-e CONTAINERBASE_CACHE_DIR ' + '-w "/tmp/github/some/repo" ' + - 'containerbase/sidecar' + + 'ghcr.io/containerbase/sidecar' + ' bash -l -c "' + 'install-tool ruby 1.2.5' + ' && ' + @@ -401,7 +400,7 @@ describe('modules/manager/bundler/artifacts', () => { }) ).toEqual([updatedGemfileLock]); expect(execSnapshots).toMatchObject([ - { cmd: 'docker pull containerbase/sidecar' }, + { cmd: 'docker pull ghcr.io/containerbase/sidecar' }, { cmd: 'docker ps --filter name=renovate_sidecar -aq' }, { cmd: @@ -409,10 +408,9 @@ describe('modules/manager/bundler/artifacts', () => { '-v "/tmp/github/some/repo":"/tmp/github/some/repo" ' + '-v "/tmp/cache":"/tmp/cache" ' + '-e GEM_HOME ' + - '-e BUILDPACK_CACHE_DIR ' + '-e CONTAINERBASE_CACHE_DIR ' + '-w "/tmp/github/some/repo" ' + - 'containerbase/sidecar' + + 'ghcr.io/containerbase/sidecar' + ' bash -l -c "' + 'install-tool ruby 1.3.0' + ' && ' + @@ -462,7 +460,7 @@ describe('modules/manager/bundler/artifacts', () => { }) ).toEqual([updatedGemfileLock]); expect(execSnapshots).toMatchObject([ - { cmd: 'docker pull containerbase/sidecar' }, + { cmd: 'docker pull ghcr.io/containerbase/sidecar' }, { cmd: 'docker ps --filter name=renovate_sidecar -aq' }, { cmd: @@ -471,10 +469,9 @@ describe('modules/manager/bundler/artifacts', () => { '-v "/tmp/cache":"/tmp/cache" ' + '-e BUNDLE_GEMS__PRIVATE__COM ' + '-e GEM_HOME ' + - '-e BUILDPACK_CACHE_DIR ' + '-e CONTAINERBASE_CACHE_DIR ' + '-w "/tmp/github/some/repo" ' + - 'containerbase/sidecar' + + 'ghcr.io/containerbase/sidecar' + ' bash -l -c "' + 'install-tool ruby 1.2.0' + ' && ' + @@ -533,7 +530,7 @@ describe('modules/manager/bundler/artifacts', () => { }) ).toEqual([updatedGemfileLock]); expect(execSnapshots).toMatchObject([ - { cmd: 'docker pull containerbase/sidecar' }, + { cmd: 'docker pull ghcr.io/containerbase/sidecar' }, { cmd: 'docker ps --filter name=renovate_sidecar -aq' }, { cmd: @@ -541,10 +538,9 @@ describe('modules/manager/bundler/artifacts', () => { '-v "/tmp/github/some/repo":"/tmp/github/some/repo" ' + '-v "/tmp/cache":"/tmp/cache" ' + '-e GEM_HOME ' + - '-e BUILDPACK_CACHE_DIR ' + '-e CONTAINERBASE_CACHE_DIR ' + '-w "/tmp/github/some/repo" ' + - 'containerbase/sidecar' + + 'ghcr.io/containerbase/sidecar' + ' bash -l -c "' + 'install-tool ruby 1.2.0' + ' && ' + @@ -605,7 +601,7 @@ describe('modules/manager/bundler/artifacts', () => { }) ).toEqual([updatedGemfileLock]); expect(execSnapshots).toMatchObject([ - { cmd: 'docker pull containerbase/sidecar' }, + { cmd: 'docker pull ghcr.io/containerbase/sidecar' }, { cmd: 'docker ps --filter name=renovate_sidecar -aq' }, { cmd: @@ -613,10 +609,9 @@ describe('modules/manager/bundler/artifacts', () => { '-v "/tmp/github/some/repo":"/tmp/github/some/repo" ' + '-v "/tmp/cache":"/tmp/cache" ' + '-e GEM_HOME ' + - '-e BUILDPACK_CACHE_DIR ' + '-e CONTAINERBASE_CACHE_DIR ' + '-w "/tmp/github/some/repo" ' + - 'containerbase/sidecar' + + 'ghcr.io/containerbase/sidecar' + ' bash -l -c "' + 'install-tool ruby 1.2.0' + ' && ' + @@ -676,7 +671,7 @@ describe('modules/manager/bundler/artifacts', () => { }) ).toEqual([updatedGemfileLock]); expect(execSnapshots).toMatchObject([ - { cmd: 'docker pull containerbase/sidecar' }, + { cmd: 'docker pull ghcr.io/containerbase/sidecar' }, { cmd: 'docker ps --filter name=renovate_sidecar -aq' }, { cmd: @@ -684,10 +679,9 @@ describe('modules/manager/bundler/artifacts', () => { '-v "/tmp/github/some/repo":"/tmp/github/some/repo" ' + '-v "/tmp/cache":"/tmp/cache" ' + '-e GEM_HOME ' + - '-e BUILDPACK_CACHE_DIR ' + '-e CONTAINERBASE_CACHE_DIR ' + '-w "/tmp/github/some/repo" ' + - 'containerbase/sidecar' + + 'ghcr.io/containerbase/sidecar' + ' bash -l -c "' + 'install-tool ruby 1.2.0' + ' && ' + diff --git a/lib/modules/manager/bundler/index.ts b/lib/modules/manager/bundler/index.ts index aeaba3cec117f1..722343267bd1c6 100644 --- a/lib/modules/manager/bundler/index.ts +++ b/lib/modules/manager/bundler/index.ts @@ -1,4 +1,4 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { RubyVersionDatasource } from '../../datasource/ruby-version'; import { RubyGemsDatasource } from '../../datasource/rubygems'; import * as rubyVersioning from '../../versioning/ruby'; @@ -6,7 +6,6 @@ import { updateArtifacts } from './artifacts'; import { extractPackageFile } from './extract'; import { updateLockedDependency } from './update-locked'; -export const language: ProgrammingLanguage = 'ruby'; export const supportsLockFileMaintenance = true; /* @@ -25,6 +24,8 @@ export const defaultConfig = { versioning: rubyVersioning.id, }; +export const categories: Category[] = ['ruby']; + export const supportedDatasources = [ RubyGemsDatasource.id, RubyVersionDatasource.id, diff --git a/lib/modules/manager/cake/index.ts b/lib/modules/manager/cake/index.ts index 15de141e3568e6..2687374f93c20b 100644 --- a/lib/modules/manager/cake/index.ts +++ b/lib/modules/manager/cake/index.ts @@ -1,15 +1,15 @@ import moo from 'moo'; -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { regEx } from '../../../util/regex'; import { NugetDatasource } from '../../datasource/nuget'; import type { PackageDependency, PackageFileContent } from '../types'; -export const language: ProgrammingLanguage = 'dotnet'; - export const defaultConfig = { fileMatch: ['\\.cake$'], }; +export const categories: Category[] = ['dotnet']; + const lexer = moo.states({ main: { lineComment: { match: /\/\/.*?$/ }, // TODO #12870 diff --git a/lib/modules/manager/cargo/artifacts.spec.ts b/lib/modules/manager/cargo/artifacts.spec.ts index 1ad6453f3c6331..5850ba51b38dc8 100644 --- a/lib/modules/manager/cargo/artifacts.spec.ts +++ b/lib/modules/manager/cargo/artifacts.spec.ts @@ -12,7 +12,7 @@ jest.mock('../../../util/git'); jest.mock('../../../util/http'); jest.mock('../../../util/fs'); -process.env.BUILDPACK = 'true'; +process.env.CONTAINERBASE = 'true'; const config: UpdateArtifactsConfig = {}; @@ -21,6 +21,7 @@ const adminConfig: RepoGlobalConfig = { localDir: join('/tmp/github/some/repo'), cacheDir: join('/tmp/cache'), containerbaseDir: join('/tmp/cache/containerbase'), + dockerSidecarImage: 'ghcr.io/containerbase/sidecar', }; describe('modules/manager/cargo/artifacts', () => { @@ -210,17 +211,16 @@ describe('modules/manager/cargo/artifacts', () => { }, ]); expect(execSnapshots).toMatchObject([ - { cmd: 'docker pull containerbase/sidecar' }, + { cmd: 'docker pull ghcr.io/containerbase/sidecar' }, {}, { cmd: 'docker run --rm --name=renovate_sidecar --label=renovate_child ' + '-v "/tmp/github/some/repo":"/tmp/github/some/repo" ' + '-v "/tmp/cache":"/tmp/cache" ' + - '-e BUILDPACK_CACHE_DIR ' + '-e CONTAINERBASE_CACHE_DIR ' + '-w "/tmp/github/some/repo" ' + - 'containerbase/sidecar ' + + 'ghcr.io/containerbase/sidecar ' + 'bash -l -c "' + 'install-tool rust 1.65.0' + ' && ' + @@ -229,7 +229,6 @@ describe('modules/manager/cargo/artifacts', () => { options: { cwd: '/tmp/github/some/repo', env: { - BUILDPACK_CACHE_DIR: '/tmp/cache/containerbase', CONTAINERBASE_CACHE_DIR: '/tmp/cache/containerbase', }, }, @@ -272,7 +271,6 @@ describe('modules/manager/cargo/artifacts', () => { cwd: '/tmp/github/some/repo', encoding: 'utf-8', env: { - BUILDPACK_CACHE_DIR: '/tmp/cache/containerbase', CONTAINERBASE_CACHE_DIR: '/tmp/cache/containerbase', }, }, @@ -282,7 +280,6 @@ describe('modules/manager/cargo/artifacts', () => { options: { cwd: '/tmp/github/some/repo', env: { - BUILDPACK_CACHE_DIR: '/tmp/cache/containerbase', CONTAINERBASE_CACHE_DIR: '/tmp/cache/containerbase', }, }, diff --git a/lib/modules/manager/cargo/index.ts b/lib/modules/manager/cargo/index.ts index 45ee9c4fada786..e529bd2bed1864 100644 --- a/lib/modules/manager/cargo/index.ts +++ b/lib/modules/manager/cargo/index.ts @@ -1,11 +1,10 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { CrateDatasource } from '../../datasource/crate'; import * as cargoVersioning from '../../versioning/cargo'; import { updateArtifacts } from './artifacts'; import { extractPackageFile } from './extract'; export { getRangeStrategy } from './range'; -export const language: ProgrammingLanguage = 'rust'; export const supportsLockFileMaintenance = true; export { extractPackageFile, updateArtifacts }; @@ -16,4 +15,6 @@ export const defaultConfig = { versioning: cargoVersioning.id, }; +export const categories: Category[] = ['rust']; + export const supportedDatasources = [CrateDatasource.id]; diff --git a/lib/modules/manager/cdnurl/index.ts b/lib/modules/manager/cdnurl/index.ts index 5480906fbf9d53..574dc5cc1b577c 100644 --- a/lib/modules/manager/cdnurl/index.ts +++ b/lib/modules/manager/cdnurl/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { CdnJsDatasource } from '../../datasource/cdnjs'; import * as semverVersioning from '../../versioning/semver'; import { extractPackageFile } from './extract'; @@ -9,4 +10,6 @@ export const defaultConfig = { versioning: semverVersioning.id, }; +export const categories: Category[] = ['cd']; + export const supportedDatasources = [CdnJsDatasource.id]; diff --git a/lib/modules/manager/circleci/index.ts b/lib/modules/manager/circleci/index.ts index 02ef7c70aeab1b..3c2fb9b0532b23 100644 --- a/lib/modules/manager/circleci/index.ts +++ b/lib/modules/manager/circleci/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { DockerDatasource } from '../../datasource/docker'; import { OrbDatasource } from '../../datasource/orb'; import { extractPackageFile } from './extract'; @@ -12,4 +13,6 @@ export const defaultConfig = { fileMatch: ['(^|/)\\.circleci/config\\.ya?ml$'], }; +export const categories: Category[] = ['ci']; + export const supportedDatasources = [DockerDatasource.id, OrbDatasource.id]; diff --git a/lib/modules/manager/cloudbuild/index.ts b/lib/modules/manager/cloudbuild/index.ts index 979535276ccc5d..20b9917a5a609d 100644 --- a/lib/modules/manager/cloudbuild/index.ts +++ b/lib/modules/manager/cloudbuild/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { DockerDatasource } from '../../datasource/docker'; import { extractPackageFile } from './extract'; @@ -7,4 +8,6 @@ export const defaultConfig = { fileMatch: ['(^|/)cloudbuild\\.ya?ml'], }; +export const categories: Category[] = ['ci']; + export const supportedDatasources = [DockerDatasource.id]; diff --git a/lib/modules/manager/cocoapods/__snapshots__/artifacts.spec.ts.snap b/lib/modules/manager/cocoapods/__snapshots__/artifacts.spec.ts.snap index 3dab15063ae67d..3e0f072131ba2b 100644 --- a/lib/modules/manager/cocoapods/__snapshots__/artifacts.spec.ts.snap +++ b/lib/modules/manager/cocoapods/__snapshots__/artifacts.spec.ts.snap @@ -57,18 +57,17 @@ exports[`modules/manager/cocoapods/artifacts returns pod exec error 1`] = ` exports[`modules/manager/cocoapods/artifacts returns updated Podfile 1`] = ` [ { - "cmd": "docker pull containerbase/sidecar", + "cmd": "docker pull ghcr.io/containerbase/sidecar", "options": { "encoding": "utf-8", }, }, { - "cmd": "docker run --rm --name=renovate_sidecar --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/cache":"/tmp/cache" -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "/tmp/github/some/repo" containerbase/sidecar bash -l -c "install-tool ruby 3.1.0 && install-tool cocoapods 3.1.0 && gem install cocoapods-acknowledgements && pod install"", + "cmd": "docker run --rm --name=renovate_sidecar --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/cache":"/tmp/cache" -e CONTAINERBASE_CACHE_DIR -w "/tmp/github/some/repo" ghcr.io/containerbase/sidecar bash -l -c "install-tool ruby 3.1.0 && install-tool cocoapods 3.1.0 && gem install cocoapods-acknowledgements && pod install"", "options": { "cwd": "/tmp/github/some/repo", "encoding": "utf-8", "env": { - "BUILDPACK_CACHE_DIR": "/tmp/cache/containerbase", "CONTAINERBASE_CACHE_DIR": "/tmp/cache/containerbase", "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", @@ -88,18 +87,17 @@ exports[`modules/manager/cocoapods/artifacts returns updated Podfile 1`] = ` exports[`modules/manager/cocoapods/artifacts returns updated Podfile and Pods files 1`] = ` [ { - "cmd": "docker pull containerbase/sidecar", + "cmd": "docker pull ghcr.io/containerbase/sidecar", "options": { "encoding": "utf-8", }, }, { - "cmd": "docker run --rm --name=renovate_sidecar --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/cache":"/tmp/cache" -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "/tmp/github/some/repo" containerbase/sidecar bash -l -c "install-tool ruby 3.1.0 && install-tool cocoapods 3.1.0 && pod install"", + "cmd": "docker run --rm --name=renovate_sidecar --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/cache":"/tmp/cache" -e CONTAINERBASE_CACHE_DIR -w "/tmp/github/some/repo" ghcr.io/containerbase/sidecar bash -l -c "install-tool ruby 3.1.0 && install-tool cocoapods 3.1.0 && pod install"", "options": { "cwd": "/tmp/github/some/repo", "encoding": "utf-8", "env": { - "BUILDPACK_CACHE_DIR": "/tmp/cache/containerbase", "CONTAINERBASE_CACHE_DIR": "/tmp/cache/containerbase", "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", diff --git a/lib/modules/manager/cocoapods/artifacts.spec.ts b/lib/modules/manager/cocoapods/artifacts.spec.ts index a4caf0fe10d5b8..80d6e085ca0647 100644 --- a/lib/modules/manager/cocoapods/artifacts.spec.ts +++ b/lib/modules/manager/cocoapods/artifacts.spec.ts @@ -26,6 +26,7 @@ const adminConfig: RepoGlobalConfig = { localDir: join('/tmp/github/some/repo'), cacheDir: join('/tmp/cache'), containerbaseDir: join('/tmp/cache/containerbase'), + dockerSidecarImage: 'ghcr.io/containerbase/sidecar', }; describe('modules/manager/cocoapods/artifacts', () => { @@ -252,16 +253,15 @@ describe('modules/manager/cocoapods/artifacts', () => { config, }); expect(execSnapshots).toMatchObject([ - { cmd: 'docker pull containerbase/sidecar' }, + { cmd: 'docker pull ghcr.io/containerbase/sidecar' }, { cmd: 'docker run --rm --name=renovate_sidecar --label=renovate_child ' + '-v "/tmp/github/some/repo":"/tmp/github/some/repo" ' + '-v "/tmp/cache":"/tmp/cache" ' + - '-e BUILDPACK_CACHE_DIR ' + '-e CONTAINERBASE_CACHE_DIR ' + '-w "/tmp/github/some/repo" ' + - 'containerbase/sidecar' + + 'ghcr.io/containerbase/sidecar' + ' bash -l -c "' + 'install-tool ruby 3.1.0' + ' && ' + diff --git a/lib/modules/manager/cocoapods/index.ts b/lib/modules/manager/cocoapods/index.ts index 93783b6c60bba7..a83053af0d6272 100644 --- a/lib/modules/manager/cocoapods/index.ts +++ b/lib/modules/manager/cocoapods/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { GitTagsDatasource } from '../../datasource/git-tags'; import { GithubTagsDatasource } from '../../datasource/github-tags'; import { GitlabTagsDatasource } from '../../datasource/gitlab-tags'; @@ -15,6 +16,8 @@ export const defaultConfig = { versioning: rubyVersioning.id, }; +export const categories: Category[] = ['swift']; + export const supportedDatasources = [ GitTagsDatasource.id, GithubTagsDatasource.id, diff --git a/lib/modules/manager/composer/artifacts.spec.ts b/lib/modules/manager/composer/artifacts.spec.ts index bd197b7233d21c..779ac1bdf5dff6 100644 --- a/lib/modules/manager/composer/artifacts.spec.ts +++ b/lib/modules/manager/composer/artifacts.spec.ts @@ -17,7 +17,7 @@ jest.mock('../../datasource'); jest.mock('../../../util/fs'); jest.mock('../../../util/git'); -process.env.BUILDPACK = 'true'; +process.env.CONTAINERBASE = 'true'; const datasource = mocked(_datasource); @@ -33,6 +33,7 @@ const adminConfig: RepoGlobalConfig = { localDir: join('/tmp/github/some/repo'), cacheDir: join('/tmp/renovate/cache'), containerbaseDir: join('/tmp/renovate/cache/containerbase'), + dockerSidecarImage: 'ghcr.io/containerbase/sidecar', }; const repoStatus = partial({ @@ -784,7 +785,7 @@ describe('modules/manager/composer/artifacts', () => { ]); expect(execSnapshots).toMatchObject([ { - cmd: 'docker pull containerbase/sidecar', + cmd: 'docker pull ghcr.io/containerbase/sidecar', options: { encoding: 'utf-8', }, @@ -801,10 +802,9 @@ describe('modules/manager/composer/artifacts', () => { '-v "/tmp/github/some/repo":"/tmp/github/some/repo" ' + '-v "/tmp/renovate/cache":"/tmp/renovate/cache" ' + '-e COMPOSER_CACHE_DIR ' + - '-e BUILDPACK_CACHE_DIR ' + '-e CONTAINERBASE_CACHE_DIR ' + '-w "/tmp/github/some/repo" ' + - 'containerbase/sidecar' + + 'ghcr.io/containerbase/sidecar' + ' bash -l -c "' + 'install-tool php 7.3' + ' && ' + @@ -815,7 +815,6 @@ describe('modules/manager/composer/artifacts', () => { options: { cwd: '/tmp/github/some/repo', env: { - BUILDPACK_CACHE_DIR: '/tmp/renovate/cache/containerbase', COMPOSER_CACHE_DIR: '/tmp/renovate/cache/others/composer', }, }, @@ -874,7 +873,6 @@ describe('modules/manager/composer/artifacts', () => { options: { cwd: '/tmp/github/some/repo', env: { - BUILDPACK_CACHE_DIR: '/tmp/renovate/cache/containerbase', COMPOSER_CACHE_DIR: '/tmp/renovate/cache/others/composer', }, }, diff --git a/lib/modules/manager/composer/index.ts b/lib/modules/manager/composer/index.ts index 54289b89769168..9561047cc2ee77 100644 --- a/lib/modules/manager/composer/index.ts +++ b/lib/modules/manager/composer/index.ts @@ -1,4 +1,4 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { GitTagsDatasource } from '../../datasource/git-tags'; import { PackagistDatasource } from '../../datasource/packagist'; import { updateArtifacts } from './artifacts'; @@ -7,7 +7,6 @@ import { getRangeStrategy } from './range'; import { updateLockedDependency } from './update-locked'; import { composerVersioningId } from './utils'; -export const language: ProgrammingLanguage = 'php'; export const supportsLockFileMaintenance = true; export { @@ -22,6 +21,8 @@ export const defaultConfig = { versioning: composerVersioningId, }; +export const categories: Category[] = ['php']; + export const supportedDatasources = [ GitTagsDatasource.id, PackagistDatasource.id, diff --git a/lib/modules/manager/conan/index.ts b/lib/modules/manager/conan/index.ts index 3dc5571dedc4c7..79ea56354424fb 100644 --- a/lib/modules/manager/conan/index.ts +++ b/lib/modules/manager/conan/index.ts @@ -1,4 +1,5 @@ export { extractPackageFile } from './extract'; +import type { Category } from '../../../constants'; export { getRangeStrategy } from './range'; import { ConanDatasource } from '../../datasource/conan'; import * as conan from '../../versioning/conan'; @@ -10,4 +11,6 @@ export const defaultConfig = { enabled: false, // See https://github.com/renovatebot/renovate/issues/14170 }; +export const categories: Category[] = ['c']; + export const supportedDatasources = [ConanDatasource.id]; diff --git a/lib/modules/manager/deps-edn/index.ts b/lib/modules/manager/deps-edn/index.ts index 56aec50fd53aee..d9c58b1e6ecbe8 100644 --- a/lib/modules/manager/deps-edn/index.ts +++ b/lib/modules/manager/deps-edn/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { ClojureDatasource } from '../../datasource/clojure'; import * as mavenVersioning from '../../versioning/maven'; import { extractPackageFile } from './extract'; @@ -9,4 +10,6 @@ export const defaultConfig = { versioning: mavenVersioning.id, }; +export const categories: Category[] = ['java']; + export const supportedDatasources = [ClojureDatasource.id]; diff --git a/lib/modules/manager/docker-compose/index.ts b/lib/modules/manager/docker-compose/index.ts index 69d28ba6a35a33..925c71d8b285a6 100644 --- a/lib/modules/manager/docker-compose/index.ts +++ b/lib/modules/manager/docker-compose/index.ts @@ -1,13 +1,13 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { DockerDatasource } from '../../datasource/docker'; import { extractPackageFile } from './extract'; -export const language: ProgrammingLanguage = 'docker'; - export { extractPackageFile }; export const defaultConfig = { fileMatch: ['(^|/)(?:docker-)?compose[^/]*\\.ya?ml$'], }; +export const categories: Category[] = ['docker']; + export const supportedDatasources = [DockerDatasource.id]; diff --git a/lib/modules/manager/dockerfile/index.ts b/lib/modules/manager/dockerfile/index.ts index febfd35a2a88d6..1e68c3ead0d2bd 100644 --- a/lib/modules/manager/dockerfile/index.ts +++ b/lib/modules/manager/dockerfile/index.ts @@ -1,9 +1,7 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { DockerDatasource } from '../../datasource/docker'; import { extractPackageFile } from './extract'; -export const language: ProgrammingLanguage = 'docker'; - export { extractPackageFile }; export const defaultConfig = { @@ -13,4 +11,6 @@ export const defaultConfig = { ], }; +export const categories: Category[] = ['docker']; + export const supportedDatasources = [DockerDatasource.id]; diff --git a/lib/modules/manager/droneci/index.ts b/lib/modules/manager/droneci/index.ts index d7e7fa405c5fc7..fa08c4599ee95b 100644 --- a/lib/modules/manager/droneci/index.ts +++ b/lib/modules/manager/droneci/index.ts @@ -1,13 +1,13 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { DockerDatasource } from '../../datasource/docker'; import { extractPackageFile } from './extract'; -export const language: ProgrammingLanguage = 'docker'; - export { extractPackageFile }; export const defaultConfig = { fileMatch: ['(^|/)\\.drone\\.yml$'], }; +export const categories: Category[] = ['ci']; + export const supportedDatasources = [DockerDatasource.id]; diff --git a/lib/modules/manager/fleet/index.ts b/lib/modules/manager/fleet/index.ts index c864589db2f32c..e6368fc46df7c0 100644 --- a/lib/modules/manager/fleet/index.ts +++ b/lib/modules/manager/fleet/index.ts @@ -1,10 +1,15 @@ +import type { Category } from '../../../constants'; import { GitTagsDatasource } from '../../datasource/git-tags'; import { HelmDatasource } from '../../datasource/helm'; export { extractPackageFile } from './extract'; +export const displayName = 'Rancher Fleet'; + export const defaultConfig = { fileMatch: ['(^|/)fleet\\.ya?ml'], }; +export const categories: Category[] = ['cd', 'kubernetes']; + export const supportedDatasources = [GitTagsDatasource.id, HelmDatasource.id]; diff --git a/lib/modules/manager/flux/index.ts b/lib/modules/manager/flux/index.ts index 58d21b8673d27f..b693db339e92a8 100644 --- a/lib/modules/manager/flux/index.ts +++ b/lib/modules/manager/flux/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { BitbucketTagsDatasource } from '../../datasource/bitbucket-tags'; import { DockerDatasource } from '../../datasource/docker'; import { GitRefsDatasource } from '../../datasource/git-refs'; @@ -15,6 +16,8 @@ export const defaultConfig = { fileMatch: [systemManifestRegex], }; +export const categories: Category[] = ['cd', 'kubernetes']; + export const supportedDatasources = [ GithubReleasesDatasource.id, GitRefsDatasource.id, diff --git a/lib/modules/manager/github-actions/index.ts b/lib/modules/manager/github-actions/index.ts index c2d7ad80bb6e42..254cc35903d9ae 100644 --- a/lib/modules/manager/github-actions/index.ts +++ b/lib/modules/manager/github-actions/index.ts @@ -1,5 +1,5 @@ +import type { Category } from '../../../constants'; import { GithubTagsDatasource } from '../../datasource/github-tags'; - export { extractPackageFile } from './extract'; export const defaultConfig = { @@ -9,4 +9,6 @@ export const defaultConfig = { ], }; +export const categories: Category[] = ['ci']; + export const supportedDatasources = [GithubTagsDatasource.id]; diff --git a/lib/modules/manager/gitlabci-include/index.ts b/lib/modules/manager/gitlabci-include/index.ts index f7ecdd51105538..77d8f5fa5cb09c 100644 --- a/lib/modules/manager/gitlabci-include/index.ts +++ b/lib/modules/manager/gitlabci-include/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { GitlabTagsDatasource } from '../../datasource/gitlab-tags'; import { extractPackageFile } from './extract'; @@ -7,4 +8,6 @@ export const defaultConfig = { fileMatch: ['\\.gitlab-ci\\.ya?ml$'], }; +export const categories: Category[] = ['ci']; + export const supportedDatasources = [GitlabTagsDatasource.id]; diff --git a/lib/modules/manager/gitlabci/index.ts b/lib/modules/manager/gitlabci/index.ts index 3e74df89d6eb8a..71946b1b4aaa99 100644 --- a/lib/modules/manager/gitlabci/index.ts +++ b/lib/modules/manager/gitlabci/index.ts @@ -1,13 +1,13 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { DockerDatasource } from '../../datasource/docker'; import { extractAllPackageFiles, extractPackageFile } from './extract'; -export const language: ProgrammingLanguage = 'docker'; - export { extractAllPackageFiles, extractPackageFile }; export const defaultConfig = { fileMatch: ['\\.gitlab-ci\\.ya?ml$'], }; +export const categories: Category[] = ['ci']; + export const supportedDatasources = [DockerDatasource.id]; diff --git a/lib/modules/manager/gomod/artifacts.spec.ts b/lib/modules/manager/gomod/artifacts.spec.ts index aee0645b62011a..5c8d455b6e44e0 100644 --- a/lib/modules/manager/gomod/artifacts.spec.ts +++ b/lib/modules/manager/gomod/artifacts.spec.ts @@ -28,7 +28,7 @@ jest.mock('../../../util/fs', () => { }); jest.mock('../../datasource'); -process.env.BUILDPACK = 'true'; +process.env.CONTAINERBASE = 'true'; const datasource = mocked(_datasource); const hostRules = mocked(_hostRules); @@ -59,6 +59,7 @@ const adminConfig: RepoGlobalConfig = { localDir: join('/tmp/github/some/repo'), cacheDir: join('/tmp/renovate/cache'), containerbaseDir: join('/tmp/renovate/cache/containerbase'), + dockerSidecarImage: 'ghcr.io/containerbase/sidecar', }; const config: UpdateArtifactsConfig = { @@ -308,7 +309,7 @@ describe('modules/manager/gomod/artifacts', () => { }, ]); expect(execSnapshots).toMatchObject([ - { cmd: 'docker pull containerbase/sidecar' }, + { cmd: 'docker pull ghcr.io/containerbase/sidecar' }, { cmd: 'docker ps --filter name=renovate_sidecar -aq' }, { cmd: @@ -322,10 +323,9 @@ describe('modules/manager/gomod/artifacts', () => { '-e GOINSECURE ' + '-e GOFLAGS ' + '-e CGO_ENABLED ' + - '-e BUILDPACK_CACHE_DIR ' + '-e CONTAINERBASE_CACHE_DIR ' + '-w "/tmp/github/some/repo" ' + - 'containerbase/sidecar' + + 'ghcr.io/containerbase/sidecar' + ' bash -l -c "' + 'install-tool golang 1.14.0' + ' && ' + @@ -333,9 +333,7 @@ describe('modules/manager/gomod/artifacts', () => { '"', options: { cwd: '/tmp/github/some/repo', - env: { - BUILDPACK_CACHE_DIR: '/tmp/renovate/cache/containerbase', - }, + env: {}, }, }, ]); @@ -378,9 +376,7 @@ describe('modules/manager/gomod/artifacts', () => { cmd: 'go get -d -t ./...', options: { cwd: '/tmp/github/some/repo', - env: { - BUILDPACK_CACHE_DIR: '/tmp/renovate/cache/containerbase', - }, + env: {}, }, }, ]); @@ -465,7 +461,7 @@ describe('modules/manager/gomod/artifacts', () => { }, ]); expect(execSnapshots).toMatchObject([ - { cmd: 'docker pull containerbase/sidecar' }, + { cmd: 'docker pull ghcr.io/containerbase/sidecar' }, { cmd: 'docker ps --filter name=renovate_sidecar -aq' }, { cmd: @@ -492,10 +488,9 @@ describe('modules/manager/gomod/artifacts', () => { '-e GIT_CONFIG_VALUE_4 ' + '-e GIT_CONFIG_KEY_5 ' + '-e GIT_CONFIG_VALUE_5 ' + - '-e BUILDPACK_CACHE_DIR ' + '-e CONTAINERBASE_CACHE_DIR ' + '-w "/tmp/github/some/repo" ' + - 'containerbase/sidecar' + + 'ghcr.io/containerbase/sidecar' + ' bash -l -c "' + 'install-tool golang 1.14.0' + ' && ' + @@ -504,7 +499,6 @@ describe('modules/manager/gomod/artifacts', () => { options: { cwd: '/tmp/github/some/repo', env: { - BUILDPACK_CACHE_DIR: '/tmp/renovate/cache/containerbase', GIT_CONFIG_COUNT: '6', GIT_CONFIG_KEY_0: 'url.https://ssh:some-token@github.com/.insteadOf', @@ -576,7 +570,7 @@ describe('modules/manager/gomod/artifacts', () => { }, ]); expect(execSnapshots).toMatchObject([ - { cmd: 'docker pull containerbase/sidecar' }, + { cmd: 'docker pull ghcr.io/containerbase/sidecar' }, {}, { options: { @@ -990,7 +984,7 @@ describe('modules/manager/gomod/artifacts', () => { { file: { contents: 'New go.sum 2', path: 'go.mod', type: 'addition' } }, ]); expect(execSnapshots).toMatchObject([ - { cmd: 'docker pull containerbase/sidecar' }, + { cmd: 'docker pull ghcr.io/containerbase/sidecar' }, {}, { cmd: @@ -1004,10 +998,9 @@ describe('modules/manager/gomod/artifacts', () => { '-e GOINSECURE ' + '-e GOFLAGS ' + '-e CGO_ENABLED ' + - '-e BUILDPACK_CACHE_DIR ' + '-e CONTAINERBASE_CACHE_DIR ' + '-w "/tmp/github/some/repo" ' + - 'containerbase/sidecar' + + 'ghcr.io/containerbase/sidecar' + ' bash -l -c "' + 'install-tool golang 1.14.0' + ' && ' + @@ -1055,7 +1048,7 @@ describe('modules/manager/gomod/artifacts', () => { { file: { contents: 'New go.sum 2', path: 'go.mod', type: 'addition' } }, ]); expect(execSnapshots).toMatchObject([ - { cmd: 'docker pull containerbase/sidecar' }, + { cmd: 'docker pull ghcr.io/containerbase/sidecar' }, {}, { cmd: @@ -1069,10 +1062,9 @@ describe('modules/manager/gomod/artifacts', () => { '-e GOINSECURE ' + '-e GOFLAGS ' + '-e CGO_ENABLED ' + - '-e BUILDPACK_CACHE_DIR ' + '-e CONTAINERBASE_CACHE_DIR ' + '-w "/tmp/github/some/repo" ' + - 'containerbase/sidecar' + + 'ghcr.io/containerbase/sidecar' + ' bash -l -c "' + 'install-tool golang 1.14.0' + ' && ' + @@ -1120,7 +1112,7 @@ describe('modules/manager/gomod/artifacts', () => { { file: { contents: 'New go.sum 2', path: 'go.mod', type: 'addition' } }, ]); expect(execSnapshots).toMatchObject([ - { cmd: 'docker pull containerbase/sidecar' }, + { cmd: 'docker pull ghcr.io/containerbase/sidecar' }, {}, { cmd: @@ -1134,10 +1126,9 @@ describe('modules/manager/gomod/artifacts', () => { '-e GOINSECURE ' + '-e GOFLAGS ' + '-e CGO_ENABLED ' + - '-e BUILDPACK_CACHE_DIR ' + '-e CONTAINERBASE_CACHE_DIR ' + '-w "/tmp/github/some/repo" ' + - 'containerbase/sidecar' + + 'ghcr.io/containerbase/sidecar' + ' bash -l -c "' + 'install-tool golang 1.14.0' + ' && ' + @@ -1185,7 +1176,7 @@ describe('modules/manager/gomod/artifacts', () => { { file: { contents: 'New go.sum 2', path: 'go.mod', type: 'addition' } }, ]); expect(execSnapshots).toMatchObject([ - { cmd: 'docker pull containerbase/sidecar' }, + { cmd: 'docker pull ghcr.io/containerbase/sidecar' }, {}, { cmd: @@ -1199,10 +1190,9 @@ describe('modules/manager/gomod/artifacts', () => { '-e GOINSECURE ' + '-e GOFLAGS ' + '-e CGO_ENABLED ' + - '-e BUILDPACK_CACHE_DIR ' + '-e CONTAINERBASE_CACHE_DIR ' + '-w "/tmp/github/some/repo" ' + - 'containerbase/sidecar' + + 'ghcr.io/containerbase/sidecar' + ' bash -l -c "' + 'install-tool golang 1.14.0' + ' && ' + @@ -1842,7 +1832,7 @@ describe('modules/manager/gomod/artifacts', () => { ]); const expectedResult = [ { - cmd: 'docker pull containerbase/sidecar', + cmd: 'docker pull ghcr.io/containerbase/sidecar', }, {}, { @@ -1857,10 +1847,9 @@ describe('modules/manager/gomod/artifacts', () => { '-e GOINSECURE ' + '-e GOFLAGS ' + '-e CGO_ENABLED ' + - '-e BUILDPACK_CACHE_DIR ' + '-e CONTAINERBASE_CACHE_DIR ' + '-w "/tmp/github/some/repo" ' + - 'containerbase/sidecar' + + 'ghcr.io/containerbase/sidecar' + ' bash -l -c "' + 'install-tool golang 1.17.0' + ' && ' + @@ -1917,7 +1906,7 @@ describe('modules/manager/gomod/artifacts', () => { ]); const expectedResult = [ { - cmd: 'docker pull containerbase/sidecar', + cmd: 'docker pull ghcr.io/containerbase/sidecar', }, {}, { @@ -1932,10 +1921,9 @@ describe('modules/manager/gomod/artifacts', () => { '-e GOINSECURE ' + '-e GOFLAGS ' + '-e CGO_ENABLED ' + - '-e BUILDPACK_CACHE_DIR ' + '-e CONTAINERBASE_CACHE_DIR ' + '-w "/tmp/github/some/repo" ' + - 'containerbase/sidecar' + + 'ghcr.io/containerbase/sidecar' + ' bash -l -c "' + 'install-tool golang 1.14.0' + ' && ' + diff --git a/lib/modules/manager/gomod/index.ts b/lib/modules/manager/gomod/index.ts index 8736edae9ba8a8..c807338a890610 100644 --- a/lib/modules/manager/gomod/index.ts +++ b/lib/modules/manager/gomod/index.ts @@ -1,4 +1,4 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { GoDatasource } from '../../datasource/go'; import { GolangVersionDatasource } from '../../datasource/golang-version'; import { updateArtifacts } from './artifacts'; @@ -10,13 +10,13 @@ export { extractPackageFile, updateDependency, updateArtifacts }; export const displayName = 'Go Modules'; export const url = 'https://go.dev/ref/mod'; -export const language: ProgrammingLanguage = 'golang'; - export const defaultConfig = { fileMatch: ['(^|/)go\\.mod$'], pinDigests: false, }; +export const categories: Category[] = ['golang']; + export const supportedDatasources = [ GoDatasource.id, GolangVersionDatasource.id, diff --git a/lib/modules/manager/gradle-wrapper/artifacts.spec.ts b/lib/modules/manager/gradle-wrapper/artifacts.spec.ts index 91da44903745e9..4f4ec1028a280b 100644 --- a/lib/modules/manager/gradle-wrapper/artifacts.spec.ts +++ b/lib/modules/manager/gradle-wrapper/artifacts.spec.ts @@ -181,7 +181,11 @@ describe('modules/manager/gradle-wrapper/artifacts', () => { modified: ['gradle/wrapper/gradle-wrapper.properties'], }) ); - GlobalConfig.set({ ...adminConfig, binarySource: 'docker' }); + GlobalConfig.set({ + ...adminConfig, + binarySource: 'docker', + dockerSidecarImage: 'ghcr.io/containerbase/sidecar', + }); const result = await updateArtifacts({ packageFileName: 'gradle/wrapper/gradle-wrapper.properties', @@ -200,7 +204,7 @@ describe('modules/manager/gradle-wrapper/artifacts', () => { }, ]); expect(execSnapshots).toMatchObject([ - { cmd: 'docker pull containerbase/sidecar' }, + { cmd: 'docker pull ghcr.io/containerbase/sidecar' }, { cmd: 'docker ps --filter name=renovate_sidecar -aq' }, { cmd: @@ -208,10 +212,9 @@ describe('modules/manager/gradle-wrapper/artifacts', () => { '-v "/tmp/github/some/repo":"/tmp/github/some/repo" ' + '-v "/tmp/cache":"/tmp/cache" ' + '-e GRADLE_OPTS ' + - '-e BUILDPACK_CACHE_DIR ' + '-e CONTAINERBASE_CACHE_DIR ' + '-w "/tmp/github/some/repo" ' + - 'containerbase/sidecar' + + 'ghcr.io/containerbase/sidecar' + ' bash -l -c "' + 'install-tool java 11.0.1' + ' && ' + diff --git a/lib/modules/manager/gradle-wrapper/index.ts b/lib/modules/manager/gradle-wrapper/index.ts index 76fae92837e5c9..1aa27107aa3e43 100644 --- a/lib/modules/manager/gradle-wrapper/index.ts +++ b/lib/modules/manager/gradle-wrapper/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { GradleVersionDatasource } from '../../datasource/gradle-version'; import { id as versioning } from '../../versioning/gradle'; @@ -9,4 +10,6 @@ export const defaultConfig = { versioning, }; +export const categories: Category[] = ['java']; + export const supportedDatasources = [GradleVersionDatasource.id]; diff --git a/lib/modules/manager/gradle/artifacts.spec.ts b/lib/modules/manager/gradle/artifacts.spec.ts index f52fcf0d27be2a..15f6f35a9c6d8f 100644 --- a/lib/modules/manager/gradle/artifacts.spec.ts +++ b/lib/modules/manager/gradle/artifacts.spec.ts @@ -35,6 +35,7 @@ const adminConfig: RepoGlobalConfig = { localDir: join('/tmp/github/some/repo'), cacheDir: join('/tmp/cache'), containerbaseDir: join('/tmp/cache/containerbase'), + dockerSidecarImage: 'ghcr.io/containerbase/sidecar', }; const osPlatformSpy = jest.spyOn(os, 'platform'); @@ -326,7 +327,7 @@ describe('modules/manager/gradle/artifacts', () => { }, ]); expect(execSnapshots).toMatchObject([ - { cmd: 'docker pull containerbase/sidecar' }, + { cmd: 'docker pull ghcr.io/containerbase/sidecar' }, { cmd: 'docker ps --filter name=renovate_sidecar -aq' }, { cmd: @@ -334,10 +335,9 @@ describe('modules/manager/gradle/artifacts', () => { '-v "/tmp/github/some/repo":"/tmp/github/some/repo" ' + '-v "/tmp/cache":"/tmp/cache" ' + '-e GRADLE_OPTS ' + - '-e BUILDPACK_CACHE_DIR ' + '-e CONTAINERBASE_CACHE_DIR ' + '-w "/tmp/github/some/repo" ' + - 'containerbase/sidecar' + + 'ghcr.io/containerbase/sidecar' + ' bash -l -c "' + 'install-tool java 16.0.1' + ' && ' + @@ -352,10 +352,9 @@ describe('modules/manager/gradle/artifacts', () => { '-v "/tmp/github/some/repo":"/tmp/github/some/repo" ' + '-v "/tmp/cache":"/tmp/cache" ' + '-e GRADLE_OPTS ' + - '-e BUILDPACK_CACHE_DIR ' + '-e CONTAINERBASE_CACHE_DIR ' + '-w "/tmp/github/some/repo" ' + - 'containerbase/sidecar' + + 'ghcr.io/containerbase/sidecar' + ' bash -l -c "' + 'install-tool java 16.0.1' + ' && ' + diff --git a/lib/modules/manager/gradle/index.ts b/lib/modules/manager/gradle/index.ts index 82419fa6f81868..7723ce27f10fe6 100644 --- a/lib/modules/manager/gradle/index.ts +++ b/lib/modules/manager/gradle/index.ts @@ -1,4 +1,4 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { MavenDatasource } from '../../datasource/maven'; import * as gradleVersioning from '../../versioning/gradle'; @@ -6,7 +6,6 @@ export { extractAllPackageFiles } from './extract'; export { updateDependency } from './update'; export { updateArtifacts } from './artifacts'; -export const language: ProgrammingLanguage = 'java'; export const supportsLockFileMaintenance = true; export const defaultConfig = { @@ -24,4 +23,6 @@ export const defaultConfig = { versioning: gradleVersioning.id, }; +export const categories: Category[] = ['java']; + export const supportedDatasources = [MavenDatasource.id]; diff --git a/lib/modules/manager/helm-requirements/index.ts b/lib/modules/manager/helm-requirements/index.ts index 7c4a02772d1021..84752392a41f1c 100644 --- a/lib/modules/manager/helm-requirements/index.ts +++ b/lib/modules/manager/helm-requirements/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { HelmDatasource } from '../../datasource/helm'; export { extractPackageFile } from './extract'; @@ -9,4 +10,6 @@ export const defaultConfig = { fileMatch: ['(^|/)requirements\\.ya?ml$'], }; +export const categories: Category[] = ['helm', 'kubernetes']; + export const supportedDatasources = [HelmDatasource.id]; diff --git a/lib/modules/manager/helm-values/index.ts b/lib/modules/manager/helm-values/index.ts index a9ef8d535341d4..6d96f591c1b390 100644 --- a/lib/modules/manager/helm-values/index.ts +++ b/lib/modules/manager/helm-values/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { DockerDatasource } from '../../datasource/docker'; export { extractPackageFile } from './extract'; @@ -7,4 +8,6 @@ export const defaultConfig = { pinDigests: false, }; +export const categories: Category[] = ['helm', 'kubernetes']; + export const supportedDatasources = [DockerDatasource.id]; diff --git a/lib/modules/manager/helmfile/artifacts.spec.ts b/lib/modules/manager/helmfile/artifacts.spec.ts index d36b45bda5b662..10eaa9fd7d9e3d 100644 --- a/lib/modules/manager/helmfile/artifacts.spec.ts +++ b/lib/modules/manager/helmfile/artifacts.spec.ts @@ -24,6 +24,7 @@ const adminConfig: RepoGlobalConfig = { localDir: join('/tmp/github/some/repo'), // `join` fixes Windows CI cacheDir: join('/tmp/renovate/cache'), containerbaseDir: join('/tmp/renovate/cache/containerbase'), + dockerSidecarImage: 'ghcr.io/containerbase/sidecar', }; const config: UpdateArtifactsConfig = {}; @@ -307,7 +308,7 @@ describe('modules/manager/helmfile/artifacts', () => { { binarySource: 'docker', expectedCommands: [ - { cmd: 'docker pull containerbase/sidecar' }, + { cmd: 'docker pull ghcr.io/containerbase/sidecar' }, { cmd: 'docker ps --filter name=renovate_sidecar -aq' }, { cmd: @@ -318,10 +319,9 @@ describe('modules/manager/helmfile/artifacts', () => { '-e HELM_REGISTRY_CONFIG ' + '-e HELM_REPOSITORY_CONFIG ' + '-e HELM_REPOSITORY_CACHE ' + - '-e BUILDPACK_CACHE_DIR ' + '-e CONTAINERBASE_CACHE_DIR ' + '-w "/tmp/github/some/repo" ' + - 'containerbase/sidecar ' + + 'ghcr.io/containerbase/sidecar ' + 'bash -l -c "' + 'install-tool helm v3.7.2' + ' && ' + diff --git a/lib/modules/manager/helmfile/index.ts b/lib/modules/manager/helmfile/index.ts index 0c17191ac59b5f..c491b44f9c0a3e 100644 --- a/lib/modules/manager/helmfile/index.ts +++ b/lib/modules/manager/helmfile/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { DockerDatasource } from '../../datasource/docker'; import { HelmDatasource } from '../../datasource/helm'; export { extractPackageFile } from './extract'; @@ -13,4 +14,6 @@ export const defaultConfig = { fileMatch: ['(^|/)helmfile\\.ya?ml$'], }; +export const categories: Category[] = ['cd', 'helm', 'kubernetes']; + export const supportedDatasources = [HelmDatasource.id, DockerDatasource.id]; diff --git a/lib/modules/manager/helmsman/index.ts b/lib/modules/manager/helmsman/index.ts index 9f0cf9c1338722..6a6b47e8238904 100644 --- a/lib/modules/manager/helmsman/index.ts +++ b/lib/modules/manager/helmsman/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { HelmDatasource } from '../../datasource/helm'; export { extractPackageFile } from './extract'; @@ -5,4 +6,6 @@ export const defaultConfig = { fileMatch: [], }; +export const categories: Category[] = ['cd', 'helm', 'kubernetes']; + export const supportedDatasources = [HelmDatasource.id]; diff --git a/lib/modules/manager/helmv3/__snapshots__/artifacts.spec.ts.snap b/lib/modules/manager/helmv3/__snapshots__/artifacts.spec.ts.snap index e3580be7b905ce..974ad178fb2648 100644 --- a/lib/modules/manager/helmv3/__snapshots__/artifacts.spec.ts.snap +++ b/lib/modules/manager/helmv3/__snapshots__/artifacts.spec.ts.snap @@ -456,7 +456,7 @@ exports[`modules/manager/helmv3/artifacts returns updated Chart.lock for lockfil exports[`modules/manager/helmv3/artifacts returns updated Chart.lock with docker 1`] = ` [ { - "cmd": "docker pull containerbase/sidecar", + "cmd": "docker pull ghcr.io/containerbase/sidecar", "options": { "encoding": "utf-8", }, @@ -468,12 +468,11 @@ exports[`modules/manager/helmv3/artifacts returns updated Chart.lock with docker }, }, { - "cmd": "docker run --rm --name=renovate_sidecar --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/renovate/cache":"/tmp/renovate/cache" -e HELM_EXPERIMENTAL_OCI -e HELM_REGISTRY_CONFIG -e HELM_REPOSITORY_CONFIG -e HELM_REPOSITORY_CACHE -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "/tmp/github/some/repo" containerbase/sidecar bash -l -c "install-tool helm v3.7.2 && helm repo add repo-test https://gitlab.com/api/v4/projects/xxxxxxx/packages/helm/stable && helm dependency update ''"", + "cmd": "docker run --rm --name=renovate_sidecar --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/renovate/cache":"/tmp/renovate/cache" -e HELM_EXPERIMENTAL_OCI -e HELM_REGISTRY_CONFIG -e HELM_REPOSITORY_CONFIG -e HELM_REPOSITORY_CACHE -e CONTAINERBASE_CACHE_DIR -w "/tmp/github/some/repo" ghcr.io/containerbase/sidecar bash -l -c "install-tool helm v3.7.2 && helm repo add repo-test https://gitlab.com/api/v4/projects/xxxxxxx/packages/helm/stable && helm dependency update ''"", "options": { "cwd": "/tmp/github/some/repo", "encoding": "utf-8", "env": { - "BUILDPACK_CACHE_DIR": "/tmp/renovate/cache/containerbase", "CONTAINERBASE_CACHE_DIR": "/tmp/renovate/cache/containerbase", "HELM_EXPERIMENTAL_OCI": "1", "HELM_REGISTRY_CONFIG": "/tmp/renovate/cache/__renovate-private-cache/registry.json", @@ -590,7 +589,7 @@ exports[`modules/manager/helmv3/artifacts sets repositories from registryAliases exports[`modules/manager/helmv3/artifacts sets repositories from registryAliases with docker 1`] = ` [ { - "cmd": "docker pull containerbase/sidecar", + "cmd": "docker pull ghcr.io/containerbase/sidecar", "options": { "encoding": "utf-8", }, @@ -602,12 +601,11 @@ exports[`modules/manager/helmv3/artifacts sets repositories from registryAliases }, }, { - "cmd": "docker run --rm --name=renovate_sidecar --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/renovate/cache":"/tmp/renovate/cache" -e HELM_EXPERIMENTAL_OCI -e HELM_REGISTRY_CONFIG -e HELM_REPOSITORY_CONFIG -e HELM_REPOSITORY_CACHE -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "/tmp/github/some/repo" containerbase/sidecar bash -l -c "install-tool helm v3.7.2 && helm repo add stable the_stable_url && helm repo add repo1 the_repo1_url && helm repo add repo-test https://gitlab.com/api/v4/projects/xxxxxxx/packages/helm/stable && helm dependency update ''"", + "cmd": "docker run --rm --name=renovate_sidecar --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/renovate/cache":"/tmp/renovate/cache" -e HELM_EXPERIMENTAL_OCI -e HELM_REGISTRY_CONFIG -e HELM_REPOSITORY_CONFIG -e HELM_REPOSITORY_CACHE -e CONTAINERBASE_CACHE_DIR -w "/tmp/github/some/repo" ghcr.io/containerbase/sidecar bash -l -c "install-tool helm v3.7.2 && helm repo add stable the_stable_url && helm repo add repo1 the_repo1_url && helm repo add repo-test https://gitlab.com/api/v4/projects/xxxxxxx/packages/helm/stable && helm dependency update ''"", "options": { "cwd": "/tmp/github/some/repo", "encoding": "utf-8", "env": { - "BUILDPACK_CACHE_DIR": "/tmp/renovate/cache/containerbase", "CONTAINERBASE_CACHE_DIR": "/tmp/renovate/cache/containerbase", "HELM_EXPERIMENTAL_OCI": "1", "HELM_REGISTRY_CONFIG": "/tmp/renovate/cache/__renovate-private-cache/registry.json", diff --git a/lib/modules/manager/helmv3/artifacts.spec.ts b/lib/modules/manager/helmv3/artifacts.spec.ts index 0116d6b7c65820..ff8e5b3ee94153 100644 --- a/lib/modules/manager/helmv3/artifacts.spec.ts +++ b/lib/modules/manager/helmv3/artifacts.spec.ts @@ -153,7 +153,11 @@ describe('modules/manager/helmv3/artifacts', () => { }); it('returns updated Chart.lock with docker', async () => { - GlobalConfig.set({ ...adminConfig, binarySource: 'docker' }); + GlobalConfig.set({ + ...adminConfig, + binarySource: 'docker', + dockerSidecarImage: 'ghcr.io/containerbase/sidecar', + }); fs.getSiblingFileName.mockReturnValueOnce('Chart.lock'); fs.readLocalFile.mockResolvedValueOnce(ociLockFile1 as never); const execSnapshots = mockExecAll(); @@ -585,7 +589,11 @@ describe('modules/manager/helmv3/artifacts', () => { }); it('sets repositories from registryAliases with docker', async () => { - GlobalConfig.set({ ...adminConfig, binarySource: 'docker' }); + GlobalConfig.set({ + ...adminConfig, + binarySource: 'docker', + dockerSidecarImage: 'ghcr.io/containerbase/sidecar', + }); fs.getSiblingFileName.mockReturnValueOnce('Chart.lock'); fs.readLocalFile.mockResolvedValueOnce(ociLockFile1 as never); const execSnapshots = mockExecAll(); diff --git a/lib/modules/manager/helmv3/index.ts b/lib/modules/manager/helmv3/index.ts index a84cbb47b44f34..30d8b5e17f3281 100644 --- a/lib/modules/manager/helmv3/index.ts +++ b/lib/modules/manager/helmv3/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { DockerDatasource } from '../../datasource/docker'; import { HelmDatasource } from '../../datasource/helm'; export { updateArtifacts } from './artifacts'; @@ -14,4 +15,6 @@ export const defaultConfig = { fileMatch: ['(^|/)Chart\\.ya?ml$'], }; +export const categories: Category[] = ['helm', 'kubernetes']; + export const supportedDatasources = [DockerDatasource.id, HelmDatasource.id]; diff --git a/lib/modules/manager/html/index.ts b/lib/modules/manager/html/index.ts index c196d4af869ec4..ad6e2a725347e1 100644 --- a/lib/modules/manager/html/index.ts +++ b/lib/modules/manager/html/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { CdnJsDatasource } from '../../datasource/cdnjs'; import * as semverVersioning from '../../versioning/semver'; import { extractPackageFile } from './extract'; @@ -13,4 +14,6 @@ export const defaultConfig = { pinDigests: false, }; +export const categories: Category[] = ['cd']; + export const supportedDatasources = [CdnJsDatasource.id]; diff --git a/lib/modules/manager/index.spec.ts b/lib/modules/manager/index.spec.ts index 720a49b0e745da..b60cebaae9d4fa 100644 --- a/lib/modules/manager/index.spec.ts +++ b/lib/modules/manager/index.spec.ts @@ -31,12 +31,6 @@ describe('modules/manager/index', () => { }); }); - describe('getLanguageList()', () => { - it('gets', () => { - expect(manager.getLanguageList()).not.toBeNull(); - }); - }); - describe('getManagerList()', () => { it('gets', () => { expect(manager.getManagerList()).not.toBeNull(); diff --git a/lib/modules/manager/index.ts b/lib/modules/manager/index.ts index 26befb170ef57b..3d35007dc90841 100644 --- a/lib/modules/manager/index.ts +++ b/lib/modules/manager/index.ts @@ -1,4 +1,3 @@ -import { programmingLanguages } from '../../constants'; import type { RangeStrategy } from '../../types'; import managers from './api'; import type { @@ -13,15 +12,12 @@ import type { export { hashMap } from './fingerprint.generated'; const managerList = Array.from(managers.keys()); -const languageList = programmingLanguages.concat(); - export function get( manager: string, name: T ): ManagerApi[T] | undefined { return managers.get(manager)?.[name]; } -export const getLanguageList = (): string[] => languageList; export const getManagerList = (): string[] => managerList; export const getManagers = (): Map => managers; diff --git a/lib/modules/manager/jenkins/index.ts b/lib/modules/manager/jenkins/index.ts index afe5c649940d34..e5b0293a1c8576 100644 --- a/lib/modules/manager/jenkins/index.ts +++ b/lib/modules/manager/jenkins/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { JenkinsPluginsDatasource } from '../../datasource/jenkins-plugins'; export { extractPackageFile } from './extract'; @@ -5,4 +6,6 @@ export const defaultConfig = { fileMatch: ['(^|/)plugins\\.(txt|ya?ml)$'], }; +export const categories: Category[] = ['ci']; + export const supportedDatasources = [JenkinsPluginsDatasource.id]; diff --git a/lib/modules/manager/jsonnet-bundler/index.ts b/lib/modules/manager/jsonnet-bundler/index.ts index fec3158e0dbe53..4afada49d83088 100644 --- a/lib/modules/manager/jsonnet-bundler/index.ts +++ b/lib/modules/manager/jsonnet-bundler/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { GitTagsDatasource } from '../../datasource/git-tags'; export { updateArtifacts } from './artifacts'; export { extractPackageFile } from './extract'; @@ -9,4 +10,6 @@ export const defaultConfig = { datasource: GitTagsDatasource.id, }; +export const categories: Category[] = ['kubernetes']; + export const supportedDatasources = [GitTagsDatasource.id]; diff --git a/lib/modules/manager/kotlin-script/index.ts b/lib/modules/manager/kotlin-script/index.ts index dbded231b6b296..ed2c56080cf01b 100644 --- a/lib/modules/manager/kotlin-script/index.ts +++ b/lib/modules/manager/kotlin-script/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { MavenDatasource } from '../../datasource/maven'; export { extractPackageFile } from './extract'; @@ -6,4 +7,6 @@ export const defaultConfig = { fileMatch: ['^.+\\.main\\.kts$'], }; +export const categories: Category[] = ['java']; + export const supportedDatasources = [MavenDatasource.id]; diff --git a/lib/modules/manager/kubernetes/index.ts b/lib/modules/manager/kubernetes/index.ts index 1ab2c8dc6d70b3..fb62f3e611eb16 100644 --- a/lib/modules/manager/kubernetes/index.ts +++ b/lib/modules/manager/kubernetes/index.ts @@ -1,15 +1,15 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { DockerDatasource } from '../../datasource/docker'; import { KubernetesApiDatasource } from '../../datasource/kubernetes-api'; export { extractPackageFile } from './extract'; -export const language: ProgrammingLanguage = 'docker'; - export const defaultConfig = { fileMatch: [], }; +export const categories: Category[] = ['kubernetes']; + export const supportedDatasources = [ DockerDatasource.id, KubernetesApiDatasource.id, diff --git a/lib/modules/manager/kustomize/index.ts b/lib/modules/manager/kustomize/index.ts index 9ec98a09bab73b..57b287b5da8fee 100644 --- a/lib/modules/manager/kustomize/index.ts +++ b/lib/modules/manager/kustomize/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { DockerDatasource } from '../../datasource/docker'; import { GitTagsDatasource } from '../../datasource/git-tags'; import { GithubTagsDatasource } from '../../datasource/github-tags'; @@ -9,6 +10,8 @@ export const defaultConfig = { pinDigests: false, }; +export const categories: Category[] = ['kubernetes']; + export const supportedDatasources = [ DockerDatasource.id, GitTagsDatasource.id, diff --git a/lib/modules/manager/leiningen/index.ts b/lib/modules/manager/leiningen/index.ts index 831fa32857badf..701776c0c29917 100644 --- a/lib/modules/manager/leiningen/index.ts +++ b/lib/modules/manager/leiningen/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { ClojureDatasource } from '../../datasource/clojure'; import * as mavenVersioning from '../../versioning/maven'; @@ -8,4 +9,6 @@ export const defaultConfig = { versioning: mavenVersioning.id, }; +export const categories: Category[] = ['java']; + export const supportedDatasources = [ClojureDatasource.id]; diff --git a/lib/modules/manager/maven-wrapper/artifacts.spec.ts b/lib/modules/manager/maven-wrapper/artifacts.spec.ts index a4a8c91a2fd697..023249152b0250 100644 --- a/lib/modules/manager/maven-wrapper/artifacts.spec.ts +++ b/lib/modules/manager/maven-wrapper/artifacts.spec.ts @@ -174,7 +174,11 @@ describe('modules/manager/maven-wrapper/artifacts', () => { it('updates with docker', async () => { mockMavenFileChangedInGit(); - GlobalConfig.set({ localDir: './', binarySource: 'docker' }); + GlobalConfig.set({ + localDir: './', + binarySource: 'docker', + dockerSidecarImage: 'ghcr.io/containerbase/sidecar', + }); const execSnapshots = mockExecAll({ stdout: '', stderr: '' }); const result = await updateArtifacts({ packageFileName: 'maven', @@ -193,7 +197,7 @@ describe('modules/manager/maven-wrapper/artifacts', () => { ]); expect(execSnapshots).toMatchObject([ { - cmd: 'docker pull containerbase/sidecar', + cmd: 'docker pull ghcr.io/containerbase/sidecar', options: { encoding: 'utf-8' }, }, { cmd: 'docker ps --filter name=renovate_sidecar -aq' }, @@ -201,10 +205,9 @@ describe('modules/manager/maven-wrapper/artifacts', () => { cmd: 'docker run --rm --name=renovate_sidecar --label=renovate_child ' + '-v "./":"./" ' + - '-e BUILDPACK_CACHE_DIR ' + '-e CONTAINERBASE_CACHE_DIR ' + '-w "../.." ' + - 'containerbase/sidecar' + + 'ghcr.io/containerbase/sidecar' + ' bash -l -c "' + 'install-tool java 17.0.0 ' + '&& ' + diff --git a/lib/modules/manager/maven/index.ts b/lib/modules/manager/maven/index.ts index b6feaa85f99673..8d12ca432bb606 100644 --- a/lib/modules/manager/maven/index.ts +++ b/lib/modules/manager/maven/index.ts @@ -1,15 +1,15 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { MavenDatasource } from '../../datasource/maven'; import * as mavenVersioning from '../../versioning/maven'; export { extractAllPackageFiles } from './extract'; export { bumpPackageVersion, updateDependency } from './update'; -export const language: ProgrammingLanguage = 'java'; - export const defaultConfig = { fileMatch: ['(^|/|\\.)pom\\.xml$', '^(((\\.mvn)|(\\.m2))/)?settings\\.xml$'], versioning: mavenVersioning.id, }; +export const categories: Category[] = ['java']; + export const supportedDatasources = [MavenDatasource.id]; diff --git a/lib/modules/manager/meteor/index.ts b/lib/modules/manager/meteor/index.ts index a1826cc334e2a9..4c2ddbbbec2e1e 100644 --- a/lib/modules/manager/meteor/index.ts +++ b/lib/modules/manager/meteor/index.ts @@ -1,12 +1,12 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { NpmDatasource } from '../../datasource/npm'; export { extractPackageFile } from './extract'; -export const language: ProgrammingLanguage = 'js'; - export const defaultConfig = { fileMatch: ['(^|/)package\\.js$'], }; +export const categories: Category[] = ['js']; + export const supportedDatasources = [NpmDatasource.id]; diff --git a/lib/modules/manager/mint/index.ts b/lib/modules/manager/mint/index.ts index fffd5aadb1ddf5..2301dbd9a08f44 100644 --- a/lib/modules/manager/mint/index.ts +++ b/lib/modules/manager/mint/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { GitTagsDatasource } from '../../datasource/git-tags'; export const displayName = 'Mint'; @@ -5,6 +6,8 @@ export const url = 'https://github.com/yonaskolb/Mint'; export { extractPackageFile } from './extract'; +export const categories: Category[] = ['swift']; + export const supportedDatasources = [GitTagsDatasource.id]; export const defaultConfig = { diff --git a/lib/modules/manager/mix/__snapshots__/artifacts.spec.ts.snap b/lib/modules/manager/mix/__snapshots__/artifacts.spec.ts.snap index 903275a1220f48..73230923e47361 100644 --- a/lib/modules/manager/mix/__snapshots__/artifacts.spec.ts.snap +++ b/lib/modules/manager/mix/__snapshots__/artifacts.spec.ts.snap @@ -21,12 +21,11 @@ exports[`modules/manager/mix/artifacts authenticates to private repositories 2`] }, }, { - "cmd": "docker run --rm --name=renovate_sidecar --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/cache":"/tmp/cache" -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "/tmp/github/some/repo" containerbase/sidecar bash -l -c "install-tool erlang 25.0.0.0 && install-tool elixir v1.13.4 && mix hex.organization auth renovate_test --key valid_test_token && mix deps.update private_package other_package"", + "cmd": "docker run --rm --name=renovate_sidecar --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/cache":"/tmp/cache" -e CONTAINERBASE_CACHE_DIR -w "/tmp/github/some/repo" ghcr.io/containerbase/sidecar bash -l -c "install-tool erlang 25.0.0.0 && install-tool elixir v1.13.4 && mix hex.organization auth renovate_test --key valid_test_token && mix deps.update private_package other_package"", "options": { "cwd": "/tmp/github/some/repo", "encoding": "utf-8", "env": { - "BUILDPACK_CACHE_DIR": "/tmp/cache/containerbase", "CONTAINERBASE_CACHE_DIR": "/tmp/cache/containerbase", "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", @@ -69,7 +68,7 @@ exports[`modules/manager/mix/artifacts returns null if unchanged 1`] = ` exports[`modules/manager/mix/artifacts returns updated mix.lock 1`] = ` [ { - "cmd": "docker pull containerbase/sidecar", + "cmd": "docker pull ghcr.io/containerbase/sidecar", "options": { "encoding": "utf-8", }, @@ -81,12 +80,11 @@ exports[`modules/manager/mix/artifacts returns updated mix.lock 1`] = ` }, }, { - "cmd": "docker run --rm --name=renovate_sidecar --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/cache":"/tmp/cache" -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "/tmp/github/some/repo" containerbase/sidecar bash -l -c "install-tool erlang 25.0.0.0 && install-tool elixir 1.13.4 && mix deps.update plug"", + "cmd": "docker run --rm --name=renovate_sidecar --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/cache":"/tmp/cache" -e CONTAINERBASE_CACHE_DIR -w "/tmp/github/some/repo" ghcr.io/containerbase/sidecar bash -l -c "install-tool erlang 25.0.0.0 && install-tool elixir 1.13.4 && mix deps.update plug"", "options": { "cwd": "/tmp/github/some/repo", "encoding": "utf-8", "env": { - "BUILDPACK_CACHE_DIR": "/tmp/cache/containerbase", "CONTAINERBASE_CACHE_DIR": "/tmp/cache/containerbase", "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", diff --git a/lib/modules/manager/mix/artifacts.spec.ts b/lib/modules/manager/mix/artifacts.spec.ts index 29801cb9371d68..63a5576810aec4 100644 --- a/lib/modules/manager/mix/artifacts.spec.ts +++ b/lib/modules/manager/mix/artifacts.spec.ts @@ -90,7 +90,11 @@ describe('modules/manager/mix/artifacts', () => { it('returns updated mix.lock', async () => { jest.spyOn(docker, 'removeDanglingContainers').mockResolvedValueOnce(); - GlobalConfig.set({ ...adminConfig, binarySource: 'docker' }); + GlobalConfig.set({ + ...adminConfig, + binarySource: 'docker', + dockerSidecarImage: 'ghcr.io/containerbase/sidecar', + }); fs.readLocalFile.mockResolvedValueOnce('Old mix.lock'); fs.findLocalSiblingOrParent.mockResolvedValueOnce('mix.lock'); const execSnapshots = mockExecAll(); @@ -161,7 +165,11 @@ describe('modules/manager/mix/artifacts', () => { it('authenticates to private repositories', async () => { jest.spyOn(docker, 'removeDanglingContainers').mockResolvedValueOnce(); - GlobalConfig.set({ ...adminConfig, binarySource: 'docker' }); + GlobalConfig.set({ + ...adminConfig, + binarySource: 'docker', + dockerSidecarImage: 'ghcr.io/containerbase/sidecar', + }); fs.readLocalFile.mockResolvedValueOnce('Old mix.lock'); fs.findLocalSiblingOrParent.mockResolvedValueOnce('mix.lock'); const execSnapshots = mockExecAll(); @@ -221,7 +229,11 @@ describe('modules/manager/mix/artifacts', () => { }); it('returns updated mix.lock in subdir', async () => { - GlobalConfig.set({ ...adminConfig, binarySource: 'docker' }); + GlobalConfig.set({ + ...adminConfig, + binarySource: 'docker', + dockerSidecarImage: 'ghcr.io/containerbase/sidecar', + }); fs.findLocalSiblingOrParent.mockResolvedValueOnce('subdir/mix.lock'); mockExecAll(); expect( diff --git a/lib/modules/manager/mix/index.ts b/lib/modules/manager/mix/index.ts index f48c01ae2529d1..99712934c95021 100644 --- a/lib/modules/manager/mix/index.ts +++ b/lib/modules/manager/mix/index.ts @@ -1,4 +1,4 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { GitTagsDatasource } from '../../datasource/git-tags'; import { GithubTagsDatasource } from '../../datasource/github-tags'; import { HexDatasource } from '../../datasource/hex'; @@ -7,13 +7,13 @@ import * as hexVersioning from '../../versioning/hex'; export { extractPackageFile } from './extract'; export { updateArtifacts } from './artifacts'; -export const language: ProgrammingLanguage = 'elixir'; - export const defaultConfig = { fileMatch: ['(^|/)mix\\.exs$'], versioning: hexVersioning.id, }; +export const categories: Category[] = ['elixir']; + export const supportedDatasources = [ GithubTagsDatasource.id, GitTagsDatasource.id, diff --git a/lib/modules/manager/nix/artifacts.spec.ts b/lib/modules/manager/nix/artifacts.spec.ts index 35509270490ec9..c3fe645e9b826e 100644 --- a/lib/modules/manager/nix/artifacts.spec.ts +++ b/lib/modules/manager/nix/artifacts.spec.ts @@ -24,9 +24,13 @@ const adminConfig: RepoGlobalConfig = { cacheDir: join('/tmp/renovate/cache'), containerbaseDir: join('/tmp/renovate/cache/containerbase'), }; -const dockerAdminConfig = { ...adminConfig, binarySource: 'docker' }; +const dockerAdminConfig = { + ...adminConfig, + binarySource: 'docker', + dockerSidecarImage: 'ghcr.io/containerbase/sidecar', +}; -process.env.BUILDPACK = 'true'; +process.env.CONTAINERBASE = 'true'; const config: UpdateArtifactsConfig = {}; const lockMaintenanceConfig = { ...config, isLockFileMaintenance: true }; @@ -177,17 +181,16 @@ describe('modules/manager/nix/artifacts', () => { }, ]); expect(execSnapshots).toMatchObject([ - { cmd: 'docker pull containerbase/sidecar' }, + { cmd: 'docker pull ghcr.io/containerbase/sidecar' }, { cmd: 'docker ps --filter name=renovate_sidecar -aq' }, { cmd: 'docker run --rm --name=renovate_sidecar --label=renovate_child ' + '-v "/tmp/github/some/repo":"/tmp/github/some/repo" ' + '-v "/tmp/renovate/cache":"/tmp/renovate/cache" ' + - '-e BUILDPACK_CACHE_DIR ' + '-e CONTAINERBASE_CACHE_DIR ' + '-w "/tmp/github/some/repo" ' + - 'containerbase/sidecar ' + + 'ghcr.io/containerbase/sidecar ' + 'bash -l -c "' + 'install-tool nix 2.10.0 ' + '&& ' + @@ -308,17 +311,16 @@ describe('modules/manager/nix/artifacts', () => { }, ]); expect(execSnapshots).toMatchObject([ - { cmd: 'docker pull containerbase/sidecar' }, + { cmd: 'docker pull ghcr.io/containerbase/sidecar' }, { cmd: 'docker ps --filter name=renovate_sidecar -aq' }, { cmd: 'docker run --rm --name=renovate_sidecar --label=renovate_child ' + '-v "/tmp/github/some/repo":"/tmp/github/some/repo" ' + '-v "/tmp/renovate/cache":"/tmp/renovate/cache" ' + - '-e BUILDPACK_CACHE_DIR ' + '-e CONTAINERBASE_CACHE_DIR ' + '-w "/tmp/github/some/repo" ' + - 'containerbase/sidecar ' + + 'ghcr.io/containerbase/sidecar ' + 'bash -l -c "' + 'install-tool nix 2.10.0 ' + '&& ' + diff --git a/lib/modules/manager/nodenv/index.ts b/lib/modules/manager/nodenv/index.ts index 093d18e922faee..7343b6aced2cdb 100644 --- a/lib/modules/manager/nodenv/index.ts +++ b/lib/modules/manager/nodenv/index.ts @@ -1,4 +1,4 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { GithubTagsDatasource } from '../../datasource/github-tags'; import * as nodeVersioning from '../../versioning/node'; @@ -7,11 +7,11 @@ export { extractPackageFile } from './extract'; export const displayName = 'nodenv'; export const url = 'https://github.com/nodenv/nodenv'; -export const language: ProgrammingLanguage = 'node'; - export const defaultConfig = { fileMatch: ['(^|/)\\.node-version$'], versioning: nodeVersioning.id, }; +export const categories: Category[] = ['js', 'node']; + export const supportedDatasources = [GithubTagsDatasource.id]; diff --git a/lib/modules/manager/npm/extract/index.ts b/lib/modules/manager/npm/extract/index.ts index 2b60ff6630226b..bc873eb440f145 100644 --- a/lib/modules/manager/npm/extract/index.ts +++ b/lib/modules/manager/npm/extract/index.ts @@ -64,7 +64,7 @@ export async function extractPackageFile( const error = new Error(CONFIG_VALIDATION); error.validationSource = packageFile; error.validationError = - 'Nested package.json must not contain renovate configuration. Please use `packageRules` with `matchPaths` in your main config instead.'; + 'Nested package.json must not contain Renovate configuration. Please use `packageRules` with `matchFileNames` in your main config instead.'; throw error; } const packageJsonName = packageJson.name; diff --git a/lib/modules/manager/npm/index.ts b/lib/modules/manager/npm/index.ts index 3ac8a7f281b4ea..26b11772e3dbf3 100644 --- a/lib/modules/manager/npm/index.ts +++ b/lib/modules/manager/npm/index.ts @@ -1,4 +1,4 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { GithubTagsDatasource } from '../../datasource/github-tags'; import { NpmDatasource } from '../../datasource/npm'; import * as npmVersioning from '../../versioning/npm'; @@ -12,12 +12,10 @@ export { } from './update'; export { getRangeStrategy } from './range'; -export const language: ProgrammingLanguage = 'js'; export const supportsLockFileMaintenance = true; export const defaultConfig = { fileMatch: ['(^|/)package\\.json$'], - rollbackPrs: true, versioning: npmVersioning.id, digest: { prBodyDefinitions: { @@ -31,4 +29,6 @@ export const defaultConfig = { }, }; +export const categories: Category[] = ['js']; + export const supportedDatasources = [GithubTagsDatasource.id, NpmDatasource.id]; diff --git a/lib/modules/manager/npm/post-update/lerna.spec.ts b/lib/modules/manager/npm/post-update/lerna.spec.ts index 3ecb66e879f746..96426a0f899ddf 100644 --- a/lib/modules/manager/npm/post-update/lerna.spec.ts +++ b/lib/modules/manager/npm/post-update/lerna.spec.ts @@ -10,7 +10,7 @@ jest.mock('../../../../util/exec/env'); jest.mock('./node-version'); jest.mock('../../../datasource'); -process.env.BUILDPACK = 'true'; +process.env.CONTAINERBASE = 'true'; function lernaPkgFile(lernaClient: string): Partial { return { @@ -134,7 +134,11 @@ describe('modules/manager/npm/post-update/lerna', () => { it('suppports docker', async () => { const execSnapshots = mockExecAll(); - GlobalConfig.set({ ...globalConfig, binarySource: 'docker' }); + GlobalConfig.set({ + ...globalConfig, + binarySource: 'docker', + dockerSidecarImage: 'ghcr.io/containerbase/sidecar', + }); const res = await lernaHelper.generateLockFiles( lernaPkgFile('npm'), @@ -144,7 +148,7 @@ describe('modules/manager/npm/post-update/lerna', () => { ); expect(execSnapshots).toMatchObject([ { - cmd: 'docker pull containerbase/sidecar', + cmd: 'docker pull ghcr.io/containerbase/sidecar', }, { cmd: 'docker ps --filter name=renovate_sidecar -aq', @@ -153,9 +157,8 @@ describe('modules/manager/npm/post-update/lerna', () => { cmd: 'docker run --rm --name=renovate_sidecar --label=renovate_child ' + '-v "/tmp/cache":"/tmp/cache" ' + - '-e BUILDPACK_CACHE_DIR ' + '-e CONTAINERBASE_CACHE_DIR ' + - '-w "some-dir" containerbase/sidecar ' + + '-w "some-dir" ghcr.io/containerbase/sidecar ' + 'bash -l -c "' + 'install-tool node 16.16.0 ' + '&& ' + diff --git a/lib/modules/manager/npm/post-update/npm.spec.ts b/lib/modules/manager/npm/post-update/npm.spec.ts index 42d4851b9781e6..833a7ad9b8c3b6 100644 --- a/lib/modules/manager/npm/post-update/npm.spec.ts +++ b/lib/modules/manager/npm/post-update/npm.spec.ts @@ -10,7 +10,7 @@ jest.mock('../../../../util/exec/env'); jest.mock('../../../../util/fs'); jest.mock('./node-version'); -process.env.BUILDPACK = 'true'; +process.env.CONTAINERBASE = 'true'; describe('modules/manager/npm/post-update/npm', () => { beforeEach(() => { @@ -246,6 +246,7 @@ describe('modules/manager/npm/post-update/npm', () => { cacheDir: '/tmp', binarySource: 'docker', allowScripts: true, + dockerSidecarImage: 'ghcr.io/containerbase/sidecar', }); const execSnapshots = mockExecAll(); fs.readLocalFile.mockResolvedValue('package-lock-contents'); @@ -259,16 +260,15 @@ describe('modules/manager/npm/post-update/npm', () => { expect(fs.readLocalFile).toHaveBeenCalledTimes(1); expect(res.lockFile).toBe('package-lock-contents'); expect(execSnapshots).toMatchObject([ - { cmd: 'docker pull containerbase/sidecar' }, + { cmd: 'docker pull ghcr.io/containerbase/sidecar' }, { cmd: 'docker ps --filter name=renovate_sidecar -aq' }, { cmd: 'docker run --rm --name=renovate_sidecar --label=renovate_child ' + '-v "/tmp":"/tmp" ' + - '-e BUILDPACK_CACHE_DIR ' + '-e CONTAINERBASE_CACHE_DIR ' + '-w "some-dir" ' + - 'containerbase/sidecar ' + + 'ghcr.io/containerbase/sidecar ' + 'bash -l -c "' + 'install-tool node 16.16.0 ' + '&& ' + diff --git a/lib/modules/manager/npm/post-update/pnpm.spec.ts b/lib/modules/manager/npm/post-update/pnpm.spec.ts index 5acd7a58a4a63c..adf740f2808e76 100644 --- a/lib/modules/manager/npm/post-update/pnpm.spec.ts +++ b/lib/modules/manager/npm/post-update/pnpm.spec.ts @@ -11,7 +11,7 @@ jest.mock('../../../../util/fs'); jest.mock('./node-version'); delete process.env.NPM_CONFIG_CACHE; -process.env.BUILDPACK = 'true'; +process.env.CONTAINERBASE = 'true'; describe('modules/manager/npm/post-update/pnpm', () => { let config: PostUpdateConfig; @@ -213,6 +213,7 @@ describe('modules/manager/npm/post-update/pnpm', () => { cacheDir: '/tmp', binarySource: 'docker', allowScripts: true, + dockerSidecarImage: 'ghcr.io/containerbase/sidecar', }); const execSnapshots = mockExecAll(); fs.readLocalFile.mockResolvedValue('package-lock-contents'); @@ -224,16 +225,15 @@ describe('modules/manager/npm/post-update/pnpm', () => { expect(fs.readLocalFile).toHaveBeenCalledTimes(1); expect(res.lockFile).toBe('package-lock-contents'); expect(execSnapshots).toMatchObject([ - { cmd: 'docker pull containerbase/sidecar' }, + { cmd: 'docker pull ghcr.io/containerbase/sidecar' }, { cmd: 'docker ps --filter name=renovate_sidecar -aq' }, { cmd: 'docker run --rm --name=renovate_sidecar --label=renovate_child ' + '-v "/tmp":"/tmp" ' + - '-e BUILDPACK_CACHE_DIR ' + '-e CONTAINERBASE_CACHE_DIR ' + '-w "some-dir" ' + - 'containerbase/sidecar ' + + 'ghcr.io/containerbase/sidecar ' + 'bash -l -c "' + 'install-tool node 16.16.0 ' + '&& install-tool pnpm 6.0.0 ' + diff --git a/lib/modules/manager/npm/post-update/yarn.spec.ts b/lib/modules/manager/npm/post-update/yarn.spec.ts index 3a525661942559..fcc70d8ab23566 100644 --- a/lib/modules/manager/npm/post-update/yarn.spec.ts +++ b/lib/modules/manager/npm/post-update/yarn.spec.ts @@ -357,7 +357,7 @@ describe('modules/manager/npm/post-update/yarn', () => { }); it('supports corepack', async () => { - process.env.BUILDPACK = 'true'; + process.env.CONTAINERBASE = 'true'; GlobalConfig.set({ localDir: '.', binarySource: 'install', @@ -403,7 +403,7 @@ describe('modules/manager/npm/post-update/yarn', () => { }); it('supports corepack on grouping', async () => { - process.env.BUILDPACK = 'true'; + process.env.CONTAINERBASE = 'true'; GlobalConfig.set({ localDir: '.', binarySource: 'install', @@ -454,7 +454,7 @@ describe('modules/manager/npm/post-update/yarn', () => { it('uses slim yarn instead of corepack', async () => { // sanity check for later refactorings expect(plocktest1YarnLockV1).toBeTruthy(); - process.env.BUILDPACK = 'true'; + process.env.CONTAINERBASE = 'true'; GlobalConfig.set({ localDir: '.', binarySource: 'install', @@ -536,6 +536,7 @@ describe('modules/manager/npm/post-update/yarn', () => { localDir: '.', binarySource: 'docker', cacheDir: '/tmp/cache', + dockerSidecarImage: 'ghcr.io/containerbase/sidecar', }); Fixtures.mock( { @@ -555,10 +556,10 @@ describe('modules/manager/npm/post-update/yarn', () => { expect(res.lockFile).toBe(plocktest1YarnLockV1); const options = { encoding: 'utf-8' }; expect(execSnapshots).toMatchObject([ - { cmd: 'docker pull containerbase/sidecar', options }, + { cmd: 'docker pull ghcr.io/containerbase/sidecar', options }, { cmd: - `docker run --rm --name=renovate_sidecar --label=renovate_child -v ".":"." -v "/tmp/cache":"/tmp/cache" -e CI -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "some-dir" containerbase/sidecar ` + + `docker run --rm --name=renovate_sidecar --label=renovate_child -v ".":"." -v "/tmp/cache":"/tmp/cache" -e CI -e CONTAINERBASE_CACHE_DIR -w "some-dir" ghcr.io/containerbase/sidecar ` + `bash -l -c "` + `install-tool node 16.16.0` + ` && ` + diff --git a/lib/modules/manager/nuget/artifacts.spec.ts b/lib/modules/manager/nuget/artifacts.spec.ts index 5520b23a89ea87..9d72b820fcab63 100644 --- a/lib/modules/manager/nuget/artifacts.spec.ts +++ b/lib/modules/manager/nuget/artifacts.spec.ts @@ -222,7 +222,11 @@ describe('modules/manager/nuget/artifacts', () => { }); it('supports docker mode', async () => { - GlobalConfig.set({ ...adminConfig, binarySource: 'docker' }); + GlobalConfig.set({ + ...adminConfig, + binarySource: 'docker', + dockerSidecarImage: 'ghcr.io/containerbase/sidecar', + }); const execSnapshots = mockExecAll(); fs.getSiblingFileName.mockReturnValueOnce('packages.lock.json'); git.getFiles.mockResolvedValueOnce({ @@ -249,7 +253,7 @@ describe('modules/manager/nuget/artifacts', () => { ]); expect(execSnapshots).toMatchObject([ { - cmd: 'docker pull containerbase/sidecar', + cmd: 'docker pull ghcr.io/containerbase/sidecar', }, { cmd: 'docker ps --filter name=renovate_sidecar -aq', @@ -261,10 +265,9 @@ describe('modules/manager/nuget/artifacts', () => { '-v "/tmp/renovate/cache":"/tmp/renovate/cache" ' + '-e NUGET_PACKAGES ' + '-e MSBUILDDISABLENODEREUSE ' + - '-e BUILDPACK_CACHE_DIR ' + '-e CONTAINERBASE_CACHE_DIR ' + '-w "/tmp/github/some/repo" ' + - 'containerbase/sidecar ' + + 'ghcr.io/containerbase/sidecar ' + 'bash -l -c "' + 'install-tool dotnet 7.0.100' + ' && ' + @@ -272,7 +275,6 @@ describe('modules/manager/nuget/artifacts', () => { '"', options: { env: { - BUILDPACK_CACHE_DIR: '/tmp/renovate/cache/containerbase', CONTAINERBASE_CACHE_DIR: '/tmp/renovate/cache/containerbase', NUGET_PACKAGES: '/tmp/renovate/cache/__renovate-private-cache/nuget/packages', @@ -315,7 +317,6 @@ describe('modules/manager/nuget/artifacts', () => { options: { cwd: '/tmp/github/some/repo', env: { - BUILDPACK_CACHE_DIR: '/tmp/renovate/cache/containerbase', CONTAINERBASE_CACHE_DIR: '/tmp/renovate/cache/containerbase', NUGET_PACKAGES: '/tmp/renovate/cache/__renovate-private-cache/nuget/packages', @@ -328,7 +329,6 @@ describe('modules/manager/nuget/artifacts', () => { options: { cwd: '/tmp/github/some/repo', env: { - BUILDPACK_CACHE_DIR: '/tmp/renovate/cache/containerbase', CONTAINERBASE_CACHE_DIR: '/tmp/renovate/cache/containerbase', NUGET_PACKAGES: '/tmp/renovate/cache/__renovate-private-cache/nuget/packages', diff --git a/lib/modules/manager/nuget/index.ts b/lib/modules/manager/nuget/index.ts index c34ca3a67d8e78..88e1ccdc01066b 100644 --- a/lib/modules/manager/nuget/index.ts +++ b/lib/modules/manager/nuget/index.ts @@ -1,4 +1,4 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { DotnetVersionDatasource } from '../../datasource/dotnet-version'; import { NugetDatasource } from '../../datasource/nuget'; @@ -6,8 +6,6 @@ export { extractPackageFile } from './extract'; export { updateArtifacts } from './artifacts'; export { bumpPackageVersion } from './update'; -export const language: ProgrammingLanguage = 'dotnet'; - export const defaultConfig = { fileMatch: [ '\\.(?:cs|fs|vb)proj$', @@ -17,6 +15,8 @@ export const defaultConfig = { ], }; +export const categories: Category[] = ['dotnet']; + export const supportedDatasources = [ DotnetVersionDatasource.id, NugetDatasource.id, diff --git a/lib/modules/manager/nvm/index.ts b/lib/modules/manager/nvm/index.ts index 0c9001f40c0a3b..0354ac17c1a358 100644 --- a/lib/modules/manager/nvm/index.ts +++ b/lib/modules/manager/nvm/index.ts @@ -1,4 +1,4 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { GithubTagsDatasource } from '../../datasource/github-tags'; import * as nodeVersioning from '../../versioning/node'; @@ -7,12 +7,12 @@ export { extractPackageFile } from './extract'; export const displayName = 'nvm'; export const url = 'https://github.com/nvm-sh/nvm'; -export const language: ProgrammingLanguage = 'node'; - export const defaultConfig = { fileMatch: ['(^|/)\\.nvmrc$'], versioning: nodeVersioning.id, pinDigests: false, }; +export const categories: Category[] = ['js', 'node']; + export const supportedDatasources = [GithubTagsDatasource.id]; diff --git a/lib/modules/manager/osgi/index.ts b/lib/modules/manager/osgi/index.ts index 3fc0a553f3032b..01c8aaba95c8aa 100644 --- a/lib/modules/manager/osgi/index.ts +++ b/lib/modules/manager/osgi/index.ts @@ -1,10 +1,7 @@ -import type { ProgrammingLanguage } from '../../../constants'; import { MavenDatasource } from '../../datasource/maven'; export { extractPackageFile } from './extract'; -export const language: ProgrammingLanguage = 'java'; - export const defaultConfig = { fileMatch: ['(^|/)src/main/features/.+\\.json$'], }; diff --git a/lib/modules/manager/pep621/artifacts.spec.ts b/lib/modules/manager/pep621/artifacts.spec.ts index d28645cf794350..a5b8fcd55a028b 100644 --- a/lib/modules/manager/pep621/artifacts.spec.ts +++ b/lib/modules/manager/pep621/artifacts.spec.ts @@ -58,7 +58,11 @@ describe('modules/manager/pep621/artifacts', () => { it('return processor result', async () => { const execSnapshots = mockExecAll(); - GlobalConfig.set({ ...adminConfig, binarySource: 'docker' }); + GlobalConfig.set({ + ...adminConfig, + binarySource: 'docker', + dockerSidecarImage: 'ghcr.io/containerbase/sidecar', + }); fs.getSiblingFileName.mockReturnValueOnce('pdm.lock'); fs.readLocalFile.mockResolvedValueOnce('old test content'); fs.readLocalFile.mockResolvedValueOnce('new test content'); @@ -98,7 +102,7 @@ requires-python = "<3.9" ]); expect(execSnapshots).toMatchObject([ { - cmd: 'docker pull containerbase/sidecar', + cmd: 'docker pull ghcr.io/containerbase/sidecar', options: { encoding: 'utf-8', }, @@ -114,10 +118,9 @@ requires-python = "<3.9" 'docker run --rm --name=renovate_sidecar --label=renovate_child ' + '-v "/tmp/github/some/repo":"/tmp/github/some/repo" ' + '-v "/tmp/cache":"/tmp/cache" ' + - '-e BUILDPACK_CACHE_DIR ' + '-e CONTAINERBASE_CACHE_DIR ' + '-w "/tmp/github/some/repo" ' + - 'containerbase/sidecar ' + + 'ghcr.io/containerbase/sidecar ' + 'bash -l -c "' + 'install-tool python 3.8.1 ' + '&& ' + @@ -129,7 +132,6 @@ requires-python = "<3.9" cwd: '/tmp/github/some/repo', encoding: 'utf-8', env: { - BUILDPACK_CACHE_DIR: '/tmp/cache/containerbase', CONTAINERBASE_CACHE_DIR: '/tmp/cache/containerbase', }, }, diff --git a/lib/modules/manager/pep621/processors/pdm.spec.ts b/lib/modules/manager/pep621/processors/pdm.spec.ts index 4e1c77a1f4ae4c..92b7127c3a9640 100644 --- a/lib/modules/manager/pep621/processors/pdm.spec.ts +++ b/lib/modules/manager/pep621/processors/pdm.spec.ts @@ -41,7 +41,11 @@ describe('modules/manager/pep621/processors/pdm', () => { it('return null if the lock file is unchanged', async () => { const execSnapshots = mockExecAll(); - GlobalConfig.set({ ...adminConfig, binarySource: 'docker' }); + GlobalConfig.set({ + ...adminConfig, + binarySource: 'docker', + dockerSidecarImage: 'ghcr.io/containerbase/sidecar', + }); fs.getSiblingFileName.mockReturnValueOnce('pdm.lock'); fs.readLocalFile.mockResolvedValueOnce('test content'); fs.readLocalFile.mockResolvedValueOnce('test content'); @@ -67,7 +71,7 @@ describe('modules/manager/pep621/processors/pdm', () => { expect(result).toBeNull(); expect(execSnapshots).toMatchObject([ { - cmd: 'docker pull containerbase/sidecar', + cmd: 'docker pull ghcr.io/containerbase/sidecar', }, { cmd: 'docker ps --filter name=renovate_sidecar -aq', @@ -77,10 +81,9 @@ describe('modules/manager/pep621/processors/pdm', () => { 'docker run --rm --name=renovate_sidecar --label=renovate_child ' + '-v "/tmp/github/some/repo":"/tmp/github/some/repo" ' + '-v "/tmp/cache":"/tmp/cache" ' + - '-e BUILDPACK_CACHE_DIR ' + '-e CONTAINERBASE_CACHE_DIR ' + '-w "/tmp/github/some/repo" ' + - 'containerbase/sidecar ' + + 'ghcr.io/containerbase/sidecar ' + 'bash -l -c "' + 'install-tool python 3.11.2 ' + '&& ' + diff --git a/lib/modules/manager/pip-compile/artifacts.spec.ts b/lib/modules/manager/pip-compile/artifacts.spec.ts index b410cbce2a310b..a9fc034e8425f2 100644 --- a/lib/modules/manager/pip-compile/artifacts.spec.ts +++ b/lib/modules/manager/pip-compile/artifacts.spec.ts @@ -27,9 +27,13 @@ const adminConfig: RepoGlobalConfig = { cacheDir: join('/tmp/renovate/cache'), containerbaseDir: join('/tmp/renovate/cache/containerbase'), }; -const dockerAdminConfig = { ...adminConfig, binarySource: 'docker' }; +const dockerAdminConfig = { + ...adminConfig, + binarySource: 'docker', + dockerSidecarImage: 'ghcr.io/containerbase/sidecar', +}; -process.env.BUILDPACK = 'true'; +process.env.CONTAINERBASE = 'true'; const config: UpdateArtifactsConfig = {}; const lockMaintenanceConfig = { ...config, isLockFileMaintenance: true }; @@ -122,7 +126,7 @@ describe('modules/manager/pip-compile/artifacts', () => { ).not.toBeNull(); expect(execSnapshots).toMatchObject([ - { cmd: 'docker pull containerbase/sidecar' }, + { cmd: 'docker pull ghcr.io/containerbase/sidecar' }, { cmd: 'docker ps --filter name=renovate_sidecar -aq' }, { cmd: @@ -130,10 +134,9 @@ describe('modules/manager/pip-compile/artifacts', () => { '-v "/tmp/github/some/repo":"/tmp/github/some/repo" ' + '-v "/tmp/renovate/cache":"/tmp/renovate/cache" ' + '-e PIP_CACHE_DIR ' + - '-e BUILDPACK_CACHE_DIR ' + '-e CONTAINERBASE_CACHE_DIR ' + '-w "/tmp/github/some/repo" ' + - 'containerbase/sidecar ' + + 'ghcr.io/containerbase/sidecar ' + 'bash -l -c "' + 'install-tool python 3.10.2 ' + '&& ' + @@ -247,7 +250,7 @@ describe('modules/manager/pip-compile/artifacts', () => { ).not.toBeNull(); expect(execSnapshots).toMatchObject([ - { cmd: 'docker pull containerbase/sidecar' }, + { cmd: 'docker pull ghcr.io/containerbase/sidecar' }, { cmd: 'docker ps --filter name=renovate_sidecar -aq' }, { cmd: @@ -255,10 +258,9 @@ describe('modules/manager/pip-compile/artifacts', () => { '-v "/tmp/github/some/repo":"/tmp/github/some/repo" ' + '-v "/tmp/renovate/cache":"/tmp/renovate/cache" ' + '-e PIP_CACHE_DIR ' + - '-e BUILDPACK_CACHE_DIR ' + '-e CONTAINERBASE_CACHE_DIR ' + '-w "/tmp/github/some/repo" ' + - 'containerbase/sidecar ' + + 'ghcr.io/containerbase/sidecar ' + 'bash -l -c "' + 'install-tool python 3.10.2 ' + '&& ' + diff --git a/lib/modules/manager/pip-compile/index.ts b/lib/modules/manager/pip-compile/index.ts index fdde176cb50f34..dac650f2bcb360 100644 --- a/lib/modules/manager/pip-compile/index.ts +++ b/lib/modules/manager/pip-compile/index.ts @@ -1,10 +1,9 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { PypiDatasource } from '../../datasource/pypi'; export { extractPackageFile } from '../pip_requirements/extract'; export { updateArtifacts } from './artifacts'; -export const language: ProgrammingLanguage = 'python'; export const supportsLockFileMaintenance = true; export const supportedDatasources = [PypiDatasource.id]; @@ -17,3 +16,5 @@ export const defaultConfig = { commitMessageAction: 'Refresh pip-compile outputs', }, }; + +export const categories: Category[] = ['python']; diff --git a/lib/modules/manager/pip_requirements/artifacts.spec.ts b/lib/modules/manager/pip_requirements/artifacts.spec.ts index adaeacf6d35df9..78ed52537de467 100644 --- a/lib/modules/manager/pip_requirements/artifacts.spec.ts +++ b/lib/modules/manager/pip_requirements/artifacts.spec.ts @@ -13,7 +13,7 @@ jest.mock('../../../util/exec/common'); jest.mock('../../../util/fs'); jest.mock('../../datasource'); -process.env.BUILDPACK = 'true'; +process.env.CONTAINERBASE = 'true'; const adminConfig: RepoGlobalConfig = { // `join` fixes Windows CI @@ -187,7 +187,11 @@ describe('modules/manager/pip_requirements/artifacts', () => { }); it('supports docker mode', async () => { - GlobalConfig.set({ ...adminConfig, binarySource: 'docker' }); + GlobalConfig.set({ + ...adminConfig, + binarySource: 'docker', + dockerSidecarImage: 'ghcr.io/containerbase/sidecar', + }); fs.readLocalFile.mockResolvedValueOnce('new content'); fs.ensureCacheDir.mockResolvedValueOnce('/tmp/cache'); // hashin @@ -214,7 +218,7 @@ describe('modules/manager/pip_requirements/artifacts', () => { ]); expect(execSnapshots).toMatchObject([ - { cmd: 'docker pull containerbase/sidecar' }, + { cmd: 'docker pull ghcr.io/containerbase/sidecar' }, { cmd: 'docker ps --filter name=renovate_sidecar -aq' }, { cmd: @@ -222,10 +226,9 @@ describe('modules/manager/pip_requirements/artifacts', () => { '-v "/tmp/github/some/repo":"/tmp/github/some/repo" ' + '-v "/tmp/renovate/cache":"/tmp/renovate/cache" ' + '-e PIP_CACHE_DIR ' + - '-e BUILDPACK_CACHE_DIR ' + '-e CONTAINERBASE_CACHE_DIR ' + '-w "/tmp/github/some/repo" ' + - 'containerbase/sidecar ' + + 'ghcr.io/containerbase/sidecar ' + 'bash -l -c "' + 'install-tool python 3.10.2 ' + '&& ' + diff --git a/lib/modules/manager/pip_requirements/index.ts b/lib/modules/manager/pip_requirements/index.ts index 6140bdd15f788d..537d4a510fef25 100644 --- a/lib/modules/manager/pip_requirements/index.ts +++ b/lib/modules/manager/pip_requirements/index.ts @@ -1,14 +1,14 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { GitTagsDatasource } from '../../datasource/git-tags'; import { PypiDatasource } from '../../datasource/pypi'; export { updateArtifacts } from './artifacts'; export { extractPackageFile } from './extract'; -export const language: ProgrammingLanguage = 'python'; - export const defaultConfig = { fileMatch: ['(^|/)[\\w-]*requirements(-\\w+)?\\.(txt|pip)$'], }; +export const categories: Category[] = ['python']; + export const supportedDatasources = [PypiDatasource.id, GitTagsDatasource.id]; diff --git a/lib/modules/manager/pip_setup/index.ts b/lib/modules/manager/pip_setup/index.ts index 0e3a926f9cc0f4..e71fb6f9d2199d 100644 --- a/lib/modules/manager/pip_setup/index.ts +++ b/lib/modules/manager/pip_setup/index.ts @@ -1,12 +1,12 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { PypiDatasource } from '../../datasource/pypi'; export { extractPackageFile } from './extract'; -export const language: ProgrammingLanguage = 'python'; - export const defaultConfig = { fileMatch: ['(^|/)setup\\.py$'], }; +export const categories: Category[] = ['python']; + export const supportedDatasources = [PypiDatasource.id]; diff --git a/lib/modules/manager/pipenv/__snapshots__/artifacts.spec.ts.snap b/lib/modules/manager/pipenv/__snapshots__/artifacts.spec.ts.snap index 184fb21b84520b..d08dc91b55db39 100644 --- a/lib/modules/manager/pipenv/__snapshots__/artifacts.spec.ts.snap +++ b/lib/modules/manager/pipenv/__snapshots__/artifacts.spec.ts.snap @@ -99,7 +99,7 @@ exports[`modules/manager/pipenv/artifacts returns updated Pipfile.lock 1`] = ` exports[`modules/manager/pipenv/artifacts supports docker mode 1`] = ` [ { - "cmd": "docker pull containerbase/sidecar", + "cmd": "docker pull ghcr.io/containerbase/sidecar", "options": { "encoding": "utf-8", }, @@ -111,12 +111,11 @@ exports[`modules/manager/pipenv/artifacts supports docker mode 1`] = ` }, }, { - "cmd": "docker run --rm --name=renovate_sidecar --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/renovate/cache":"/tmp/renovate/cache" -e PIPENV_CACHE_DIR -e PIP_CACHE_DIR -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "/tmp/github/some/repo" containerbase/sidecar bash -l -c "install-tool python 3.7.6 && install-tool pipenv 2023.1.2 && pipenv lock"", + "cmd": "docker run --rm --name=renovate_sidecar --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/renovate/cache":"/tmp/renovate/cache" -e PIPENV_CACHE_DIR -e PIP_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "/tmp/github/some/repo" ghcr.io/containerbase/sidecar bash -l -c "install-tool python 3.7.6 && install-tool pipenv 2023.1.2 && pipenv lock"", "options": { "cwd": "/tmp/github/some/repo", "encoding": "utf-8", "env": { - "BUILDPACK_CACHE_DIR": "/tmp/renovate/cache/containerbase", "CONTAINERBASE_CACHE_DIR": "/tmp/renovate/cache/containerbase", "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", @@ -138,7 +137,7 @@ exports[`modules/manager/pipenv/artifacts supports docker mode 1`] = ` exports[`modules/manager/pipenv/artifacts uses pipenv version from Pipfile 1`] = ` [ { - "cmd": "docker pull containerbase/sidecar", + "cmd": "docker pull ghcr.io/containerbase/sidecar", "options": { "encoding": "utf-8", }, @@ -150,12 +149,11 @@ exports[`modules/manager/pipenv/artifacts uses pipenv version from Pipfile 1`] = }, }, { - "cmd": "docker run --rm --name=renovate_sidecar --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/renovate/cache":"/tmp/renovate/cache" -e PIPENV_CACHE_DIR -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "/tmp/github/some/repo" containerbase/sidecar bash -l -c "install-tool python 3.10.2 && install-tool pipenv 2020.8.13 && pipenv lock"", + "cmd": "docker run --rm --name=renovate_sidecar --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/renovate/cache":"/tmp/renovate/cache" -e PIPENV_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "/tmp/github/some/repo" ghcr.io/containerbase/sidecar bash -l -c "install-tool python 3.10.2 && install-tool pipenv 2020.8.13 && pipenv lock"", "options": { "cwd": "/tmp/github/some/repo", "encoding": "utf-8", "env": { - "BUILDPACK_CACHE_DIR": "/tmp/renovate/cache/containerbase", "CONTAINERBASE_CACHE_DIR": "/tmp/renovate/cache/containerbase", "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", @@ -176,7 +174,7 @@ exports[`modules/manager/pipenv/artifacts uses pipenv version from Pipfile 1`] = exports[`modules/manager/pipenv/artifacts uses pipenv version from Pipfile dev packages 1`] = ` [ { - "cmd": "docker pull containerbase/sidecar", + "cmd": "docker pull ghcr.io/containerbase/sidecar", "options": { "encoding": "utf-8", }, @@ -188,12 +186,11 @@ exports[`modules/manager/pipenv/artifacts uses pipenv version from Pipfile dev p }, }, { - "cmd": "docker run --rm --name=renovate_sidecar --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/renovate/cache":"/tmp/renovate/cache" -e PIPENV_CACHE_DIR -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "/tmp/github/some/repo" containerbase/sidecar bash -l -c "install-tool python 3.10.2 && install-tool pipenv 2020.8.13 && pipenv lock"", + "cmd": "docker run --rm --name=renovate_sidecar --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/renovate/cache":"/tmp/renovate/cache" -e PIPENV_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "/tmp/github/some/repo" ghcr.io/containerbase/sidecar bash -l -c "install-tool python 3.10.2 && install-tool pipenv 2020.8.13 && pipenv lock"", "options": { "cwd": "/tmp/github/some/repo", "encoding": "utf-8", "env": { - "BUILDPACK_CACHE_DIR": "/tmp/renovate/cache/containerbase", "CONTAINERBASE_CACHE_DIR": "/tmp/renovate/cache/containerbase", "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", @@ -214,7 +211,7 @@ exports[`modules/manager/pipenv/artifacts uses pipenv version from Pipfile dev p exports[`modules/manager/pipenv/artifacts uses pipenv version from config 1`] = ` [ { - "cmd": "docker pull containerbase/sidecar", + "cmd": "docker pull ghcr.io/containerbase/sidecar", "options": { "encoding": "utf-8", }, @@ -226,12 +223,11 @@ exports[`modules/manager/pipenv/artifacts uses pipenv version from config 1`] = }, }, { - "cmd": "docker run --rm --name=renovate_sidecar --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/renovate/cache":"/tmp/renovate/cache" -e PIPENV_CACHE_DIR -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "/tmp/github/some/repo" containerbase/sidecar bash -l -c "install-tool python 3.10.2 && install-tool pipenv 2020.1.1 && pipenv lock"", + "cmd": "docker run --rm --name=renovate_sidecar --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/renovate/cache":"/tmp/renovate/cache" -e PIPENV_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "/tmp/github/some/repo" ghcr.io/containerbase/sidecar bash -l -c "install-tool python 3.10.2 && install-tool pipenv 2020.1.1 && pipenv lock"", "options": { "cwd": "/tmp/github/some/repo", "encoding": "utf-8", "env": { - "BUILDPACK_CACHE_DIR": "/tmp/renovate/cache/containerbase", "CONTAINERBASE_CACHE_DIR": "/tmp/renovate/cache/containerbase", "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", diff --git a/lib/modules/manager/pipenv/artifacts.spec.ts b/lib/modules/manager/pipenv/artifacts.spec.ts index 5f8d14acd0be4c..0cea65686f7720 100644 --- a/lib/modules/manager/pipenv/artifacts.spec.ts +++ b/lib/modules/manager/pipenv/artifacts.spec.ts @@ -26,7 +26,7 @@ jest.mock('../../../util/host-rules'); jest.mock('../../../util/http'); jest.mock('../../datasource'); -process.env.BUILDPACK = 'true'; +process.env.CONTAINERBASE = 'true'; const getPkgReleases = mockedFunction(_getPkgReleases); @@ -36,7 +36,11 @@ const adminConfig: RepoGlobalConfig = { cacheDir: join('/tmp/renovate/cache'), containerbaseDir: join('/tmp/renovate/cache/containerbase'), }; -const dockerAdminConfig = { ...adminConfig, binarySource: 'docker' }; +const dockerAdminConfig = { + ...adminConfig, + binarySource: 'docker', + dockerSidecarImage: 'ghcr.io/containerbase/sidecar', +}; const config: UpdateArtifactsConfig = {}; const lockMaintenanceConfig = { ...config, isLockFileMaintenance: true }; diff --git a/lib/modules/manager/pipenv/index.ts b/lib/modules/manager/pipenv/index.ts index 857579477d700f..3635d76857ce44 100644 --- a/lib/modules/manager/pipenv/index.ts +++ b/lib/modules/manager/pipenv/index.ts @@ -1,10 +1,9 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { PypiDatasource } from '../../datasource/pypi'; export { extractPackageFile } from './extract'; export { updateArtifacts } from './artifacts'; -export const language: ProgrammingLanguage = 'python'; export const supportsLockFileMaintenance = true; export const supportedDatasources = [PypiDatasource.id]; @@ -12,3 +11,5 @@ export const supportedDatasources = [PypiDatasource.id]; export const defaultConfig = { fileMatch: ['(^|/)Pipfile$'], }; + +export const categories: Category[] = ['python']; diff --git a/lib/modules/manager/poetry/artifacts.spec.ts b/lib/modules/manager/poetry/artifacts.spec.ts index 67cc4098f841dd..72d2f8023a15e6 100644 --- a/lib/modules/manager/poetry/artifacts.spec.ts +++ b/lib/modules/manager/poetry/artifacts.spec.ts @@ -19,7 +19,7 @@ jest.mock('../../../util/fs'); jest.mock('../../datasource'); jest.mock('../../../util/host-rules'); -process.env.BUILDPACK = 'true'; +process.env.CONTAINERBASE = 'true'; const datasource = mocked(_datasource); const hostRules = mocked(_hostRules); @@ -250,7 +250,11 @@ describe('modules/manager/poetry/artifacts', () => { }); it('returns updated poetry.lock using docker', async () => { - GlobalConfig.set({ ...adminConfig, binarySource: 'docker' }); + GlobalConfig.set({ + ...adminConfig, + binarySource: 'docker', + dockerSidecarImage: 'ghcr.io/containerbase/sidecar', + }); const execSnapshots = mockExecAll(); fs.ensureCacheDir.mockResolvedValueOnce('/tmp/renovate/cache/others/pip'); // poetry.lock @@ -288,7 +292,7 @@ describe('modules/manager/poetry/artifacts', () => { }, ]); expect(execSnapshots).toMatchObject([ - { cmd: 'docker pull containerbase/sidecar' }, + { cmd: 'docker pull ghcr.io/containerbase/sidecar' }, { cmd: 'docker ps --filter name=renovate_sidecar -aq' }, { cmd: @@ -296,10 +300,9 @@ describe('modules/manager/poetry/artifacts', () => { '-v "/tmp/github/some/repo":"/tmp/github/some/repo" ' + '-v "/tmp/cache":"/tmp/cache" ' + '-e PIP_CACHE_DIR ' + - '-e BUILDPACK_CACHE_DIR ' + '-e CONTAINERBASE_CACHE_DIR ' + '-w "/tmp/github/some/repo" ' + - 'containerbase/sidecar ' + + 'ghcr.io/containerbase/sidecar ' + 'bash -l -c "' + 'install-tool python 3.4.2 ' + '&& ' + @@ -312,7 +315,11 @@ describe('modules/manager/poetry/artifacts', () => { }); it('returns updated poetry.lock using docker (constraints)', async () => { - GlobalConfig.set({ ...adminConfig, binarySource: 'docker' }); + GlobalConfig.set({ + ...adminConfig, + binarySource: 'docker', + dockerSidecarImage: 'ghcr.io/containerbase/sidecar', + }); const execSnapshots = mockExecAll(); fs.ensureCacheDir.mockResolvedValueOnce('/tmp/renovate/cache/others/pip'); @@ -351,7 +358,7 @@ describe('modules/manager/poetry/artifacts', () => { }, ]); expect(execSnapshots).toMatchObject([ - { cmd: 'docker pull containerbase/sidecar' }, + { cmd: 'docker pull ghcr.io/containerbase/sidecar' }, { cmd: 'docker ps --filter name=renovate_sidecar -aq' }, { cmd: @@ -359,10 +366,9 @@ describe('modules/manager/poetry/artifacts', () => { '-v "/tmp/github/some/repo":"/tmp/github/some/repo" ' + '-v "/tmp/cache":"/tmp/cache" ' + '-e PIP_CACHE_DIR ' + - '-e BUILDPACK_CACHE_DIR ' + '-e CONTAINERBASE_CACHE_DIR ' + '-w "/tmp/github/some/repo" ' + - 'containerbase/sidecar ' + + 'ghcr.io/containerbase/sidecar ' + 'bash -l -c "' + 'install-tool python 2.7.5 ' + '&& ' + diff --git a/lib/modules/manager/poetry/index.ts b/lib/modules/manager/poetry/index.ts index 3655fea38af505..1ad1b191287503 100644 --- a/lib/modules/manager/poetry/index.ts +++ b/lib/modules/manager/poetry/index.ts @@ -1,4 +1,4 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { GithubTagsDatasource } from '../../datasource/github-tags'; import { PypiDatasource } from '../../datasource/pypi'; @@ -11,9 +11,10 @@ export const supportedDatasources = [ GithubTagsDatasource.id, ]; -export const language: ProgrammingLanguage = 'python'; export const supportsLockFileMaintenance = true; export const defaultConfig = { fileMatch: ['(^|/)pyproject\\.toml$'], }; + +export const categories: Category[] = ['python']; diff --git a/lib/modules/manager/pub/artifacts.spec.ts b/lib/modules/manager/pub/artifacts.spec.ts index af46405b091b6e..2ae1fb8bb7803f 100644 --- a/lib/modules/manager/pub/artifacts.spec.ts +++ b/lib/modules/manager/pub/artifacts.spec.ts @@ -14,7 +14,7 @@ jest.mock('../../../util/git'); jest.mock('../../../util/http'); jest.mock('../../datasource'); -process.env.BUILDPACK = 'true'; +process.env.CONTAINERBASE = 'true'; const lockFile = 'pubspec.lock'; const oldLockFileContent = 'Old pubspec.lock'; @@ -141,7 +141,11 @@ describe('modules/manager/pub/artifacts', () => { }); it(`supports ${params.sdk} docker mode`, async () => { - GlobalConfig.set({ ...adminConfig, binarySource: 'docker' }); + GlobalConfig.set({ + ...adminConfig, + binarySource: 'docker', + dockerSidecarImage: 'ghcr.io/containerbase/sidecar', + }); const execSnapshots = mockExecAll(); fs.getSiblingFileName.mockReturnValueOnce(lockFile); fs.readLocalFile.mockResolvedValueOnce(oldLockFileContent); @@ -162,7 +166,7 @@ describe('modules/manager/pub/artifacts', () => { ]); expect(execSnapshots).toMatchObject([ { - cmd: 'docker pull containerbase/sidecar', + cmd: 'docker pull ghcr.io/containerbase/sidecar', }, { cmd: 'docker ps --filter name=renovate_sidecar -aq', @@ -172,10 +176,9 @@ describe('modules/manager/pub/artifacts', () => { 'docker run --rm --name=renovate_sidecar --label=renovate_child ' + '-v "/tmp/github/some/repo":"/tmp/github/some/repo" ' + '-v "/tmp/cache":"/tmp/cache" ' + - '-e BUILDPACK_CACHE_DIR ' + '-e CONTAINERBASE_CACHE_DIR ' + '-w "/tmp/github/some/repo" ' + - 'containerbase/sidecar ' + + 'ghcr.io/containerbase/sidecar ' + 'bash -l -c "' + `install-tool ${params.sdk} 3.3.9` + ' && ' + diff --git a/lib/modules/manager/pub/index.ts b/lib/modules/manager/pub/index.ts index 898e82a42a2b6a..dd4c435815d638 100644 --- a/lib/modules/manager/pub/index.ts +++ b/lib/modules/manager/pub/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { DartDatasource } from '../../datasource/dart'; import * as npmVersioning from '../../versioning/npm'; @@ -11,3 +12,5 @@ export const defaultConfig = { fileMatch: ['(^|/)pubspec\\.ya?ml$'], versioning: npmVersioning.id, }; + +export const categories: Category[] = ['dart']; diff --git a/lib/modules/manager/puppet/index.ts b/lib/modules/manager/puppet/index.ts index 2b0735bb4c4c93..f88158741b01ad 100644 --- a/lib/modules/manager/puppet/index.ts +++ b/lib/modules/manager/puppet/index.ts @@ -1,16 +1,16 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { GitTagsDatasource } from '../../datasource/git-tags'; import { GithubTagsDatasource } from '../../datasource/github-tags'; import { PuppetForgeDatasource } from '../../datasource/puppet-forge'; export { extractPackageFile } from './extract'; -export const language: ProgrammingLanguage = 'ruby'; - export const defaultConfig = { fileMatch: ['(^|/)Puppetfile$'], }; +export const categories: Category[] = ['iac', 'ruby']; + export const supportedDatasources = [ PuppetForgeDatasource.id, GithubTagsDatasource.id, diff --git a/lib/modules/manager/pyenv/index.ts b/lib/modules/manager/pyenv/index.ts index 59d75f11cd74c8..12b668b638caca 100644 --- a/lib/modules/manager/pyenv/index.ts +++ b/lib/modules/manager/pyenv/index.ts @@ -1,14 +1,14 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { DockerDatasource } from '../../datasource/docker'; import * as dockerVersioning from '../../versioning/docker'; export { extractPackageFile } from './extract'; -export const language: ProgrammingLanguage = 'python'; - export const supportedDatasources = [DockerDatasource.id]; export const defaultConfig = { fileMatch: ['(^|/)\\.python-version$'], versioning: dockerVersioning.id, }; + +export const categories: Category[] = ['python']; diff --git a/lib/modules/manager/ruby-version/index.ts b/lib/modules/manager/ruby-version/index.ts index 68eaee26ae1947..ad8aabd5dbd393 100644 --- a/lib/modules/manager/ruby-version/index.ts +++ b/lib/modules/manager/ruby-version/index.ts @@ -1,4 +1,4 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { RubyVersionDatasource } from '../../datasource/ruby-version'; import * as rubyVersioning from '../../versioning/ruby'; @@ -6,9 +6,9 @@ export { extractPackageFile } from './extract'; export const supportedDatasources = [RubyVersionDatasource.id]; -export const language: ProgrammingLanguage = 'ruby'; - export const defaultConfig = { fileMatch: ['(^|/)\\.ruby-version$'], versioning: rubyVersioning.id, }; + +export const categories: Category[] = ['ruby']; diff --git a/lib/modules/manager/sbt/index.ts b/lib/modules/manager/sbt/index.ts index 111c1e52e5da6b..6465410fd615db 100644 --- a/lib/modules/manager/sbt/index.ts +++ b/lib/modules/manager/sbt/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { GithubReleasesDatasource } from '../../datasource/github-releases'; import { MavenDatasource } from '../../datasource/maven'; import { SbtPackageDatasource } from '../../datasource/sbt-package'; @@ -22,3 +23,5 @@ export const defaultConfig = { ], versioning: ivyVersioning.id, }; + +export const categories: Category[] = ['java']; diff --git a/lib/modules/manager/setup-cfg/index.ts b/lib/modules/manager/setup-cfg/index.ts index c8b40c2a0c7238..b8c603b797d205 100644 --- a/lib/modules/manager/setup-cfg/index.ts +++ b/lib/modules/manager/setup-cfg/index.ts @@ -1,4 +1,4 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { PypiDatasource } from '../../datasource/pypi'; import { id as versioning } from '../../versioning/pep440'; @@ -6,9 +6,9 @@ export { extractPackageFile } from './extract'; export const supportedDatasources = [PypiDatasource.id]; -export const language: ProgrammingLanguage = 'python'; - export const defaultConfig = { fileMatch: ['(^|/)setup\\.cfg$'], versioning, }; + +export const categories: Category[] = ['python']; diff --git a/lib/modules/manager/swift/index.ts b/lib/modules/manager/swift/index.ts index bbb83400ecc243..dbabb946047174 100644 --- a/lib/modules/manager/swift/index.ts +++ b/lib/modules/manager/swift/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { GitTagsDatasource } from '../../datasource/git-tags'; import * as swiftVersioning from '../../versioning/swift'; @@ -14,3 +15,5 @@ export const defaultConfig = { versioning: swiftVersioning.id, pinDigests: false, }; + +export const categories: Category[] = ['swift']; diff --git a/lib/modules/manager/tekton/index.ts b/lib/modules/manager/tekton/index.ts index d68cf8e0703bb8..a578c6f00619c3 100644 --- a/lib/modules/manager/tekton/index.ts +++ b/lib/modules/manager/tekton/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { DockerDatasource } from '../../datasource/docker'; import { extractPackageFile } from './extract'; @@ -5,6 +6,8 @@ export const defaultConfig = { fileMatch: [], }; +export const categories: Category[] = ['ci', 'cd']; + export const supportedDatasources = [DockerDatasource.id]; export { extractPackageFile }; diff --git a/lib/modules/manager/terraform-version/index.ts b/lib/modules/manager/terraform-version/index.ts index 0f753ba3af3818..bd91323f4bc444 100644 --- a/lib/modules/manager/terraform-version/index.ts +++ b/lib/modules/manager/terraform-version/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { GithubReleasesDatasource } from '../../datasource/github-releases'; import * as hashicorpVersioning from '../../versioning/hashicorp'; @@ -10,3 +11,5 @@ export const defaultConfig = { versioning: hashicorpVersioning.id, extractVersion: '^v(?.*)$', }; + +export const categories: Category[] = ['terraform']; diff --git a/lib/modules/manager/terraform/index.ts b/lib/modules/manager/terraform/index.ts index d429e781909add..1e67fe9d78d8af 100644 --- a/lib/modules/manager/terraform/index.ts +++ b/lib/modules/manager/terraform/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { BitbucketTagsDatasource } from '../../datasource/bitbucket-tags'; import { DockerDatasource } from '../../datasource/docker'; import { GitTagsDatasource } from '../../datasource/git-tags'; @@ -28,3 +29,5 @@ export const defaultConfig = { fileMatch: ['\\.tf$'], pinDigests: false, }; + +export const categories: Category[] = ['iac', 'terraform']; diff --git a/lib/modules/manager/terragrunt-version/index.ts b/lib/modules/manager/terragrunt-version/index.ts index a1286d9721980d..2e5225ea0b9f99 100644 --- a/lib/modules/manager/terragrunt-version/index.ts +++ b/lib/modules/manager/terragrunt-version/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { GithubReleasesDatasource } from '../../datasource/github-releases'; import * as hashicorpVersioning from '../../versioning/hashicorp'; @@ -10,3 +11,5 @@ export const defaultConfig = { versioning: hashicorpVersioning.id, extractVersion: '^v(?.+)$', }; + +export const categories: Category[] = ['terraform']; diff --git a/lib/modules/manager/terragrunt/index.ts b/lib/modules/manager/terragrunt/index.ts index 39d6faf56e7fc3..58864cf7f57085 100644 --- a/lib/modules/manager/terragrunt/index.ts +++ b/lib/modules/manager/terragrunt/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { GitTagsDatasource } from '../../datasource/git-tags'; import { GithubTagsDatasource } from '../../datasource/github-tags'; import { TerraformModuleDatasource } from '../../datasource/terraform-module'; @@ -16,3 +17,5 @@ export const defaultConfig = { commitMessageTopic: 'Terragrunt dependency {{depName}}', fileMatch: ['(^|/)terragrunt\\.hcl$'], }; + +export const categories: Category[] = ['iac', 'terraform']; diff --git a/lib/modules/manager/tflint-plugin/index.ts b/lib/modules/manager/tflint-plugin/index.ts index 2c17316cf35f2e..893fb9adab9151 100644 --- a/lib/modules/manager/tflint-plugin/index.ts +++ b/lib/modules/manager/tflint-plugin/index.ts @@ -1,7 +1,10 @@ +import type { Category } from '../../../constants'; import { GithubReleasesDatasource } from '../../datasource/github-releases'; export { extractPackageFile } from './extract'; +export const categories: Category[] = ['terraform']; + // Only from GitHub Releases: https://github.com/terraform-linters/tflint/blob/master/docs/developer-guide/plugins.md#4-creating-a-github-release export const supportedDatasources = [GithubReleasesDatasource.id]; diff --git a/lib/modules/manager/travis/index.ts b/lib/modules/manager/travis/index.ts index 4bf39140df7e3f..048cc096f236d3 100644 --- a/lib/modules/manager/travis/index.ts +++ b/lib/modules/manager/travis/index.ts @@ -1,11 +1,9 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { GithubTagsDatasource } from '../../datasource/github-tags'; import * as nodeVersioning from '../../versioning/node'; export { extractPackageFile } from './extract'; -export const language: ProgrammingLanguage = 'node'; - export const supportedDatasources = [GithubTagsDatasource.id]; export const defaultConfig = { @@ -15,3 +13,5 @@ export const defaultConfig = { }, versioning: nodeVersioning.id, }; + +export const categories: Category[] = ['ci']; diff --git a/lib/modules/manager/types.ts b/lib/modules/manager/types.ts index 311288b6bf9369..de83d46ec6f272 100644 --- a/lib/modules/manager/types.ts +++ b/lib/modules/manager/types.ts @@ -5,7 +5,7 @@ import type { UpdateType, ValidationMessage, } from '../../config/types'; -import type { ProgrammingLanguage } from '../../constants'; +import type { Category } from '../../constants'; import type { ModuleApi, RangeStrategy, SkipReason } from '../../types'; import type { FileChange } from '../../util/git/types'; import type { MergeConfidence } from '../../util/merge-confidence/types'; @@ -229,7 +229,8 @@ export interface GlobalManagerConfig { export interface ManagerApi extends ModuleApi { defaultConfig: Record; - language?: ProgrammingLanguage; + + categories?: Category[]; supportsLockFileMaintenance?: boolean; supportedDatasources: string[]; diff --git a/lib/modules/manager/velaci/index.ts b/lib/modules/manager/velaci/index.ts index 4b81226c2eb991..cc469f0d81c992 100644 --- a/lib/modules/manager/velaci/index.ts +++ b/lib/modules/manager/velaci/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { DockerDatasource } from '../../datasource/docker'; export { extractPackageFile } from './extract'; @@ -10,3 +11,5 @@ export const defaultConfig = { }; export const supportedDatasources = [DockerDatasource.id]; + +export const categories: Category[] = ['ci']; diff --git a/lib/modules/manager/woodpecker/index.ts b/lib/modules/manager/woodpecker/index.ts index 07a0c38a5c7702..67d4f616c409eb 100644 --- a/lib/modules/manager/woodpecker/index.ts +++ b/lib/modules/manager/woodpecker/index.ts @@ -1,13 +1,13 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { DockerDatasource } from '../../datasource/docker'; import { extractPackageFile } from './extract'; -export const language: ProgrammingLanguage = 'docker'; - export { extractPackageFile }; export const defaultConfig = { fileMatch: ['^\\.woodpecker(?:/[^/]+)?\\.ya?ml$'], }; +export const categories: Category[] = ['ci']; + export const supportedDatasources = [DockerDatasource.id]; diff --git a/lib/modules/platform/codecommit/index.md b/lib/modules/platform/codecommit/index.md index 6e54fbf819a5d5..4568dc7b26b54f 100644 --- a/lib/modules/platform/codecommit/index.md +++ b/lib/modules/platform/codecommit/index.md @@ -157,7 +157,7 @@ env: variables: RENOVATE_PLATFORM: 'codecommit' RENOVATE_REPOSITORIES: '["repoName1", "repoName2"]' - RENOVATE_CONFIG: '{"extends":["config:base"]}' + RENOVATE_CONFIG: '{"extends":["config:recommended"]}' LOG_LEVEL: 'debug' AWS_REGION: 'us-east-1' phases: @@ -177,7 +177,7 @@ env: variables: RENOVATE_PLATFORM: 'codecommit' RENOVATE_REPOSITORIES: '["repoName1", "repoName2"]' - RENOVATE_CONFIG: '{"extends":["config:base"]}' + RENOVATE_CONFIG: '{"extends":["config:recommended"]}' LOG_LEVEL: 'debug' AWS_REGION: 'us-east-1' phases: diff --git a/lib/modules/platform/gitea/index.md b/lib/modules/platform/gitea/index.md index a6c51d7f8ff797..40aef47bea729d 100644 --- a/lib/modules/platform/gitea/index.md +++ b/lib/modules/platform/gitea/index.md @@ -24,9 +24,9 @@ If you use Gitea packages, add the `read:packages` scope. ## Unsupported platform features/concepts -- **Adding reviewers to PRs not supported**: Gitea versions older than `v1.14.0` lack the required API -- **Setting `platformAutomerge` to use platform-native automerge for PRs not supported**: Gitea versions older than `v1.17.0` lack the required API -- **Git upload filters**: If you're using a Gitea version older than `v1.16.0` then you must enable [clone filters](https://docs.gitea.io/en-us/clone-filters/) +- **Adding reviewers to PRs not supported**: Gitea versions older than `v1.14.0` do not have the required API. +- **`platformAutomerge` (`true` by default) for platform-native automerge not supported**: Gitea versions older than v1.17.0 do not have the required API. +- **Git upload filters**: If you're using a Gitea version older than `v1.16.0` then you must enable [clone filters](https://docs.gitea.io/en-us/clone-filters/). ## Features awaiting implementation diff --git a/lib/modules/platform/gitlab/index.ts b/lib/modules/platform/gitlab/index.ts index 6994940dfc520e..48d8d0008f9e81 100644 --- a/lib/modules/platform/gitlab/index.ts +++ b/lib/modules/platform/gitlab/index.ts @@ -108,12 +108,16 @@ export async function initPlatform({ try { if (!gitAuthor) { const user = ( - await gitlabApi.getJson<{ email: string; name: string; id: number }>( - `user`, - { token } - ) + await gitlabApi.getJson<{ + email: string; + name: string; + id: number; + commit_email?: string; + }>(`user`, { token }) ).body; - platformConfig.gitAuthor = `${user.name} <${user.email}>`; + platformConfig.gitAuthor = `${user.name} <${ + user.commit_email ?? user.email + }>`; } // istanbul ignore if: experimental feature if (process.env.RENOVATE_X_PLATFORM_VERSION) { diff --git a/lib/modules/versioning/index.ts b/lib/modules/versioning/index.ts index 0346a213a622a6..893d05a68de864 100644 --- a/lib/modules/versioning/index.ts +++ b/lib/modules/versioning/index.ts @@ -1,9 +1,12 @@ import versionings from './api'; import { Versioning } from './schema'; +import * as semverCoerced from './semver-coerced'; import type { VersioningApi, VersioningApiConstructor } from './types'; export * from './types'; +export const defaultVersioning = semverCoerced; + export const getVersioningList = (): string[] => Array.from(versionings.keys()); /** * Get versioning map. Can be used to dynamically add new versioning type diff --git a/lib/util/exec/containerbase.spec.ts b/lib/util/exec/containerbase.spec.ts index c6b184fd0cd12f..5d5c5c2f8d8a3d 100644 --- a/lib/util/exec/containerbase.spec.ts +++ b/lib/util/exec/containerbase.spec.ts @@ -16,7 +16,6 @@ describe('util/exec/containerbase', () => { describe('isDynamicInstall()', () => { beforeEach(() => { GlobalConfig.reset(); - delete process.env.BUILDPACK; delete process.env.CONTAINERBASE; }); diff --git a/lib/util/exec/containerbase.ts b/lib/util/exec/containerbase.ts index fb28722b097ebb..6571d1850b8b98 100644 --- a/lib/util/exec/containerbase.ts +++ b/lib/util/exec/containerbase.ts @@ -202,7 +202,7 @@ export function supportsDynamicInstall(toolName: string): boolean { } export function isContainerbase(): boolean { - return !!process.env.CONTAINERBASE || !!process.env.BUILDPACK; + return !!process.env.CONTAINERBASE; } export function isDynamicInstall( diff --git a/lib/util/exec/docker/index.spec.ts b/lib/util/exec/docker/index.spec.ts index b0a2904ab60925..376a8a523b536f 100644 --- a/lib/util/exec/docker/index.spec.ts +++ b/lib/util/exec/docker/index.spec.ts @@ -226,11 +226,14 @@ describe('util/exec/docker/index', () => { (opts ? `${opts} ` : '') + `-e FOO -e BAR ` + `-w "/tmp/foobar" ` + - `containerbase/${img} ` + + `ghcr.io/containerbase/sidecar ` + `bash -l -c "foo && bar"`; beforeEach(() => { - GlobalConfig.set({ dockerUser: 'some-user' }); + GlobalConfig.set({ + dockerUser: 'some-user', + dockerSidecarImage: 'ghcr.io/containerbase/sidecar', + }); }); it('returns executable command', async () => { @@ -268,6 +271,7 @@ describe('util/exec/docker/index', () => { cacheDir: '/tmp/cache', containerbaseDir: '/tmp/containerbase', dockerUser: 'some-user', + dockerSidecarImage: 'ghcr.io/containerbase/sidecar', }); const volumes: VolumeOption[] = ['/tmp/foo']; const res = await generateDockerCommand(commands, preCommands, { @@ -288,6 +292,7 @@ describe('util/exec/docker/index', () => { cacheDir: '/tmp/cache', containerbaseDir: '/tmp/cache/containerbase', dockerUser: 'some-user', + dockerSidecarImage: 'ghcr.io/containerbase/sidecar', }); const volumes: VolumeOption[] = ['/tmp/foo']; const res = await generateDockerCommand(commands, preCommands, { @@ -304,6 +309,7 @@ describe('util/exec/docker/index', () => { GlobalConfig.set({ dockerUser: 'some-user', dockerCliOptions: '--memory=4g --cpus=".5"', + dockerSidecarImage: 'ghcr.io/containerbase/sidecar', }); const res = await generateDockerCommand(commands, preCommands, { ...dockerOptions, diff --git a/lib/util/exec/docker/index.ts b/lib/util/exec/docker/index.ts index 65a2b4fbb0cd94..a49ce0d8467bec 100644 --- a/lib/util/exec/docker/index.ts +++ b/lib/util/exec/docker/index.ts @@ -6,7 +6,6 @@ import { getPkgReleases } from '../../../modules/datasource'; import * as versioning from '../../../modules/versioning'; import { newlineRegex, regEx } from '../../regex'; import { uniq } from '../../uniq'; -import { ensureTrailingSlash } from '../../url'; import { rawExec } from '../common'; import type { DockerOptions, Opt, VolumeOption, VolumesPair } from '../types'; @@ -218,7 +217,7 @@ export async function generateDockerCommand( dockerUser, dockerChildPrefix, dockerCliOptions, - dockerImagePrefix, + dockerSidecarImage, } = GlobalConfig.get(); const result = ['docker run --rm']; const containerName = getContainerName(image, dockerChildPrefix); @@ -258,9 +257,8 @@ export async function generateDockerCommand( result.push(`-w "${cwd}"`); } - image = `${ensureTrailingSlash( - dockerImagePrefix ?? 'containerbase' - )}${image}`; + // TODO: #7154 + image = dockerSidecarImage!; // TODO: add constraint: const tag = getDockerTag(image, sideCarImageVersion, 'semver'); logger.debug( diff --git a/lib/util/exec/index.spec.ts b/lib/util/exec/index.spec.ts index a72aa0ee5546df..f545e080727ba3 100644 --- a/lib/util/exec/index.spec.ts +++ b/lib/util/exec/index.spec.ts @@ -38,7 +38,11 @@ describe('util/exec/index', () => { const defaultCacheVolume = `-v "${cacheDir}":"${cacheDir}"`; const defaultVolumes = `-v "${cwd}":"${cwd}" ${defaultCacheVolume}`; - const globalConfig: RepoGlobalConfig = { cacheDir, containerbaseDir }; + const globalConfig: RepoGlobalConfig = { + cacheDir, + containerbaseDir, + dockerSidecarImage: 'ghcr.io/containerbase/sidecar', + }; beforeEach(() => { dockerModule.resetPrefetchedImages(); @@ -54,7 +58,7 @@ describe('util/exec/index', () => { }); const image = dockerModule.sideCarImage; - const fullImage = `containerbase/${image}`; + const fullImage = `ghcr.io/containerbase/sidecar`; const name = `renovate_${image}`; const inCmd = 'echo hello'; const outCmd = ['echo hello']; @@ -77,12 +81,10 @@ describe('util/exec/index', () => { const containerbaseEnv = { ...envMock.basic, - BUILDPACK_CACHE_DIR: `${cacheDir}containerbase`, CONTAINERBASE_CACHE_DIR: `${cacheDir}containerbase`, }; const containerbaseEnvFiltered = { ...envMock.filtered, - BUILDPACK_CACHE_DIR: `${cacheDir}containerbase`, CONTAINERBASE_CACHE_DIR: `${cacheDir}containerbase`, }; @@ -225,7 +227,7 @@ describe('util/exec/index', () => { outCmd: [ dockerPullCmd, dockerRemoveCmd, - `docker run --rm --name=${name} --label=renovate_child ${defaultVolumes} -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR ${defaultCwd} ${fullImage} bash -l -c "${inCmd}"`, + `docker run --rm --name=${name} --label=renovate_child ${defaultVolumes} -e CONTAINERBASE_CACHE_DIR ${defaultCwd} ${fullImage} bash -l -c "${inCmd}"`, ], outOpts: [ dockerPullOpts, @@ -287,7 +289,7 @@ describe('util/exec/index', () => { outCmd: [ dockerPullCmd, dockerRemoveCmd, - `docker run --rm --name=${name} --label=renovate_child ${defaultVolumes} -e SELECTED_ENV_VAR -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR ${defaultCwd} ${fullImage} bash -l -c "${inCmd}"`, + `docker run --rm --name=${name} --label=renovate_child ${defaultVolumes} -e SELECTED_ENV_VAR -e CONTAINERBASE_CACHE_DIR ${defaultCwd} ${fullImage} bash -l -c "${inCmd}"`, ], outOpts: [ dockerPullOpts, @@ -337,7 +339,7 @@ describe('util/exec/index', () => { outCmd: [ dockerPullCmd, dockerRemoveCmd, - `docker run --rm --name=${name} --label=renovate_child ${defaultVolumes} -e SELECTED_ENV_VAR -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR ${defaultCwd} ${fullImage} bash -l -c "${inCmd}"`, + `docker run --rm --name=${name} --label=renovate_child ${defaultVolumes} -e SELECTED_ENV_VAR -e CONTAINERBASE_CACHE_DIR ${defaultCwd} ${fullImage} bash -l -c "${inCmd}"`, ], outOpts: [ dockerPullOpts, @@ -363,7 +365,7 @@ describe('util/exec/index', () => { outCmd: [ dockerPullCmd, dockerRemoveCmd, - `docker run --rm --name=${name} --label=renovate_child ${defaultVolumes} -v "${volume_1}":"${volume_1}" -v "${volume_2_from}":"${volume_2_to}" -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "${cwd}" ${fullImage} bash -l -c "${inCmd}"`, + `docker run --rm --name=${name} --label=renovate_child ${defaultVolumes} -v "${volume_1}":"${volume_1}" -v "${volume_2_from}":"${volume_2_to}" -e CONTAINERBASE_CACHE_DIR -w "${cwd}" ${fullImage} bash -l -c "${inCmd}"`, ], outOpts: [ dockerPullOpts, @@ -389,7 +391,7 @@ describe('util/exec/index', () => { outCmd: [ dockerPullCmd, dockerRemoveCmd, - `docker run --rm --name=${name} --label=renovate_child --user=foobar ${defaultVolumes} -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "${cwd}" ${fullImage} bash -l -c "${inCmd}"`, + `docker run --rm --name=${name} --label=renovate_child --user=foobar ${defaultVolumes} -e CONTAINERBASE_CACHE_DIR -w "${cwd}" ${fullImage} bash -l -c "${inCmd}"`, ], outOpts: [ dockerPullOpts, @@ -418,7 +420,7 @@ describe('util/exec/index', () => { outCmd: [ `docker pull ghcr.io/containerbase/${image}`, dockerRemoveCmd, - `docker run --rm --name=${name} --label=renovate_child ${defaultVolumes} -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "${cwd}" ghcr.io/containerbase/${image} bash -l -c "${inCmd}"`, + `docker run --rm --name=${name} --label=renovate_child ${defaultVolumes} -e CONTAINERBASE_CACHE_DIR -w "${cwd}" ghcr.io/containerbase/${image} bash -l -c "${inCmd}"`, ], outOpts: [ dockerPullOpts, @@ -432,7 +434,7 @@ describe('util/exec/index', () => { }, ], adminConfig: { - dockerImagePrefix: 'ghcr.io/containerbase', + dockerSidecarImage: 'ghcr.io/containerbase/sidecar', binarySource: 'docker', }, }, @@ -447,7 +449,7 @@ describe('util/exec/index', () => { outCmd: [ dockerPullCmd, `docker ps --filter name=myprefix_${image} -aq`, - `docker run --rm --name=myprefix_${image} --label=myprefix_child ${defaultVolumes} -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "${cwd}" ${fullImage} bash -l -c "${inCmd}"`, + `docker run --rm --name=myprefix_${image} --label=myprefix_child ${defaultVolumes} -e CONTAINERBASE_CACHE_DIR -w "${cwd}" ${fullImage} bash -l -c "${inCmd}"`, ], outOpts: [ dockerPullOpts, @@ -479,7 +481,7 @@ describe('util/exec/index', () => { outCmd: [ dockerPullCmd, dockerRemoveCmd, - `docker run --rm --name=${name} --label=renovate_child ${defaultVolumes} -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "${cwd}" ${fullImage} bash -l -c "preCommand1 && preCommand2 && ${inCmd}"`, + `docker run --rm --name=${name} --label=renovate_child ${defaultVolumes} -e CONTAINERBASE_CACHE_DIR -w "${cwd}" ${fullImage} bash -l -c "preCommand1 && preCommand2 && ${inCmd}"`, ], outOpts: [ dockerPullOpts, @@ -505,7 +507,7 @@ describe('util/exec/index', () => { outCmd: [ dockerPullCmd, dockerRemoveCmd, - `docker run --rm --name=${name} --label=renovate_child ${defaultVolumes} -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "${cwd}" ${fullImage} bash -l -c "${inCmd}"`, + `docker run --rm --name=${name} --label=renovate_child ${defaultVolumes} -e CONTAINERBASE_CACHE_DIR -w "${cwd}" ${fullImage} bash -l -c "${inCmd}"`, ], outOpts: [ dockerPullOpts, @@ -651,7 +653,7 @@ describe('util/exec/index', () => { outCmd: [ dockerPullCmd, dockerRemoveCmd, - `docker run --rm --name=${name} --label=renovate_child ${defaultVolumes} -e CUSTOM_KEY -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR ${defaultCwd} ${fullImage} bash -l -c "${inCmd}"`, + `docker run --rm --name=${name} --label=renovate_child ${defaultVolumes} -e CUSTOM_KEY -e CONTAINERBASE_CACHE_DIR ${defaultCwd} ${fullImage} bash -l -c "${inCmd}"`, ], outOpts: [ dockerPullOpts, @@ -685,7 +687,7 @@ describe('util/exec/index', () => { outCmd: [ dockerPullCmd, dockerRemoveCmd, - `docker run --rm --name=${name} --label=renovate_child ${defaultVolumes} -e CUSTOM_KEY -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR ${defaultCwd} ${fullImage} bash -l -c "${inCmd}"`, + `docker run --rm --name=${name} --label=renovate_child ${defaultVolumes} -e CUSTOM_KEY -e CONTAINERBASE_CACHE_DIR ${defaultCwd} ${fullImage} bash -l -c "${inCmd}"`, ], outOpts: [ dockerPullOpts, @@ -836,15 +838,15 @@ describe('util/exec/index', () => { `echo hello`, `docker pull ${fullImage}`, `docker ps --filter name=renovate_${image} -aq`, - `docker run --rm --name=renovate_${image} --label=renovate_child ${defaultCacheVolume} -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR ${fullImage} bash -l -c "echo hello"`, + `docker run --rm --name=renovate_${image} --label=renovate_child ${defaultCacheVolume} -e CONTAINERBASE_CACHE_DIR ${fullImage} bash -l -c "echo hello"`, `docker ps --filter name=renovate_${image} -aq`, - `docker run --rm --name=renovate_${image} --label=renovate_child ${defaultCacheVolume} -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR ${fullImage} bash -l -c "echo hello"`, + `docker run --rm --name=renovate_${image} --label=renovate_child ${defaultCacheVolume} -e CONTAINERBASE_CACHE_DIR ${fullImage} bash -l -c "echo hello"`, `echo hello`, `echo hello`, `docker ps --filter name=renovate_${image} -aq`, - `docker run --rm --name=renovate_${image} --label=renovate_child ${defaultCacheVolume} -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR ${fullImage} bash -l -c "echo hello"`, + `docker run --rm --name=renovate_${image} --label=renovate_child ${defaultCacheVolume} -e CONTAINERBASE_CACHE_DIR ${fullImage} bash -l -c "echo hello"`, `docker ps --filter name=renovate_${image} -aq`, - `docker run --rm --name=renovate_${image} --label=renovate_child ${defaultCacheVolume} -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR ${fullImage} bash -l -c "echo hello"`, + `docker run --rm --name=renovate_${image} --label=renovate_child ${defaultCacheVolume} -e CONTAINERBASE_CACHE_DIR ${fullImage} bash -l -c "echo hello"`, ]); }); diff --git a/lib/util/exec/index.ts b/lib/util/exec/index.ts index 547ad0f2be1c38..f0b01f345c3331 100644 --- a/lib/util/exec/index.ts +++ b/lib/util/exec/index.ts @@ -116,7 +116,6 @@ async function prepareRawExec( if (binarySource === 'docker' || binarySource === 'install') { logger.debug(`Setting CONTAINERBASE_CACHE_DIR to ${containerbaseDir!}`); opts.env ??= {}; - opts.env.BUILDPACK_CACHE_DIR = containerbaseDir; opts.env.CONTAINERBASE_CACHE_DIR = containerbaseDir; } @@ -133,7 +132,6 @@ async function prepareRawExec( const childEnv = getChildEnv(opts); const envVars = [ ...dockerEnvVars(extraEnv, childEnv), - 'BUILDPACK_CACHE_DIR', 'CONTAINERBASE_CACHE_DIR', ]; const cwd = getCwd(opts); diff --git a/lib/util/package-rules/categories.ts b/lib/util/package-rules/categories.ts new file mode 100644 index 00000000000000..5e53f60665582b --- /dev/null +++ b/lib/util/package-rules/categories.ts @@ -0,0 +1,20 @@ +import is from '@sindresorhus/is'; +import type { PackageRule, PackageRuleInputConfig } from '../../config/types'; +import { Matcher } from './base'; + +export class CategoriesMatcher extends Matcher { + override matches( + { categories }: PackageRuleInputConfig, + { matchCategories }: PackageRule + ): boolean | null { + if (is.nullOrUndefined(matchCategories)) { + return null; + } + + if (is.nullOrUndefined(categories)) { + return false; + } + + return matchCategories.some((value) => categories.includes(value)); + } +} diff --git a/lib/util/package-rules/files.spec.ts b/lib/util/package-rules/files.spec.ts index 374d2650355465..ac30c31247f00d 100644 --- a/lib/util/package-rules/files.spec.ts +++ b/lib/util/package-rules/files.spec.ts @@ -1,7 +1,7 @@ -import { FilesMatcher } from './files'; +import { FileNamesMatcher } from './files'; describe('util/package-rules/files', () => { - const fileMatcher = new FilesMatcher(); + const fileMatcher = new FileNamesMatcher(); describe('match', () => { it('should return false if packageFile is not defined', () => { @@ -10,7 +10,7 @@ describe('util/package-rules/files', () => { packageFile: undefined, }, { - matchFiles: ['frontend/package.json'], + matchFileNames: ['frontend/package.json'], } ); expect(result).toBeFalse(); diff --git a/lib/util/package-rules/files.ts b/lib/util/package-rules/files.ts index e1ab76f4d70192..bb6cd57a3c5c90 100644 --- a/lib/util/package-rules/files.ts +++ b/lib/util/package-rules/files.ts @@ -1,23 +1,27 @@ import is from '@sindresorhus/is'; +import { minimatch } from 'minimatch'; import type { PackageRule, PackageRuleInputConfig } from '../../config/types'; import { Matcher } from './base'; -export class FilesMatcher extends Matcher { +export class FileNamesMatcher extends Matcher { override matches( { packageFile, lockFiles }: PackageRuleInputConfig, - { matchFiles }: PackageRule + { matchFileNames }: PackageRule ): boolean | null { - if (is.undefined(matchFiles)) { + if (is.undefined(matchFileNames)) { return null; } if (is.undefined(packageFile)) { return false; } - return matchFiles.some( - (fileName) => - packageFile === fileName || - (is.array(lockFiles) && lockFiles?.includes(fileName)) + return matchFileNames.some( + (matchFileName) => + minimatch(packageFile, matchFileName, { dot: true }) || + (is.array(lockFiles) && + lockFiles.some((lockFile) => + minimatch(lockFile, matchFileName, { dot: true }) + )) ); } } diff --git a/lib/util/package-rules/index.spec.ts b/lib/util/package-rules/index.spec.ts index 9e6f48f4b38d11..79f29d7815ebdc 100644 --- a/lib/util/package-rules/index.spec.ts +++ b/lib/util/package-rules/index.spec.ts @@ -297,7 +297,6 @@ describe('util/package-rules/index', () => { }; const dep = { depType: 'dependencies', - language: 'js', manager: 'meteor', depName: 'node', }; @@ -318,6 +317,7 @@ describe('util/package-rules/index', () => { const dep = { depType: 'dependencies', language: 'python', + categories: ['python'], manager: 'pipenv', depName: 'node', }; @@ -325,11 +325,11 @@ describe('util/package-rules/index', () => { expect(res.x).toBeUndefined(); }); - it('filters languages with matching language', () => { + it('filters categories with matching category', () => { const config: TestConfig = { packageRules: [ { - matchLanguages: ['js', 'node'], + matchCategories: ['node'], matchPackageNames: ['node'], x: 1, }, @@ -337,7 +337,7 @@ describe('util/package-rules/index', () => { }; const dep = { depType: 'dependencies', - language: 'js', + categories: ['javascript', 'node'], manager: 'meteor', depName: 'node', }; @@ -345,11 +345,11 @@ describe('util/package-rules/index', () => { expect(res.x).toBe(1); }); - it('filters languages with non-matching language', () => { + it('filters categories with non-matching category', () => { const config: TestConfig = { packageRules: [ { - matchLanguages: ['docker'], + matchCategories: ['docker'], matchPackageNames: ['node'], x: 1, }, @@ -357,7 +357,25 @@ describe('util/package-rules/index', () => { }; const dep = { depType: 'dependencies', - language: 'python', + categories: ['python'], + manager: 'pipenv', + depName: 'node', + }; + const res = applyPackageRules({ ...config, ...dep }); + expect(res.x).toBeUndefined(); + }); + + it('filters categories with undefined category', () => { + const config: TestConfig = { + packageRules: [ + { + matchCategories: ['docker'], + x: 1, + }, + ], + }; + const dep = { + depType: 'dependencies', manager: 'pipenv', depName: 'node', }; @@ -930,7 +948,7 @@ describe('util/package-rules/index', () => { packageFile: 'examples/foo/package.json', packageRules: [ { - matchFiles: ['package.json'], + matchFileNames: ['package.json'], x: 1, }, ], @@ -954,7 +972,7 @@ describe('util/package-rules/index', () => { lockFiles: ['yarn.lock'], packageRules: [ { - matchFiles: ['yarn.lock'], + matchFileNames: ['yarn.lock'], x: 1, }, ], @@ -968,7 +986,7 @@ describe('util/package-rules/index', () => { packageFile: 'examples/foo/package.json', packageRules: [ { - matchPaths: ['examples/**', 'lib/'], + matchFileNames: ['examples/**', 'lib/'], x: 1, }, ], @@ -989,7 +1007,7 @@ describe('util/package-rules/index', () => { ...config, depName: 'test', }); - expect(res3.x).toBeDefined(); + expect(res3.x).toBeUndefined(); }); it('empty rules', () => { @@ -1069,7 +1087,7 @@ describe('util/package-rules/index', () => { packageRules: [ { matchPackageNames: ['abc'], - matchLanguages: ['js'], + matchCategories: ['js'], x: 1, }, ], @@ -1210,45 +1228,4 @@ describe('util/package-rules/index', () => { expect(res1.x).toBeUndefined(); expect(res2.x).toBe(1); }); - - describe('test matchers supporting RENOVATE_X_MATCH_PACKAGE_NAMES_MORE', () => { - const processEnvOrg: NodeJS.ProcessEnv = process.env; - - afterEach(() => { - process.env = processEnvOrg; - }); - - it.each` - matcherName | isXEnvEnabled | expected - ${'matchPackageNames'} | ${false} | ${undefined} - ${'matchPackagePatterns'} | ${false} | ${undefined} - ${'matchPackageNames'} | ${true} | ${1} - ${'matchPackagePatterns'} | ${true} | ${1} - `( - 'tests $matcherName selector when experimental env is $isXEnvEnabled (expected res=$expected)', - ({ matcherName, isXEnvEnabled, expected }) => { - if (isXEnvEnabled) { - process.env.RENOVATE_X_MATCH_PACKAGE_NAMES_MORE = 'true'; - } - const config: TestConfig = { - packageRules: [ - { - [matcherName]: ['does-match'], - x: 1, - }, - ], - }; - - const res = applyPackageRules({ - ...config, - depName: 'does-not-match', - packageName: 'does-match', - }); - - applyPackageRules(config); // coverage - - expect(res.x).toBe(expected); - } - ); - }); }); diff --git a/lib/util/package-rules/languages.ts b/lib/util/package-rules/languages.ts deleted file mode 100644 index 674963d881d6d5..00000000000000 --- a/lib/util/package-rules/languages.ts +++ /dev/null @@ -1,18 +0,0 @@ -import is from '@sindresorhus/is'; -import type { PackageRule, PackageRuleInputConfig } from '../../config/types'; -import { Matcher } from './base'; - -export class LanguagesMatcher extends Matcher { - override matches( - { language }: PackageRuleInputConfig, - { matchLanguages }: PackageRule - ): boolean | null { - if (is.undefined(matchLanguages)) { - return null; - } - if (is.undefined(language)) { - return false; - } - return matchLanguages.includes(language); - } -} diff --git a/lib/util/package-rules/matchers.ts b/lib/util/package-rules/matchers.ts index 2a11fdd8180d58..a6966583e25be0 100644 --- a/lib/util/package-rules/matchers.ts +++ b/lib/util/package-rules/matchers.ts @@ -1,18 +1,17 @@ import { BaseBranchesMatcher } from './base-branches'; +import { CategoriesMatcher } from './categories'; import { CurrentValueMatcher } from './current-value'; import { CurrentVersionMatcher } from './current-version'; import { DatasourcesMatcher } from './datasources'; import { DepNameMatcher } from './dep-names'; import { DepPatternsMatcher } from './dep-patterns'; import { DepTypesMatcher } from './dep-types'; -import { FilesMatcher } from './files'; -import { LanguagesMatcher } from './languages'; +import { FileNamesMatcher } from './files'; import { ManagersMatcher } from './managers'; import { MergeConfidenceMatcher } from './merge-confidence'; import { PackageNameMatcher } from './package-names'; import { PackagePatternsMatcher } from './package-patterns'; import { PackagePrefixesMatcher } from './package-prefixes'; -import { PathsMatcher } from './paths'; import { SourceUrlPrefixesMatcher } from './sourceurl-prefixes'; import { SourceUrlsMatcher } from './sourceurls'; import type { MatcherApi } from './types'; @@ -29,10 +28,8 @@ matchers.push([ new PackagePatternsMatcher(), new PackagePrefixesMatcher(), ]); -matchers.push([new FilesMatcher()]); -matchers.push([new PathsMatcher()]); +matchers.push([new FileNamesMatcher()]); matchers.push([new DepTypesMatcher()]); -matchers.push([new LanguagesMatcher()]); matchers.push([new BaseBranchesMatcher()]); matchers.push([new ManagersMatcher()]); matchers.push([new DatasourcesMatcher()]); @@ -41,3 +38,4 @@ matchers.push([new MergeConfidenceMatcher()]); matchers.push([new SourceUrlsMatcher(), new SourceUrlPrefixesMatcher()]); matchers.push([new CurrentValueMatcher()]); matchers.push([new CurrentVersionMatcher()]); +matchers.push([new CategoriesMatcher()]); diff --git a/lib/util/package-rules/package-names.spec.ts b/lib/util/package-rules/package-names.spec.ts index 1e6641ab94bc6e..a2d4fbf75787b6 100644 --- a/lib/util/package-rules/package-names.spec.ts +++ b/lib/util/package-rules/package-names.spec.ts @@ -15,6 +15,32 @@ describe('util/package-rules/package-names', () => { ); expect(result).toBeFalse(); }); + + it('should matchPackageName', () => { + const result = packageNameMatcher.matches( + { + depName: 'abc', + packageName: 'def', + }, + { + matchPackageNames: ['def'], + } + ); + expect(result).toBeTrue(); + }); + + it('should fall back to matching depName', () => { + const result = packageNameMatcher.matches( + { + depName: 'abc', + packageName: 'def', + }, + { + matchPackageNames: ['abc'], + } + ); + expect(result).toBeTrue(); + }); }); describe('exclude', () => { diff --git a/lib/util/package-rules/package-names.ts b/lib/util/package-rules/package-names.ts index 385cf164ac4654..8e647a8014e7b9 100644 --- a/lib/util/package-rules/package-names.ts +++ b/lib/util/package-rules/package-names.ts @@ -1,5 +1,6 @@ import is from '@sindresorhus/is'; import type { PackageRule, PackageRuleInputConfig } from '../../config/types'; +import { logger } from '../../logger'; import { Matcher } from './base'; export class PackageNameMatcher extends Matcher { @@ -14,15 +15,16 @@ export class PackageNameMatcher extends Matcher { return false; } - if (matchPackageNames.includes(depName)) { + if (is.string(packageName) && matchPackageNames.includes(packageName)) { return true; } - if ( - is.string(packageName) && - process.env.RENOVATE_X_MATCH_PACKAGE_NAMES_MORE - ) { - return matchPackageNames.includes(packageName); + if (matchPackageNames.includes(depName)) { + logger.once.warn( + { packageName, depName }, + 'Use matchDepNames instead of matchPackageNames' + ); + return true; } return false; diff --git a/lib/util/package-rules/package-patterns.spec.ts b/lib/util/package-rules/package-patterns.spec.ts index f5f6614df7cde2..133867f7ee3d86 100644 --- a/lib/util/package-rules/package-patterns.spec.ts +++ b/lib/util/package-rules/package-patterns.spec.ts @@ -15,5 +15,31 @@ describe('util/package-rules/package-patterns', () => { ); expect(result).toBeFalse(); }); + + it('should match packageName', () => { + const result = packageNameMatcher.matches( + { + depName: 'abc', + packageName: 'def', + }, + { + matchPackagePatterns: ['def'], + } + ); + expect(result).toBeTrue(); + }); + + it('should fall back to matching depName', () => { + const result = packageNameMatcher.matches( + { + depName: 'abc', + packageName: 'def', + }, + { + matchPackagePatterns: ['abc'], + } + ); + expect(result).toBeTrue(); + }); }); }); diff --git a/lib/util/package-rules/package-patterns.ts b/lib/util/package-rules/package-patterns.ts index 2b7b29e5807e63..a7fc03e2c02911 100644 --- a/lib/util/package-rules/package-patterns.ts +++ b/lib/util/package-rules/package-patterns.ts @@ -5,6 +5,19 @@ import { regEx } from '../regex'; import { Matcher } from './base'; import { massagePattern } from './utils'; +function matchPatternsAgainstName( + matchPackagePatterns: string[], + name: string +): boolean { + let isMatch = false; + for (const packagePattern of matchPackagePatterns) { + if (isPackagePatternMatch(packagePattern, name)) { + isMatch = true; + } + } + return isMatch; +} + export class PackagePatternsMatcher extends Matcher { override matches( { depName, packageName }: PackageRuleInputConfig, @@ -18,26 +31,21 @@ export class PackagePatternsMatcher extends Matcher { return false; } - const namesToMatchAgainst = [depName]; - if ( is.string(packageName) && - process.env.RENOVATE_X_MATCH_PACKAGE_NAMES_MORE + matchPatternsAgainstName(matchPackagePatterns, packageName) ) { - namesToMatchAgainst.push(packageName); + return true; } - - let isMatch = false; - for (const packagePattern of matchPackagePatterns) { - if ( - namesToMatchAgainst.some((p) => - isPackagePatternMatch(packagePattern, p) - ) - ) { - isMatch = true; - } + if (matchPatternsAgainstName(matchPackagePatterns, depName)) { + logger.once.warn( + { packageName, depName }, + 'Use matchDepPatterns instead of matchPackagePatterns' + ); + return true; } - return isMatch; + + return false; } override excludes( diff --git a/lib/util/package-rules/paths.spec.ts b/lib/util/package-rules/paths.spec.ts deleted file mode 100644 index 9b0c1db55484aa..00000000000000 --- a/lib/util/package-rules/paths.spec.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { logger } from '../../logger'; -import { PathsMatcher } from './paths'; - -describe('util/package-rules/paths', () => { - const pathsMatcher = new PathsMatcher(); - - describe('match', () => { - it('should return false if packageFile is not defined', () => { - const result = pathsMatcher.matches( - { - packageFile: undefined, - }, - { - matchPaths: ['opentelemetry/http'], - } - ); - expect(result).toBeFalse(); - }); - - it('should return true and log warning on partial match only', () => { - const result = pathsMatcher.matches( - { - packageFile: 'opentelemetry/http/package.json', - }, - { - matchPaths: ['opentelemetry/http'], - } - ); - expect(result).toBeTrue(); - expect(logger.warn).toHaveBeenCalledWith( - { - packageFile: 'opentelemetry/http/package.json', - rulePath: 'opentelemetry/http', - }, - 'Partial matches for `matchPaths` are deprecated. Please use a minimatch glob pattern or switch to `matchFiles` if you need exact matching.' - ); - }); - - it('should return true and not log warning on partial and glob match', () => { - const result = pathsMatcher.matches( - { - packageFile: 'package.json', - }, - { - matchPaths: ['package.json'], - } - ); - expect(result).toBeTrue(); - expect(logger.warn).not.toHaveBeenCalled(); - }); - }); -}); diff --git a/lib/util/package-rules/paths.ts b/lib/util/package-rules/paths.ts deleted file mode 100644 index 7bd882c56966e0..00000000000000 --- a/lib/util/package-rules/paths.ts +++ /dev/null @@ -1,36 +0,0 @@ -import is from '@sindresorhus/is'; -import { minimatch } from 'minimatch'; -import type { PackageRule, PackageRuleInputConfig } from '../../config/types'; -import { logger } from '../../logger'; -import { Matcher } from './base'; - -export class PathsMatcher extends Matcher { - override matches( - { packageFile }: PackageRuleInputConfig, - { matchPaths }: PackageRule - ): boolean | null { - if (is.undefined(matchPaths)) { - return null; - } - if (is.undefined(packageFile)) { - return false; - } - - return matchPaths.some((rulePath) => { - if (minimatch(packageFile, rulePath, { dot: true })) { - return true; - } - - if (packageFile.includes(rulePath)) { - logger.warn( - { - rulePath, - packageFile, - }, - 'Partial matches for `matchPaths` are deprecated. Please use a minimatch glob pattern or switch to `matchFiles` if you need exact matching.' - ); - return true; - } - }); - } -} diff --git a/lib/workers/global/config/parse/cli.spec.ts b/lib/workers/global/config/parse/cli.spec.ts index 8cb7a3d7851a9d..dd9ac01d21a0e5 100644 --- a/lib/workers/global/config/parse/cli.spec.ts +++ b/lib/workers/global/config/parse/cli.spec.ts @@ -156,10 +156,10 @@ describe('workers/global/config/parse/cli', () => { }); it('parses json object correctly', () => { - argv.push(`--onboarding-config={"extends": ["config:base"]}`); + argv.push(`--onboarding-config={"extends": ["config:recommended"]}`); expect(cli.getConfig(argv)).toEqual({ onboardingConfig: { - extends: ['config:base'], + extends: ['config:recommended'], }, }); }); diff --git a/lib/workers/global/config/parse/cli.ts b/lib/workers/global/config/parse/cli.ts index 37c8d37cac19c9..040618ad05cf68 100644 --- a/lib/workers/global/config/parse/cli.ts +++ b/lib/workers/global/config/parse/cli.ts @@ -68,7 +68,7 @@ export function getConfig(input: string[]): AllConfig { ); console.log(' $ renovate singapore/lint-condo singapore/package-test'); console.log( - ` $ renovate singapore/lint-condo --onboarding-config='{"extends":["config:base"]}'` + ` $ renovate singapore/lint-condo --onboarding-config='{"extends":["config:recommended"]}'` ); /* eslint-enable no-console */ } diff --git a/lib/workers/global/config/parse/file.spec.ts b/lib/workers/global/config/parse/file.spec.ts index e0aaf92406a91e..c1e2038c9cde59 100644 --- a/lib/workers/global/config/parse/file.spec.ts +++ b/lib/workers/global/config/parse/file.spec.ts @@ -65,7 +65,7 @@ describe('workers/global/config/parse/file', () => { "onboarding": false, "gitAuthor": "Renovate Bot " "onboardingConfig": { - "extends": ["config:base"], + "extends": ["config:recommended"], }, "repositories": [ "test/test" ], };`, diff --git a/lib/workers/repository/changelog/index.spec.ts b/lib/workers/repository/changelog/index.spec.ts index 5ad0dd54bf60c4..709103b105b098 100644 --- a/lib/workers/repository/changelog/index.spec.ts +++ b/lib/workers/repository/changelog/index.spec.ts @@ -1,7 +1,7 @@ import { mockedFunction, partial } from '../../../../test/util'; import type { BranchUpgradeConfig } from '../../types'; import { getChangeLogJSON } from '../update/pr/changelog'; -import { embedChangelogs, needsChangelogs } from '.'; +import { embedChangelogs } from '.'; jest.mock('../update/pr/changelog'); @@ -27,23 +27,4 @@ describe('workers/repository/changelog/index', () => { { logJSON: null }, ]); }); - - it('needsChangelogs', () => { - expect(needsChangelogs(partial())).toBeFalse(); - expect( - needsChangelogs( - partial({ - commitBody: '{{#if logJSON.hasReleaseNotes}}has changelog{{/if}}', - }) - ) - ).toBeFalse(); - expect( - needsChangelogs( - partial({ - commitBody: '{{#if logJSON.hasReleaseNotes}}has changelog{{/if}}', - }), - ['commitBody'] - ) - ).toBeTrue(); - }); }); diff --git a/lib/workers/repository/changelog/index.ts b/lib/workers/repository/changelog/index.ts index 8bc6c455590223..f6c6c6ca4f6881 100644 --- a/lib/workers/repository/changelog/index.ts +++ b/lib/workers/repository/changelog/index.ts @@ -1,8 +1,4 @@ import * as p from '../../../util/promises'; -import { - containsTemplates, - exposedConfigOptions, -} from '../../../util/template'; import type { BranchUpgradeConfig } from '../../types'; import { getChangeLogJSON } from '../update/pr/changelog'; @@ -21,17 +17,3 @@ export async function embedChangelogs( ): Promise { await p.map(branches, embedChangelog, { concurrency: 10 }); } - -export function needsChangelogs( - upgrade: BranchUpgradeConfig, - fields = exposedConfigOptions.filter((o) => o !== 'commitBody') -): boolean { - // commitBody is now compiled when commit is done - for (const field of fields) { - // fields set by `getChangeLogJSON` - if (containsTemplates(upgrade[field], ['logJSON', 'releases'])) { - return true; - } - } - return false; -} diff --git a/lib/workers/repository/init/__snapshots__/vulnerability.spec.ts.snap b/lib/workers/repository/init/__snapshots__/vulnerability.spec.ts.snap index e731e34f30e745..1c6a552c0026b5 100644 --- a/lib/workers/repository/init/__snapshots__/vulnerability.spec.ts.snap +++ b/lib/workers/repository/init/__snapshots__/vulnerability.spec.ts.snap @@ -7,7 +7,7 @@ exports[`workers/repository/init/vulnerability detectVulnerabilityAlerts() retur "matchDatasources": [ "npm", ], - "matchFiles": [ + "matchFileNames": [ "backend/package-lock.json", ], "matchPackageNames": [ @@ -31,7 +31,7 @@ exports[`workers/repository/init/vulnerability detectVulnerabilityAlerts() retur "matchDatasources": [ "go", ], - "matchFiles": [ + "matchFileNames": [ "go.mod", ], "matchPackageNames": [ @@ -61,7 +61,7 @@ go", "matchDatasources": [ "github-tags", ], - "matchFiles": [ + "matchFileNames": [ ".github/workflows/build.yaml", ], "matchPackageNames": [ @@ -91,7 +91,7 @@ actions", "matchDatasources": [ "pypi", ], - "matchFiles": [ + "matchFileNames": [ "requirements.txt", ], "matchPackageNames": [ @@ -136,7 +136,7 @@ Ansible before versions 2.1.4, 2.2.1 is vulnerable to an improper input validati "matchDatasources": [ "maven", ], - "matchFiles": [ + "matchFileNames": [ "pom.xml", ], "matchPackageNames": [ diff --git a/lib/workers/repository/init/merge.spec.ts b/lib/workers/repository/init/merge.spec.ts index 28676bd9ef23b0..a4a74f50d1b6e8 100644 --- a/lib/workers/repository/init/merge.spec.ts +++ b/lib/workers/repository/init/merge.spec.ts @@ -338,7 +338,7 @@ describe('workers/repository/init/merge', () => { scm.getFileList.mockResolvedValue(['renovate.json']); fs.readLocalFile.mockResolvedValue('{}'); migrateAndValidate.migrateAndValidate.mockResolvedValue({ - extends: ['config:base'], + extends: ['config:recommended'], warnings: [], errors: [], }); @@ -346,7 +346,7 @@ describe('workers/repository/init/merge', () => { isMigrated: true, migratedConfig: c, })); - config.extends = ['config:base']; + config.extends = ['config:recommended']; config.ignorePresets = [':ignoreModulesAndTests']; config.ignorePaths = ['**/examples/**']; const res = await mergeRenovateConfig(config); diff --git a/lib/workers/repository/init/vulnerability.spec.ts b/lib/workers/repository/init/vulnerability.spec.ts index 3fd52b0116e2d3..a5edda9408f63c 100644 --- a/lib/workers/repository/init/vulnerability.spec.ts +++ b/lib/workers/repository/init/vulnerability.spec.ts @@ -328,7 +328,7 @@ describe('workers/repository/init/vulnerability', () => { const res = await detectVulnerabilityAlerts(config); expect(res.packageRules).toMatchSnapshot(); expect(res.packageRules).toHaveLength(5); - expect(res.packageRules?.[1]?.matchFiles?.[0]).toBe('go.mod'); + expect(res.packageRules?.[1]?.matchFileNames?.[0]).toBe('go.mod'); expect(res.packageRules?.[2]?.matchCurrentVersion).toBe('1.8.2'); expect(res.remediations).toMatchSnapshot({ 'backend/package-lock.json': [ diff --git a/lib/workers/repository/init/vulnerability.ts b/lib/workers/repository/init/vulnerability.ts index 7cf228988eb556..69a5cc44c46c39 100644 --- a/lib/workers/repository/init/vulnerability.ts +++ b/lib/workers/repository/init/vulnerability.ts @@ -208,7 +208,7 @@ export async function detectVulnerabilityAlerts( datasource === PypiDatasource.id ? `==${val.firstPatchedVersion!}` : val.firstPatchedVersion; - const matchFiles = + const matchFileNames = datasource === GoDatasource.id ? [fileName.replace('go.sum', 'go.mod')] : [fileName]; @@ -216,7 +216,7 @@ export async function detectVulnerabilityAlerts( matchDatasources: [datasource], matchPackageNames: [depName], matchCurrentVersion, - matchFiles, + matchFileNames, }; const supportedRemediationFileTypes = ['package-lock.json']; if ( @@ -252,7 +252,7 @@ export async function detectVulnerabilityAlerts( // istanbul ignore if if ( config.transitiveRemediation && - matchRule.matchFiles?.[0] === 'package.json' + matchRule.matchFileNames?.[0] === 'package.json' ) { matchRule.force!.rangeStrategy = 'replace'; } diff --git a/lib/workers/repository/update/branch/execute-post-upgrade-commands.ts b/lib/workers/repository/update/branch/execute-post-upgrade-commands.ts index 82803f36f49fc6..281588e4d5defa 100644 --- a/lib/workers/repository/update/branch/execute-post-upgrade-commands.ts +++ b/lib/workers/repository/update/branch/execute-post-upgrade-commands.ts @@ -110,7 +110,7 @@ export async function postUpgradeCommandsExecutor( for (const relativePath of status.modified.concat(status.not_added)) { for (const pattern of fileFilters) { - if (minimatch(relativePath, pattern)) { + if (minimatch(relativePath, pattern, { dot: true })) { logger.debug( { file: relativePath, pattern }, 'Post-upgrade file saved' @@ -138,7 +138,7 @@ export async function postUpgradeCommandsExecutor( for (const relativePath of status.deleted || []) { for (const pattern of fileFilters) { - if (minimatch(relativePath, pattern)) { + if (minimatch(relativePath, pattern, { dot: true })) { logger.debug( { file: relativePath, pattern }, 'Post-upgrade file removed' diff --git a/lib/workers/repository/update/branch/index.spec.ts b/lib/workers/repository/update/branch/index.spec.ts index fb98eda0326aa6..ebb9d62ba954cf 100644 --- a/lib/workers/repository/update/branch/index.spec.ts +++ b/lib/workers/repository/update/branch/index.spec.ts @@ -2,7 +2,6 @@ import { fs, git, mocked, - mockedFunction, partial, platform, scm, @@ -34,7 +33,6 @@ import * as _mergeConfidence from '../../../../util/merge-confidence'; import * as _sanitize from '../../../../util/sanitize'; import * as _limits from '../../../global/limits'; import type { BranchConfig, BranchUpgradeConfig } from '../../../types'; -import { needsChangelogs } from '../../changelog'; import type { ResultWithPr } from '../pr'; import * as _prWorker from '../pr'; import * as _prAutomerge from '../pr/automerge'; @@ -816,9 +814,8 @@ describe('workers/repository/update/branch/index', () => { ignoreTests: true, prCreation: 'not-pending', commitBody: '[skip-ci]', - fetchReleaseNotes: true, + fetchReleaseNotes: 'branch', } satisfies BranchConfig; - mockedFunction(needsChangelogs).mockReturnValueOnce(true); scm.getBranchCommit.mockResolvedValue('123test'); //TODO:not needed? expect(await branchWorker.processBranch(inconfig)).toEqual({ branchExists: true, diff --git a/lib/workers/repository/update/branch/index.ts b/lib/workers/repository/update/branch/index.ts index a7dafcec36b930..6654edb2bbed68 100644 --- a/lib/workers/repository/update/branch/index.ts +++ b/lib/workers/repository/update/branch/index.ts @@ -34,7 +34,7 @@ import { toMs } from '../../../../util/pretty-time'; import * as template from '../../../../util/template'; import { isLimitReached } from '../../../global/limits'; import type { BranchConfig, BranchResult, PrBlockedBy } from '../../../types'; -import { embedChangelog, needsChangelogs } from '../../changelog'; +import { embedChangelogs } from '../../changelog'; import { ensurePr } from '../pr'; import { checkAutoMerge } from '../pr/automerge'; import { setArtifactErrorStatus } from './artifacts'; @@ -482,6 +482,10 @@ export async function processBranch( } else { logger.debug('No updated lock files in branch'); } + if (config.fetchReleaseNotes === 'branch') { + await embedChangelogs(config.upgrades); + } + const postUpgradeCommandResults = await executePostUpgradeCommands( config ); @@ -540,14 +544,6 @@ export async function processBranch( // compile commit message with body, which maybe needs changelogs if (config.commitBody) { - if ( - config.fetchReleaseNotes && - needsChangelogs(config, ['commitBody']) - ) { - // we only need first upgrade, the others are only needed on PR update - // we add it to first, so PR fetch can skip fetching for that update - await embedChangelog(config.upgrades[0]); - } // changelog is on first upgrade config.commitMessage = `${config.commitMessage!}\n\n${template.compile( config.commitBody, diff --git a/lib/workers/repository/update/pr/index.spec.ts b/lib/workers/repository/update/pr/index.spec.ts index 06caf733c26267..7316ea6f0e5e09 100644 --- a/lib/workers/repository/update/pr/index.spec.ts +++ b/lib/workers/repository/update/pr/index.spec.ts @@ -102,7 +102,7 @@ describe('workers/repository/update/pr/index', () => { platform.createPr.mockResolvedValueOnce(pr); limits.isLimitReached.mockReturnValueOnce(true); - config.fetchReleaseNotes = true; + config.fetchReleaseNotes = 'pr'; const res = await ensurePr(config); @@ -871,13 +871,13 @@ describe('workers/repository/update/pr/index', () => { bodyFingerprint: fingerprint( generatePrBodyFingerprintConfig({ ...config, - fetchReleaseNotes: true, + fetchReleaseNotes: 'pr', }) ), lastEdited: new Date('2020-01-20T00:00:00Z').toISOString(), }; prCache.getPrCache.mockReturnValueOnce(cachedPr); - const res = await ensurePr({ ...config, fetchReleaseNotes: true }); + const res = await ensurePr({ ...config, fetchReleaseNotes: 'pr' }); expect(res).toEqual({ type: 'with-pr', pr: existingPr, @@ -904,13 +904,13 @@ describe('workers/repository/update/pr/index', () => { bodyFingerprint: fingerprint( generatePrBodyFingerprintConfig({ ...config, - fetchReleaseNotes: true, + fetchReleaseNotes: 'pr', }) ), lastEdited: new Date('2020-01-20T00:00:00Z').toISOString(), }; prCache.getPrCache.mockReturnValueOnce(cachedPr); - const res = await ensurePr({ ...config, fetchReleaseNotes: true }); + const res = await ensurePr({ ...config, fetchReleaseNotes: 'pr' }); expect(res).toEqual({ type: 'with-pr', pr: { diff --git a/lib/workers/repository/update/pr/index.ts b/lib/workers/repository/update/pr/index.ts index c01c87e7f5c331..28cf9b2b6a40d1 100644 --- a/lib/workers/repository/update/pr/index.ts +++ b/lib/workers/repository/update/pr/index.ts @@ -234,7 +234,7 @@ export async function ensurePr( }`; } - if (config.fetchReleaseNotes) { + if (config.fetchReleaseNotes === 'pr') { // fetch changelogs when not already done; await embedChangelogs(upgrades); } diff --git a/lib/workers/repository/updates/branchify.spec.ts b/lib/workers/repository/updates/branchify.spec.ts index 37c98be11dba29..99c0d262bb4990 100644 --- a/lib/workers/repository/updates/branchify.spec.ts +++ b/lib/workers/repository/updates/branchify.spec.ts @@ -1,4 +1,4 @@ -import { RenovateConfig, mocked, mockedFunction } from '../../../../test/util'; +import { RenovateConfig, mocked } from '../../../../test/util'; import { getConfig } from '../../../config/defaults'; import * as _changelog from '../changelog'; import { branchifyUpgrades } from './branchify'; @@ -124,7 +124,7 @@ describe('workers/repository/updates/branchify', () => { }); it('no fetch changelogs', async () => { - config.fetchReleaseNotes = false; + config.fetchReleaseNotes = 'off'; flattenUpdates.mockResolvedValueOnce([ { depName: 'foo', @@ -153,38 +153,5 @@ describe('workers/repository/updates/branchify', () => { expect(embedChangelogs).not.toHaveBeenCalled(); expect(Object.keys(res.branches)).toHaveLength(2); }); - - it('fetch changelogs if required', async () => { - config.fetchReleaseNotes = true; - config.repoIsOnboarded = true; - mockedFunction(_changelog.needsChangelogs).mockReturnValueOnce(true); - flattenUpdates.mockResolvedValueOnce([ - { - depName: 'foo', - branchName: 'foo', - prTitle: 'some-title', - version: '1.1.0', - groupName: 'My Group', - group: { branchName: 'renovate/{{groupSlug}}' }, - }, - { - depName: 'foo', - branchName: 'foo', - prTitle: 'some-title', - version: '2.0.0', - }, - { - depName: 'bar', - branchName: 'bar-{{version}}', - prTitle: 'some-title', - version: '1.1.0', - groupName: 'My Group', - group: { branchName: 'renovate/my-group' }, - }, - ]); - const res = await branchifyUpgrades(config, {}); - expect(embedChangelogs).toHaveBeenCalledOnce(); - expect(Object.keys(res.branches)).toHaveLength(2); - }); }); }); diff --git a/lib/workers/repository/updates/branchify.ts b/lib/workers/repository/updates/branchify.ts index 4401fb4341640d..d6d0ccf12e53aa 100644 --- a/lib/workers/repository/updates/branchify.ts +++ b/lib/workers/repository/updates/branchify.ts @@ -3,7 +3,6 @@ import type { Merge } from 'type-fest'; import type { RenovateConfig, ValidationMessage } from '../../../config/types'; import { addMeta, logger, removeMeta } from '../../../logger'; import type { BranchConfig, BranchUpgradeConfig } from '../../types'; -import { embedChangelogs, needsChangelogs } from '../changelog'; import { flattenUpdates } from './flatten'; import { generateBranchConfig } from './generate'; @@ -72,22 +71,6 @@ export async function branchifyUpgrades( }) .reverse(); - if (config.fetchReleaseNotes && config.repoIsOnboarded) { - const branches = branchUpgrades[branchName].filter((upg) => - needsChangelogs(upg) - ); - if (branches.length) { - logger.warn( - { - branches: branches.map((b) => b.branchName), - docs: 'https://docs.renovatebot.com/templates/', - }, - 'Fetching changelogs early is deprecated. Remove `logJSON` and `releases` from config templates. They are only allowed in `commitBody` template. See template docs for allowed templates' - ); - await embedChangelogs(branches); - } - } - const branch = generateBranchConfig(branchUpgrades[branchName]); branch.branchName = branchName; branch.packageFiles = packageFiles; diff --git a/lib/workers/repository/updates/flatten.spec.ts b/lib/workers/repository/updates/flatten.spec.ts index 68e14d4aaf1d7f..acf624181513b3 100644 --- a/lib/workers/repository/updates/flatten.spec.ts +++ b/lib/workers/repository/updates/flatten.spec.ts @@ -25,7 +25,7 @@ describe('workers/repository/updates/flatten', () => { automerge: true, }, { - matchPaths: ['frontend/package.json'], + matchFileNames: ['frontend/package.json'], lockFileMaintenance: { enabled: false, }, diff --git a/lib/workers/types.ts b/lib/workers/types.ts index 1313fa33081a45..3df5bb85795dd8 100644 --- a/lib/workers/types.ts +++ b/lib/workers/types.ts @@ -44,7 +44,6 @@ export interface BranchUpgradeConfig group?: GroupConfig; groupName?: string; groupSlug?: string; - language?: string; manager: string; packageFile?: string; lockFile?: string; diff --git a/package.json b/package.json index f69bf684029b57..5fed43f503fcec 100644 --- a/package.json +++ b/package.json @@ -131,7 +131,7 @@ }, "homepage": "https://renovatebot.com", "engines": { - "node": ">=18.12.0", + "node": "^18.12.0 || >=20.0.0", "yarn": "^1.17.0" }, "engines-next": { diff --git a/renovate.json b/renovate.json index 86850e28adc841..4824b2dfe9c9bf 100644 --- a/renovate.json +++ b/renovate.json @@ -29,5 +29,14 @@ "matchPaths": ["**/__fixtures__/**"], "enabled": false } + ], + "regexManagers": [ + { + "fileMatch": ["config/options/index.ts"], + "matchStrings": [ + "default: '(?ghcr.io/containerbase/sidecar):(?.*)'" + ], + "datasourceTemplate": "docker" + } ] } diff --git a/test/e2e/package.json b/test/e2e/package.json index 175ebfbe239b46..75c259c670bc49 100644 --- a/test/e2e/package.json +++ b/test/e2e/package.json @@ -11,7 +11,7 @@ "renovate-config": { "default": { "extends": [ - "config:base", + "config:recommended", ":assignAndReview(rarkins)", ":maintainLockFilesWeekly" ] diff --git a/tools/docs/manager.ts b/tools/docs/manager.ts index 03f089130f7263..236bfdafd232de 100644 --- a/tools/docs/manager.ts +++ b/tools/docs/manager.ts @@ -9,6 +9,8 @@ import { replaceContent, } from './utils'; +const noCategoryDisplayName = 'no-category'; + function getTitle(manager: string, displayName: string): string { if (manager === 'regex') { return `Custom Manager Support using Regex`; @@ -26,19 +28,37 @@ export async function generateManagers( ): Promise { const managers = getManagers(); - const allLanguages: Record = {}; + const allCategories: Record = {}; + for (const [manager, definition] of managers) { - const language = definition.language ?? 'other'; - allLanguages[language] = allLanguages[language] || []; - allLanguages[language].push(manager); const { defaultConfig, supportedDatasources, urls } = definition; const { fileMatch } = defaultConfig as RenovateConfig; const displayName = getDisplayName(manager, definition); + + const categories = definition.categories ?? [noCategoryDisplayName]; + for (const category of categories) { + allCategories[category] ??= []; + allCategories[category].push(manager); + } + let md = `--- title: ${getTitle(manager, displayName)} sidebar_label: ${displayName} --- `; + md += '**Categories**: '; + if (categories.length) { + for (let i = 0; i < categories.length; i++) { + const category = categories[i]; + if (i < categories.length - 1) { + md += `\`${category}\`, `; + } else { + md += `\`${category}\``; + } + } + } + md += '\n\n'; + if (manager !== 'regex') { const nameWithUrl = getNameWithUrl(manager, definition); md += `Renovate supports updating ${nameWithUrl} dependencies.\n\n`; @@ -96,19 +116,21 @@ sidebar_label: ${displayName} await updateFile(`${dist}/modules/manager/${manager}/index.md`, md); } - const languages = Object.keys(allLanguages).filter( - (language) => language !== 'other' + + // add noCategoryDisplayName as last option + const categories = Object.keys(allCategories).filter( + (category) => category !== noCategoryDisplayName ); - languages.sort(); - languages.push('other'); - let languageText = '\n'; + categories.sort(); + categories.push(noCategoryDisplayName); + let categoryText = '\n'; - for (const language of languages) { - languageText += `**${language}**: `; - languageText += allLanguages[language].map(getManagerLink).join(', '); - languageText += '\n\n'; + for (const category of categories) { + categoryText += `**${category}**: `; + categoryText += allCategories[category].map(getManagerLink).join(', '); + categoryText += '\n\n'; } let indexContent = await readFile(`docs/usage/modules/manager/index.md`); - indexContent = replaceContent(indexContent, languageText); + indexContent = replaceContent(indexContent, categoryText); await updateFile(`${dist}/modules/manager/index.md`, indexContent); }