Skip to content

Commit

Permalink
feat(config): print hostRules when printConfig=true (#15699)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shegox committed Jun 23, 2022
1 parent bce8dcc commit 3d96c7c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
5 changes: 5 additions & 0 deletions docs/usage/configuration-options.md
Expand Up @@ -2116,6 +2116,11 @@ Here's an example of how you would define PR priority so that devDependencies ar

The PR title is important for some of Renovate's matching algorithms (e.g. determining whether to recreate a PR or not) so ideally don't modify it much.

## printConfig

This option is useful for troubleshooting, particularly if using presets.
e.g. run `renovate foo/bar --print-config > config.log` and the fully-resolved config will be included in the log file.

## pruneBranchAfterAutomerge

By default Renovate deletes, or "prunes", the branch after automerging.
Expand Down
5 changes: 0 additions & 5 deletions docs/usage/self-hosted-configuration.md
Expand Up @@ -487,11 +487,6 @@ CI jobs are usually triggered by these events: pull-request creation, pull-reque
Set as an integer.
Default is no limit.

## printConfig

This option is useful for troubleshooting, particularly if using presets.
e.g. run `renovate foo/bar --print-config > config.log` and the fully-resolved config will be included in the log file.

## privateKey

This private key is used to decrypt config files.
Expand Down
3 changes: 1 addition & 2 deletions lib/config/options/index.ts
Expand Up @@ -262,9 +262,8 @@ const options: RenovateOptions[] = [
{
name: 'printConfig',
description:
'If enabled, Renovate logs the fullly resolved config for each repo, plus the fully resolved presets.',
'If enabled, Renovate logs the fully resolved config for each repo, plus the fully resolved presets.',
type: 'boolean',
globalOnly: true,
default: false,
},
{
Expand Down
6 changes: 5 additions & 1 deletion lib/workers/repository/init/index.ts
Expand Up @@ -5,6 +5,7 @@ import { logger } from '../../../logger';
import { platform } from '../../../modules/platform';
import { clone } from '../../../util/clone';
import { setUserRepoConfig } from '../../../util/git';
import { getAll } from '../../../util/host-rules';
import { checkIfConfigured } from '../configured';
import { PackageFiles } from '../package-files';
import { initApis } from './apis';
Expand Down Expand Up @@ -41,7 +42,10 @@ export async function initRepo(
config = await detectVulnerabilityAlerts(config);
// istanbul ignore if
if (config.printConfig) {
logger.info({ config }, 'Full resolved config including presets');
logger.info(
{ config, hostRules: getAll() },
'Full resolved config and hostRules including presets'
);
}
return config;
}

0 comments on commit 3d96c7c

Please sign in to comment.