Skip to content
Snippets Groups Projects
Select Git revision
  • cbe02e1d5edbcfab1f99fe968c58e2e1db8e6f4e
  • main default protected
  • dependabot/docker/golang-1.24.5
  • lihiz_preflight
  • release/prepare-v0.10.7
  • dependabot/github_actions/golangci/golangci-lint-action-7
  • release/prepare-v0.9.1
  • gh-pages
  • aquadev
  • v0.11.1
  • v0.11.0
  • v0.10.7
  • v0.10.6
  • v0.10.5
  • v0.10.4
  • v0.10.3
  • v0.10.2
  • v0.10.1
  • v0.10.0
  • v0.9.4
  • v0.9.3
  • v0.9.2
  • v0.9.1
  • v0.9.0
  • v0.8.0
  • v0.7.3
  • v0.7.2
  • v0.7.1
  • v0.7.0
29 results

check.go

Blame
  • migrate-validate.js 1.42 KiB
    const configMigration = require('./migration');
    const configMassage = require('./massage');
    const configValidation = require('./validation');
    
    module.exports = {
      migrateAndValidate,
    };
    
    async function migrateAndValidate(config, input) {
      logger.debug('migrateAndValidate()');
      try {
        const { isMigrated, migratedConfig } = configMigration.migrateConfig(input);
        if (isMigrated) {
          logger.info(
            { oldConfig: input, newConfig: migratedConfig },
            'Config migration necessary'
          );
        } else {
          logger.debug('No config migration necessary');
        }
        const massagedConfig = configMassage.massageConfig(migratedConfig);
        logger.debug({ config: massagedConfig }, 'massaged config');
        const { warnings, errors } = await configValidation.validateConfig(
          massagedConfig
        );
        // istanbul ignore if
        if (warnings && warnings.length) {
          logger.info({ warnings }, 'Found renovate config warnings');
        }
        if (errors && errors.length) {
          logger.info({ errors }, 'Found renovate config errors');
        }
        massagedConfig.errors = (config.errors || []).concat(errors);
        if (!config.repoIsOnboarded) {
          // TODO #556 - enable warnings in real PRs
          massagedConfig.warnings = (config.warnings || []).concat(warnings);
        }
        return massagedConfig;
      } catch (err) /* istanbul ignore next */ {
        logger.debug({ config: input }, 'migrateAndValidate error');
        throw err;
      }
    }