Skip to content
Snippets Groups Projects
Select Git revision
  • 8f78263455f615fb7ce535a3d852de2cef95cf4d
  • main default protected
  • dependabot/github_actions/ci-641206964f
  • upgrade-deps
  • release/v2.6.x
  • conform-k8s-1.33
  • rfc-external-artifact
  • release/v2.5.x
  • release/v2.4.x
  • remove-notation-validation
  • release/v2.3.x
  • release/v2.2.x
  • RFC
  • fix-commit-log
  • flux-audit
  • release/v2.1.x
  • context-ns
  • ksm-dashboard
  • rfc-passwordless-git-auth
  • release/v2.0.x
  • rfc-gating
  • v2.6.4 protected
  • v2.6.3 protected
  • v2.6.2 protected
  • v2.6.1 protected
  • v2.6.0 protected
  • v2.5.1 protected
  • v2.5.0 protected
  • v2.4.0 protected
  • v2.3.0 protected
  • v2.2.3 protected
  • v2.2.2 protected
  • v2.2.1 protected
  • v2.2.0 protected
  • v2.1.2 protected
  • v2.1.1 protected
  • v2.1.0 protected
  • v2.0.1 protected
  • v2.0.0 protected
  • v2.0.0-rc.5 protected
  • v2.0.0-rc.4 protected
41 results

log_level_test.go

Blame
  • migrate-validate.js 1.40 KiB
    const configMigration = require('./migration');
    const configMassage = require('./massage');
    const configValidation = require('./validation');
    
    module.exports = {
      migrateAndValidate,
    };
    
    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({ massagedConfig }, 'massaged config');
        const { warnings, errors } = 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;
      }
    }