Skip to content

Commit

Permalink
pulled changes
Browse files Browse the repository at this point in the history
  • Loading branch information
RahulGautamSingh committed Oct 11, 2021
2 parents d9b50ad + 191ab33 commit 2ccae52
Show file tree
Hide file tree
Showing 96 changed files with 2,859 additions and 1,395 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ FROM containerbase/node:v14.18.0@sha256:50de253d90cbb55711d47927e56850c32ea5fcb7


# renovate: datasource=npm
RUN install-tool yarn 1.22.11
RUN install-tool yarn 1.22.14
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@1b37538d9c22dd3f3d0c52992fa20da98683bd34 # renovate: tag=v1.0.15
uses: github/codeql-action/init@fd3190bba58b65cbefb742009518a03a07af24d7 # renovate: tag=v1.0.18
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@1b37538d9c22dd3f3d0c52992fa20da98683bd34 # renovate: tag=v1.0.15
uses: github/codeql-action/autobuild@fd3190bba58b65cbefb742009518a03a07af24d7 # renovate: tag=v1.0.18

# ℹ️ 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@1b37538d9c22dd3f3d0c52992fa20da98683bd34 # renovate: tag=v1.0.15
uses: github/codeql-action/analyze@fd3190bba58b65cbefb742009518a03a07af24d7 # renovate: tag=v1.0.18
5 changes: 4 additions & 1 deletion .github/workflows/label-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ name: 'Label Actions'
on:
issues:
types: [labeled]
discussion:
types: [labeled]

permissions:
contents: read
issues: write
discussions: write

jobs:
reaction:
Expand All @@ -15,4 +18,4 @@ jobs:
- uses: dessant/label-actions@93ea5ec1d65e6a21427a1571a18a5b8861206b0b # renovate: tag=v2.2.0
with:
github-token: ${{ github.token }}
process-only: 'issues'
process-only: 'issues, discussions'
38 changes: 38 additions & 0 deletions docs/usage/configuration-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -2163,6 +2163,44 @@ It will be compiled using Handlebars and the regex `groups` result.
If the `registryUrls` for a dependency is not captured with a named group then it can be defined in config using this field.
It will be compiled using Handlebars and the regex `groups` result.

### autoReplaceStringTemplate

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:

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

regex definition:

```json
{
"regexManagers": [
{
"fileMatch": ["values.yaml$"],
"matchStrings": [
"image:\\s+(?<depName>my\\.old\\.registry\\/aRepository\\/andImage):(?<currentValue>[^\\s]+)"
],
"depNameTemplate": "my.new.registry/aRepository/andImage",
"autoReplaceStringTemplate": "image: {{{depName}}}:{{{newValue}}}",
"datasourceTemplate": "docker"
}
]
}
```

This will lead to following update where `1.21-alpine` is the newest version of `my.new.registry/aRepository/andImage`:

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

## registryUrls

Usually Renovate is able to either (a) use the default registries for a datasource, or (b) automatically detect during the manager extract phase which custom registries are in use.
Expand Down
4 changes: 2 additions & 2 deletions lib/config/migration.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PLATFORM_TYPE_GITHUB } from '../constants/platforms';
import { PlatformId } from '../constants';
import { getConfig } from './defaults';
import { setGlobalConfig } from './global';
import * as configMigration from './migration';
Expand All @@ -20,7 +20,7 @@ describe('config/migration', () => {
const config: TestRenovateConfig = {
endpoints: [{}] as never,
enabled: true,
platform: PLATFORM_TYPE_GITHUB,
platform: PlatformId.Github,
hostRules: [
{
platform: 'docker',
Expand Down
13 changes: 11 additions & 2 deletions lib/config/options/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PLATFORM_TYPE_GITHUB } from '../../constants/platforms';
import { PlatformId } from '../../constants';
import { getManagers } from '../../manager';
import { getPlatformList } from '../../platform';
import { getVersioningList } from '../../versioning';
Expand Down Expand Up @@ -559,7 +559,7 @@ const options: RenovateOptions[] = [
description: 'Platform type of repository.',
type: 'string',
allowedValues: getPlatformList(),
default: PLATFORM_TYPE_GITHUB,
default: PlatformId.Github,
globalOnly: true,
},
{
Expand Down Expand Up @@ -2016,6 +2016,15 @@ const options: RenovateOptions[] = [
cli: false,
env: false,
},
{
name: 'autoReplaceStringTemplate',
description:
'Optional extractVersion for extracted dependencies. Valid only within a `regexManagers` object.',
type: 'string',
parent: 'regexManagers',
cli: false,
env: false,
},
{
name: 'fetchReleaseNotes',
description: 'Allow to disable release notes fetching.',
Expand Down
2 changes: 2 additions & 0 deletions lib/config/presets/internal/compatibility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { Preset } from '../types';

export const presets: Record<string, Preset> = {
additionalBranchPrefix: {
description:
'Backwards-compatibility preset to restore additionalBranchPrefix settings for multiple managers which were removed in v25',
buildkite: {
additionalBranchPrefix: 'buildkite-',
},
Expand Down
2 changes: 1 addition & 1 deletion lib/config/presets/internal/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const presets: Record<string, Preset> = {
},
semverAllMonthly: {
description:
'Preserve semver ranges and update everything together once a month',
'Preserve SemVer ranges and update everything together once a month',
separateMajorMinor: false,
extends: [
':preserveSemverRanges',
Expand Down
6 changes: 3 additions & 3 deletions lib/config/presets/internal/docker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Preset } from '../types';

export const presets: Record<string, Preset> = {
disable: {
description: 'Disable docker updates',
description: 'Disable Docker updates',
docker: {
enabled: false,
},
Expand All @@ -14,7 +14,7 @@ export const presets: Record<string, Preset> = {
},
},
enableMajor: {
description: 'Enable docker major updates',
description: 'Enable Docker major updates',
packageRules: [
{
matchDatasources: ['docker'],
Expand All @@ -24,7 +24,7 @@ export const presets: Record<string, Preset> = {
],
},
disableMajor: {
description: 'Disable docker major updates',
description: 'Disable Docker major updates',
packageRules: [
{
matchDatasources: ['docker'],
Expand Down
14 changes: 7 additions & 7 deletions lib/config/presets/internal/group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ const staticGroups = {
],
},
fusionjs: {
description: 'Fusion.js packages',
description: 'Group Fusion.js packages together',
matchPackageNames: [
'fusion-cli',
'fusion-core',
Expand All @@ -160,7 +160,7 @@ const staticGroups = {
],
},
illuminate: {
description: 'Group PHP illuminate packages together',
description: 'Group PHP Illuminate packages together',
packageRules: [
{
matchPackagePrefixes: ['illuminate/'],
Expand All @@ -170,7 +170,7 @@ const staticGroups = {
],
},
symfony: {
description: 'Group PHP symfony packages together',
description: 'Group PHP Symfony packages together',
packageRules: [
{
matchPackagePrefixes: ['symfony/'],
Expand Down Expand Up @@ -451,7 +451,7 @@ const staticGroups = {
],
},
postcss: {
description: 'Group postcss packages together',
description: 'Group PostCSS packages together',
packageRules: [
{
extends: 'packages:postcss',
Expand All @@ -460,7 +460,7 @@ const staticGroups = {
],
},
jekyllEcosystem: {
description: 'Group jekyll and related ruby packages together',
description: 'Group Jekyll and related Ruby packages together',
packageRules: [
{
matchSourceUrlPrefixes: [
Expand All @@ -472,7 +472,7 @@ const staticGroups = {
],
},
rubyOmniauth: {
description: 'Group omniauth packages together',
description: 'Group OmniAuth packages together',
packageRules: [
{
matchDatasources: ['rubygems'],
Expand Down Expand Up @@ -587,7 +587,7 @@ const staticGroups = {
],
},
jestPlusTSJest: {
description: 'Add ts-jest major update to jest monorepo',
description: 'Add ts-jest major update to Jest monorepo',
packageRules: [
{
matchSourceUrlPrefixes: ['https://github.com/kulshekhar/ts-jest'],
Expand Down
1 change: 1 addition & 0 deletions lib/config/presets/internal/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type { Preset } from '../types';

export const presets: Record<string, Preset> = {
disableTypesNodeMajor: {
description: 'Disable major updates to <code>@types/node</code>',
packageRules: [
{
matchPackageNames: ['@types/node'],
Expand Down
12 changes: 6 additions & 6 deletions lib/config/presets/internal/packages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Preset } from '../types';

export const presets: Record<string, Preset> = {
angularJs: {
description: 'All angular.js packages',
description: 'All AngularJS packages',
matchPackageNames: [
'angular',
'angular-animate',
Expand All @@ -11,7 +11,7 @@ export const presets: Record<string, Preset> = {
],
},
react: {
description: 'All react packages',
description: 'All React packages',
matchPackageNames: ['@types/react'],
matchPackagePrefixes: ['react'],
},
Expand All @@ -28,7 +28,7 @@ export const presets: Record<string, Preset> = {
matchPackagePrefixes: ['ember-template-lint'],
},
eslint: {
description: 'All eslint packages',
description: 'All ESLint packages',
matchPackageNames: ['@types/eslint', 'babel-eslint'],
matchPackagePrefixes: ['@typescript-eslint/', 'eslint'],
},
Expand All @@ -37,7 +37,7 @@ export const presets: Record<string, Preset> = {
matchPackagePrefixes: ['stylelint'],
},
tslint: {
description: 'All tslint packages',
description: 'All TSLint packages',
matchPackageNames: ['codelyzer'],
matchPackagePatterns: ['\\btslint\\b'],
},
Expand All @@ -52,12 +52,12 @@ export const presets: Record<string, Preset> = {
matchPackageNames: ['remark-lint'],
},
postcss: {
description: 'All postcss packages',
description: 'All PostCSS packages',
matchPackageNames: ['postcss'],
matchPackagePrefixes: ['postcss-'],
},
jsUnitTest: {
description: 'Unit test packages for javascript',
description: 'Unit test packages for JavaScript',
matchPackageNames: [
'@types/chai',
'@types/ember-mocha',
Expand Down
1 change: 1 addition & 0 deletions lib/config/presets/internal/workarounds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const presets: Record<string, Preset> = {
],
},
mavenCommonsAncientVersion: {
description: 'Fix some problems with very old Maven commons versions',
packageRules: [
{
matchDatasources: ['maven', 'sbt-package'],
Expand Down
21 changes: 7 additions & 14 deletions lib/config/presets/local/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
import {
PLATFORM_TYPE_AZURE,
PLATFORM_TYPE_BITBUCKET,
PLATFORM_TYPE_BITBUCKET_SERVER,
PLATFORM_TYPE_GITEA,
PLATFORM_TYPE_GITHUB,
PLATFORM_TYPE_GITLAB,
} from '../../../constants/platforms';
import { PlatformId } from '../../../constants';
import * as azure from '../azure';
import * as bitbucket from '../bitbucket';
import * as bitbucketServer from '../bitbucket-server';
Expand All @@ -15,12 +8,12 @@ import * as gitlab from '../gitlab';
import type { Preset, PresetConfig } from '../types';

const resolvers = {
[PLATFORM_TYPE_AZURE]: azure,
[PLATFORM_TYPE_BITBUCKET]: bitbucket,
[PLATFORM_TYPE_BITBUCKET_SERVER]: bitbucketServer,
[PLATFORM_TYPE_GITEA]: gitea,
[PLATFORM_TYPE_GITHUB]: github,
[PLATFORM_TYPE_GITLAB]: gitlab,
[PlatformId.Azure]: azure,
[PlatformId.Bitbucket]: bitbucket,
[PlatformId.BitbucketServer]: bitbucketServer,
[PlatformId.Gitea]: gitea,
[PlatformId.Github]: github,
[PlatformId.Gitlab]: gitlab,
};

export function getPreset({
Expand Down
1 change: 1 addition & 0 deletions lib/config/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ export interface CustomManager {
datasourceTemplate?: string;
lookupNameTemplate?: string;
versioningTemplate?: string;
autoReplaceStringTemplate?: string;
}

// TODO: Proper typings
Expand Down
1 change: 1 addition & 0 deletions lib/config/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,7 @@ export async function validateConfig(
'registryUrlTemplate',
'currentValueTemplate',
'extractVersionTemplate',
'autoReplaceStringTemplate',
];
// TODO: fix types
for (const regexManager of val as any[]) {
Expand Down
1 change: 1 addition & 0 deletions lib/constants/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './platforms';
Loading

0 comments on commit 2ccae52

Please sign in to comment.