Skip to content

Commit

Permalink
fix: Revert "fix(renovate-config-validator): add validate presets to …
Browse files Browse the repository at this point in the history
…the validator" (#17012)

Revert "fix(renovate-config-validator): add validate presets to the validator (#16468)"

This reverts commit 4b0b49e.
  • Loading branch information
viceice committed Aug 6, 2022
1 parent be316c5 commit ce23187
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 33 deletions.
20 changes: 1 addition & 19 deletions lib/config/validation.spec.ts
@@ -1,4 +1,3 @@
import * as httpMock from '../../test/http-mock';
import type { RenovateConfig } from './types';
import * as configValidation from './validation';

Expand Down Expand Up @@ -630,24 +629,7 @@ describe('config/validation', () => {

it('validates preset values', async () => {
const config = {
extends: ['config:base', ':pinVersions', 42] as never,
};
const { warnings, errors } = await configValidation.validateConfig(
config,
true
);
expect(warnings).toHaveLength(0);
expect(errors).toHaveLength(1);
});

it('validates if presets exist', async () => {
httpMock
.scope('https://registry.npmjs.org')
.get('/renovate-config-doesntExist')
.reply(500);

const config = {
extends: ['config:base', 'doesntExist'] as never,
extends: ['foo', 'bar', 42] as never,
};
const { warnings, errors } = await configValidation.validateConfig(
config,
Expand Down
15 changes: 1 addition & 14 deletions lib/config/validation.ts
@@ -1,5 +1,4 @@
import is from '@sindresorhus/is';
import { logger } from '../logger';
import { getLanguageList, getManagerList } from '../modules/manager';
import { configRegexPredicate, isConfigRegex, regEx } from '../util/regex';
import * as template from '../util/template';
Expand All @@ -9,7 +8,7 @@ import {
} from '../workers/repository/update/branch/schedule';
import { migrateConfig } from './migration';
import { getOptions } from './options';
import { getPreset, resolveConfigPresets } from './presets';
import { resolveConfigPresets } from './presets';
import type {
RenovateConfig,
RenovateOptions,
Expand Down Expand Up @@ -272,18 +271,6 @@ export async function validateConfig(
if (key === 'extends') {
for (const subval of val) {
if (is.string(subval)) {
try {
await getPreset(subval, config);
} catch (err) {
logger.debug(
{ err, preset: subval },
`Could not resolve preset during config validation`
);
errors.push({
topic: 'Configuration Warning',
message: `Invalid Preset ${subval}`,
});
}
if (
parentName === 'packageRules' &&
subval.startsWith('group:')
Expand Down

0 comments on commit ce23187

Please sign in to comment.