Skip to content

Commit

Permalink
Merge branch 'main' into feat/helm-binary-source-install
Browse files Browse the repository at this point in the history
# Conflicts:
#	lib/manager/helmv3/__snapshots__/artifacts.spec.ts.snap
#	lib/manager/helmv3/artifacts.spec.ts
#	lib/manager/helmv3/artifacts.ts
  • Loading branch information
rarkins committed Jan 28, 2022
2 parents 11f0551 + ec4cf70 commit 3e9d536
Show file tree
Hide file tree
Showing 238 changed files with 4,687 additions and 1,942 deletions.
11 changes: 10 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = {
env: {
node: true,
},
plugins: ['@renovate'],
plugins: ['@renovate', 'typescript-enum'],
extends: [
'eslint:recommended',
'plugin:import/errors',
Expand Down Expand Up @@ -119,11 +119,20 @@ module.exports = {
'@typescript-eslint/unbound-method': 2,
'@typescript-eslint/ban-types': 2,
'@renovate/jest-root-describe': 2,

'typescript-enum/no-const-enum': 2,
'typescript-enum/no-enum': 2,
},
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts'],
},
'import/resolver': {
typescript: {
alwaysTryTypes: true, // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
project: 'tsconfig.lint.json',
},
},
},
overrides: [
{
Expand Down
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@ body:
validations:
required: false

- type: dropdown
id: regression-error
attributes:
label: Was this something which used to work for you, and then stopped?
options:
- 'It used to work, and then stopped'
- 'I never saw this working'
validations:
required: true

- type: textarea
id: describe-bug
attributes:
Expand Down
2 changes: 2 additions & 0 deletions .github/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ We don't want you spending an hour trying to work out something that would take
For that reason, we have a Slack channel dedicated to helping anyone who's working on or considering Pull Requests for Renovate.
Please email [email protected] and simply mention that you need an invitation to the channel and you'll be added ASAP.

Important: this Slack group is restricted to development questions only in order to keep the volume of messages lower - all technical support questions should still be posted to this repository's Discussions instead.

## Legal

Pull Request authors must sign the [Renovate CLA](https://cla-assistant.io/renovateapp/renovate).
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@384cfc42b2131df01c009d3d2eed7b78d8e8556e # renovate: tag=v1.0.29
uses: github/codeql-action/init@8b37404d562d866ad6a65d0ecb4fa5131e047ca4 # renovate: tag=v1.0.30
with:
config-file: ./.github/codeql/codeql-config.yml

Expand All @@ -36,7 +36,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@384cfc42b2131df01c009d3d2eed7b78d8e8556e # renovate: tag=v1.0.29
uses: github/codeql-action/autobuild@8b37404d562d866ad6a65d0ecb4fa5131e047ca4 # renovate: tag=v1.0.30

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -50,4 +50,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@384cfc42b2131df01c009d3d2eed7b78d8e8556e # renovate: tag=v1.0.29
uses: github/codeql-action/analyze@8b37404d562d866ad6a65d0ecb4fa5131e047ca4 # renovate: tag=v1.0.30
3 changes: 3 additions & 0 deletions __mocks__/fs.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { fs } from 'memfs';

module.exports = fs;
46 changes: 46 additions & 0 deletions docs/development/creating-editing-renovate-presets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Creating/editing Renovate presets

Renovate comes with default presets that you can find in the `lib/config/presets/internal` directory.
You can suggest changes to the presets with a pull request.

Follow the rules below to increase the chance that your pull request gets merged.

## General rules

1. Avoid creating presets for problems which can be fixed upstream
1. The internal preset should be helpful for a significant number of Renovate users

### Specific rules

#### Group presets

We have multiple kinds of `group:` presets, with different rules.

##### Rules for `group:monorepo` preset

1. Only group dependencies that _must_ be updated together

##### Rules for `group:recommended` presets

1. The `group:recommended` preset is for related dependencies which aren't from a monorepo but which usually need to be updated together as separate PRs may each break

##### 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`

#### Replacement presets

Rules:

1. Replacement PRs should ideally propose a replacement only once the user is on a compatible version, by specifying a compatible `matchCurrentVersion` constraint
1. If no compatible replacement upgrade is possible, it's acceptable to propose an incompatible one (e.g. a major version upgrade)
1. Replacements should update the user to the first recommended version of the new dependency and not include any new changes - whether breaking or not - if they can be avoided

#### Monorepo presets

Rules:

1. The primary use case of monorepo presets is identifying packages from the same origin source repository which should be updated together
1. Packages from the same repository which are developed and versioned independently do not need to be grouped as a monorepo, but in many cases we still do
1. Packages from separate repositories but which are released together and dependent on each other may also be added to the "monorepo" definitions even if not strictly true
26 changes: 17 additions & 9 deletions docs/usage/config-presets.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,14 @@ In short:

Shareable config presets can only be used with the JSON format, other formats are not supported.

**Warning:** `default.json` is intended for use with presets only!
**Warning:** Do not use a `renovate.json` file as a preset.
<!-- prettier-ignore -->
!!! warning
`default.json` is intended for use with presets only!
Also, do not use a `renovate.json` file as a preset.

**Info:** We've deprecated the use of a `renovate.json` file for presets as this can cause issues if the repository configuration uses a `renovate.json` file as well.
<!-- prettier-ignore -->
!!! info
We've deprecated the use of a `renovate.json` file for presets as this can cause issues if the repository configuration uses a `renovate.json` file as well.

## Goals of Preset Configs

Expand Down Expand Up @@ -87,9 +91,11 @@ You can set a Git tag (like a SemVer) to use a specific release of your shared c
| Local with preset name and path with a tag | `local>abc/foo//path/xyz#1.5.4` | `xyz` | `https://github.company.com/abc/foo` | `path/xyz.json` | `1.5.4` |
| Local with subpreset name and tag | `local>abc/foo:xyz/sub#1.5.4` | `sub` | `https://github.company.com/abc/foo` | `xyz.json` | `1.5.4` |

Note that you can't combine the path and sub-preset syntaxes.
This means that anything in the form `provider>owner/repo//path/to/file:subsubpreset` is not supported.
One workaround is to use distinct files instead of sub-presets.
<!-- prettier-ignore -->
!!! tip
You can't combine the path and sub-preset syntaxes.
This means that anything in the form `provider>owner/repo//path/to/file:subsubpreset` is not supported.
One workaround is to use distinct files instead of sub-presets.

## Example configs

Expand All @@ -99,8 +105,10 @@ It simply sets the configuration option `rangeStrategy` to `replace`.
An example of a full config is `config:base`, which is Renovate's default configuration.
It mostly uses Renovate config defaults but adds a few smart customisations such as grouping monorepo packages together.

Special note: the `:xyz` naming convention (with `:` prefix) is a special shorthand for the `default:` presets.
e.g. `:xyz` is equivalent to `default:xyz`.
<!-- prettier-ignore -->
!!! note
The `:xyz` naming convention (with `:` prefix) is a special shorthand for the `default:` presets.
e.g. `:xyz` is equivalent to `default:xyz`.

## How to Use Preset Configs

Expand Down Expand Up @@ -279,7 +287,7 @@ Then in each of your repositories you can add your Renovate config like:

Any repository including this config will then adopt the rules of the default `library` preset but schedule it on weeknights or weekends.

Note: if you prefer to publish using the namespace `@fastcore/renovate-config` then you would use the `@` prefix instead:
If you prefer to publish using the namespace `@fastcore/renovate-config` then you would use the `@` prefix instead:

```json
{
Expand Down
2 changes: 1 addition & 1 deletion docs/usage/configuration-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -2366,7 +2366,7 @@ Renovate's "rollback" feature exists to propose a downgrade to the next-highest

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-lanuage, or per-package to override the default behavior.
You can configure the `rollbackPrs` property globally, per-language, or per-package to override the default behavior.

## ruby

Expand Down
2 changes: 1 addition & 1 deletion docs/usage/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ To get access to the token a custom Renovate Docker image is needed that include
The Dockerfile to create such an image can look like this:

```Dockerfile
FROM renovate/renovate:31.28.2
FROM renovate/renovate:31.49.0
# Include the "Docker tip" which you can find here https://cloud.google.com/sdk/docs/install
# under "Installation" for "Debian/Ubuntu"
RUN ...
Expand Down
2 changes: 2 additions & 0 deletions docs/usage/nuget.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ In this example we defined 3 NuGet feeds.
The package resolving process uses the `merge` strategy to handle the 3 feeds.
All feeds are checked for dependency updates, and duplicate updates are merged/joined together into a single dependency update.

If your project uses lockfiles (a `package.lock.json` exists), alternate feed settings must be defined in a `NuGet.config` only, as `registryUrls` are not passed through to the NuGet commands used.

### Protocol versions

NuGet supports two protocol versions, `v2` and `v3`, the NuGet client and server must use the same protocol version.
Expand Down
2 changes: 1 addition & 1 deletion docs/usage/templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Read the [MDN Web Docs, encodeURIComponent()](https://developer.mozilla.org/en-U
The `replace` helper replaces _all_ found strings with the replacement string.
If you want to replace some characters in a string, use the built-in function `replace` like this:

`{{{replace 'github.com', 'ghc', depName}}}`
`{{{replace 'github.com' 'ghc' depName}}}`

In the example above all matches of `github.com` will be replaced by `ghc` in `depName`.

Expand Down
7 changes: 6 additions & 1 deletion lib/config/__snapshots__/migration.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,12 @@ Object {
":dependencyDashboard",
],
"hostRules": Array [
Object {},
Object {
"hostType": "docker",
"matchHost": "https://docker.io",
"password": "some-password",
"username": "some-username",
},
],
"ignorePaths": Array [
"node_modules/",
Expand Down
6 changes: 3 additions & 3 deletions lib/config/decrypt.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { loadFixture } from '../../test/util';
import { Fixtures } from '../../test/fixtures';
import { decryptConfig } from './decrypt';
import { GlobalConfig } from './global';
import type { RenovateConfig } from './types';

const privateKey = loadFixture('private.pem', '.');
const privateKeyPgp = loadFixture('private-pgp.pem', '.');
const privateKey = Fixtures.get('private.pem');
const privateKeyPgp = Fixtures.get('private-pgp.pem');
const repository = 'abc/def';

describe('config/decrypt', () => {
Expand Down
6 changes: 3 additions & 3 deletions lib/config/decrypt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as openpgp from 'openpgp';
import { logger } from '../logger';
import { maskToken } from '../util/mask';
import { regEx } from '../util/regex';
import { add } from '../util/sanitize';
import { addSecretForSanitizing } from '../util/sanitize';
import { GlobalConfig } from './global';
import type { RenovateConfig } from './types';

Expand Down Expand Up @@ -175,7 +175,7 @@ export async function decryptConfig(
logger.debug(`Decrypted ${eKey}`);
if (eKey === 'npmToken') {
const token = decryptedStr.replace(regEx(/\n$/), '');
add(token);
addSecretForSanitizing(token);
logger.debug(
{ decryptedToken: maskToken(token) },
'Migrating npmToken to npmrc'
Expand All @@ -202,7 +202,7 @@ export async function decryptConfig(
}
} else {
decryptedConfig[eKey] = decryptedStr;
add(decryptedStr);
addSecretForSanitizing(decryptedStr);
}
}
} else {
Expand Down
26 changes: 0 additions & 26 deletions lib/config/migration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -691,32 +691,6 @@ describe('config/migration', () => {
expect(migratedConfig).toEqual({ extends: ['local>org/renovate-config'] });
});

it('it migrates composerIgnorePlatformReqs values', () => {
let config: TestRenovateConfig;
let res: MigratedConfig;

config = {
composerIgnorePlatformReqs: true,
} as never;
res = configMigration.migrateConfig(config);
expect(res.isMigrated).toBeTrue();
expect(res.migratedConfig.composerIgnorePlatformReqs).toStrictEqual([]);

config = {
composerIgnorePlatformReqs: false,
} as never;
res = configMigration.migrateConfig(config);
expect(res.isMigrated).toBeTrue();
expect(res.migratedConfig.composerIgnorePlatformReqs).toBeNull();

config = {
composerIgnorePlatformReqs: [],
} as never;
res = configMigration.migrateConfig(config);
expect(res.isMigrated).toBeFalse();
expect(res.migratedConfig.composerIgnorePlatformReqs).toStrictEqual([]);
});

it('it migrates gradle-lite', () => {
const config: RenovateConfig = {
gradle: {
Expand Down
30 changes: 0 additions & 30 deletions lib/config/migration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,6 @@ export function migrateConfig(
'{{managerBranchPrefix}}',
'{{additionalBranchPrefix}}'
);
} else if (key === 'managerBranchPrefix') {
delete migratedConfig.managerBranchPrefix;
migratedConfig.additionalBranchPrefix = val;
} else if (
key === 'branchPrefix' &&
is.string(val) &&
Expand All @@ -174,16 +171,6 @@ export function migrateConfig(
const templateIndex = val.indexOf(`{{`);
migratedConfig.branchPrefix = val.substring(0, templateIndex);
migratedConfig.additionalBranchPrefix = val.substring(templateIndex);
} else if (key === 'upgradeInRange') {
delete migratedConfig.upgradeInRange;
if (val === true) {
migratedConfig.rangeStrategy = 'bump';
}
} else if (key === 'versionStrategy') {
delete migratedConfig.versionStrategy;
if (val === 'widen') {
migratedConfig.rangeStrategy = 'widen';
}
} else if (key === 'semanticPrefix' && is.string(val)) {
delete migratedConfig.semanticPrefix;
let [text] = val.split(':') as any; // TODO: fixme
Expand Down Expand Up @@ -438,19 +425,6 @@ export function migrateConfig(
if (subMigrate.isMigrated) {
migratedConfig[key] = subMigrate.migratedConfig;
}
} else if (key === 'raiseDeprecationWarnings') {
delete migratedConfig.raiseDeprecationWarnings;
if (val === false) {
migratedConfig.suppressNotifications =
migratedConfig.suppressNotifications || [];
migratedConfig.suppressNotifications.push('deprecationWarningIssues');
}
} else if (key === 'composerIgnorePlatformReqs') {
if (val === true) {
migratedConfig.composerIgnorePlatformReqs = [];
} else if (val === false) {
migratedConfig.composerIgnorePlatformReqs = null;
}
} else if (key === 'azureAutoComplete' || key === 'gitLabAutomerge') {
if (migratedConfig[key] !== undefined) {
migratedConfig.platformAutomerge = migratedConfig[key];
Expand All @@ -475,10 +449,6 @@ export function migrateConfig(
}
}
}
if (migratedConfig.endpoints) {
migratedConfig.hostRules = migratedConfig.endpoints;
delete migratedConfig.endpoints;
}
if (is.array(migratedConfig.packageRules)) {
const renameMap = {
paths: 'matchPaths',
Expand Down
2 changes: 1 addition & 1 deletion lib/config/migrations/base/remove-property-migration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { RenovateConfig } from '../../types';
import { AbstractMigration } from './abstract-migration';

export class RemovePropertyMigration extends AbstractMigration {
readonly propertyName: string;
override readonly propertyName: string;

constructor(
propertyName: string,
Expand Down
4 changes: 2 additions & 2 deletions lib/config/migrations/base/rename-property-migration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { AbstractMigration } from './abstract-migration';

export class RenamePropertyMigration extends AbstractMigration {
override readonly deprecated = true;
readonly propertyName: string;
override readonly propertyName: string;

private readonly newPropertyName: string;

Expand All @@ -18,7 +18,7 @@ export class RenamePropertyMigration extends AbstractMigration {
this.newPropertyName = newPropertyName;
}

override run(value): void {
override run(value: unknown): void {
this.setSafely(this.newPropertyName, value);
}
}
Loading

0 comments on commit 3e9d536

Please sign in to comment.