Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: HonkingGoose <[email protected]>
  • Loading branch information
RahulGautamSingh and HonkingGoose authored Sep 20, 2023
1 parent b6e38ec commit 077679e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 17 deletions.
33 changes: 18 additions & 15 deletions docs/usage/configuration-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ When using with `npm`, we recommend you:
## customDatasources

Use `customDatasources` to fetch releases from APIs or statically hosted sites and Renovate has no own datasource.
These datasources can be referred by CustomManagers or can be used to overwrite default datasources.
These datasources can be referred by `customManagers` or can be used to overwrite default datasources.

For more details see the [`custom` datasource documentation](/modules/datasource/custom/).

Expand All @@ -659,7 +659,8 @@ You can define custom managers to handle:
- Proprietary file formats or conventions
- Popular file formats not yet supported as a manager by Renovate

Currently we only have one custom manager. The `regex` manager which is based on using Regular Expression named capture groups.
Currently we only have one custom manager.
The `regex` manager which is based on using Regular Expression named capture groups.

You must have a named capture group matching (e.g. `(?<depName>.*)`) _or_ configure its corresponding template (e.g. `depNameTemplate`) for these fields:

Expand All @@ -668,7 +669,7 @@ You must have a named capture group matching (e.g. `(?<depName>.*)`) _or_ config
- `currentValue`

Use named capture group matching _or_ set a corresponding template.
We recommend you use only one of these methods, or you'll get confused.
We recommend you use only _one_ of these methods, or you'll get confused.

We recommend that you also tell Renovate what `versioning` to use.
If the `versioning` field is missing, then Renovate defaults to using `semver` versioning.
Expand Down Expand Up @@ -699,7 +700,7 @@ Example:

### matchStrings

`matchStrings` should each be a valid regular expression, optionally with named capture groups.
Each `matchStrings` must be a valid regular expression, optionally with named capture groups.

Example:

Expand All @@ -725,7 +726,7 @@ Three options are available:
Each provided `matchString` will be matched individually to the content of the `packageFile`.
If a `matchString` has multiple matches in a file each will be interpreted as an independent dependency.

As example the following configuration will update all 3 lines in the Dockerfile.
As example the following configuration will update all three lines in the Dockerfile.
renovate.json:

```json
Expand All @@ -745,7 +746,7 @@ renovate.json:
}
```

a Dockerfile:
A Dockerfile:

```dockerfile
FROM amd64/ubuntu:18.04
Expand All @@ -758,7 +759,7 @@ ENV NODE_VERSION=10.19.0 # github-tags/nodejs/node&versioning=node
If using `recursive` the `matchStrings` will be looped through and the full match of the last will define the range of the next one.
This can be used to narrow down the search area to prevent multiple matches.
But the `recursive` strategy still allows the matching of multiple dependencies as described below.
All matches of the first `matchStrings` pattern are detected, then each of these matches will used as basis be used as the input for the next `matchStrings` pattern, and so on.
All matches of the first `matchStrings` pattern are detected, then each of these matches will be used as basis for the input for the next `matchStrings` pattern, and so on.
If the next `matchStrings` pattern has multiple matches then it will split again.
This process will be followed as long there is a match plus a next `matchingStrings` pattern is available.

Expand Down Expand Up @@ -820,10 +821,11 @@ example.json:

#### combination

This option allows the possibility to combine the values of multiple lines inside a file.
While using multiple lines is also possible using both other `matchStringStrategy` values, the `combination` approach is less susceptible to white space or line breaks stopping a match.
You may use this option to combine the values of multiple lines inside a file.
You can combine multiple lines with `matchStringStrategy` values, but the `combination` approach is less susceptible to white space or line breaks stopping a match.

`combination` will only match at most one dependency per file, so if you want to update multiple dependencies using `combination` you have to define multiple custom managers.
`combination` can only match _one_ dependency per file.
To update multiple dependencies with `combination` you must define multiple custom managers.

Matched group values will be merged to form a single dependency.

Expand Down Expand Up @@ -855,7 +857,7 @@ renovate.json:
}
```

Ansible variable file ( yaml ):
Ansible variable file (YAML):

```yaml
prometheus_image: "prom/prometheus" // a comment
Expand Down Expand Up @@ -914,14 +916,14 @@ Allows overwriting how the matched string is replaced.
This allows for some migration strategies.
E.g. moving from one Docker image repository to another one.

helm-values.yaml:
`helm-values.yaml`:

```yaml
# The image of the service <registry>/<repo>/<image>:<tag>
image: my.old.registry/aRepository/andImage:1.18-alpine
```

regex definition:
The regex definition:

```json
{
Expand Down Expand Up @@ -949,7 +951,7 @@ image: my.new.registry/aRepository/andImage:1.21-alpine

## customizeDashboard

You can use the `customizeDashboard` object to customize dependency dashboard.
You may use the `customizeDashboard` object to customize the Dependency Dashboard.

Supported fields:

Expand All @@ -958,7 +960,8 @@ Supported fields:
### defaultRegistryUrlTemplate

`registryUrl` which is used, if none is return by extraction.
As this is a template it can be dynamically set. E.g. add the `packageName` as part of the URL:
As this is a template it can be dynamically set.
E.g. add the `packageName` as part of the URL:

```json5
{
Expand Down
2 changes: 1 addition & 1 deletion docs/usage/user-stories/swissquote.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ Some features and options we enjoy:
- Each rule can be customized either globally [or specified per package](../configuration-options.md#packagerules)
- Works with your [private package registry](../getting-started/private-packages.md)
- Supports more than 70 [languages and package managers](https://docs.renovatebot.com/modules/manager/#supported-managers): Maven, Docker, npm, Docker Compose, Python
- If you are using dependencies in a custom way, [there is a special customManager](../configuration-options.md#custommanagers) that allows you to transform patterns into dependencies
- If you are using dependencies in a custom way, [there is a `customManagers` option](../configuration-options.md#custommanagers) that allows you to transform patterns into dependencies

There is an [on-premise option](https://www.mend.io/free-developer-tools/renovate/on-premises/), but you can also use [the Mend Renovate App](https://github.com/marketplace/renovate).
On our side, we’re not using the on-premise but rather a custom scheduler using the open source Docker image.
Expand Down
2 changes: 1 addition & 1 deletion lib/config/migrations/custom/custom-managers-migration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class CustomManagersMigration extends AbstractMigration {
if (mgr.customType) {
return mgr;
}
return Object.assign({ customType: 'regex' }, mgr); // to make sure customType is at top, looks good when migration pr is created
return Object.assign({ customType: 'regex' }, mgr); // to make sure customType is at top, looks good when migration PR is created
});

this.rewrite(customManagers);
Expand Down

0 comments on commit 077679e

Please sign in to comment.