diff --git a/lib/config/definitions.js b/lib/config/definitions.js index 13366aaa74fc4033ad104a3f8149c8bf10c3294a..01cc5078c6239de167806877fd9dc949ba6b6b41 100644 --- a/lib/config/definitions.js +++ b/lib/config/definitions.js @@ -56,6 +56,14 @@ const options = [ admin: true, default: false, }, + { + name: 'printConfig', + description: + 'If enabled, Renovate will log the full config for each repo, including resolved presets', + type: 'boolean', + admin: true, + default: false, + }, { name: 'binarySource', description: 'Where to source binaries like `npm` and `yarn` from', diff --git a/lib/workers/repository/init/index.js b/lib/workers/repository/init/index.js index 35733eee740fb43fe5ee94bc2bcfa3375ab3b85b..b8b4f90f53e140fee5e6152345eff9aa7cda71be 100644 --- a/lib/workers/repository/init/index.js +++ b/lib/workers/repository/init/index.js @@ -22,6 +22,10 @@ async function initRepo(input) { config = await checkBaseBranch(config); config.semanticCommits = await detectSemanticCommits(config); config = await detectVulnerabilityAlerts(config); + // istanbul ignore if + if (config.printConfig) { + logger.info({ config }, 'Full resolved config including presets'); + } return config; } diff --git a/test/workers/repository/updates/__snapshots__/flatten.spec.js.snap b/test/workers/repository/updates/__snapshots__/flatten.spec.js.snap index 807664ce672aeaa6023620302d220027908b0138..61971df0b1db0e4e61cfd77996ed24109371b367 100644 --- a/test/workers/repository/updates/__snapshots__/flatten.spec.js.snap +++ b/test/workers/repository/updates/__snapshots__/flatten.spec.js.snap @@ -64,6 +64,7 @@ Array [ "prHourlyLimit": 0, "prNotPendingHours": 25, "prTitle": null, + "printConfig": false, "rangeStrategy": "replace", "rebaseLabel": "rebase", "rebaseStalePrs": null, @@ -157,6 +158,7 @@ Array [ "prHourlyLimit": 0, "prNotPendingHours": 25, "prTitle": null, + "printConfig": false, "rangeStrategy": "replace", "rebaseLabel": "rebase", "rebaseStalePrs": null, @@ -247,6 +249,7 @@ Array [ "prHourlyLimit": 0, "prNotPendingHours": 25, "prTitle": null, + "printConfig": false, "rangeStrategy": "replace", "rebaseLabel": "rebase", "rebaseStalePrs": true, @@ -343,6 +346,7 @@ Array [ "prHourlyLimit": 0, "prNotPendingHours": 25, "prTitle": null, + "printConfig": false, "rangeStrategy": "replace", "rebaseLabel": "rebase", "rebaseStalePrs": null, @@ -433,6 +437,7 @@ Array [ "prHourlyLimit": 0, "prNotPendingHours": 25, "prTitle": null, + "printConfig": false, "rangeStrategy": "replace", "rebaseLabel": "rebase", "rebaseStalePrs": true, @@ -529,6 +534,7 @@ Array [ "prHourlyLimit": 0, "prNotPendingHours": 25, "prTitle": null, + "printConfig": false, "rangeStrategy": "replace", "rebaseLabel": "rebase", "rebaseStalePrs": null, @@ -622,6 +628,7 @@ Array [ "prHourlyLimit": 0, "prNotPendingHours": 25, "prTitle": null, + "printConfig": false, "rangeStrategy": "replace", "rebaseLabel": "rebase", "rebaseStalePrs": null, @@ -715,6 +722,7 @@ Array [ "prHourlyLimit": 0, "prNotPendingHours": 25, "prTitle": null, + "printConfig": false, "rangeStrategy": "replace", "rebaseLabel": "rebase", "rebaseStalePrs": null, diff --git a/website/docs/self-hosted-configuration.md b/website/docs/self-hosted-configuration.md index 58103e3dd46af6d5852a161a53c38c9a16eb8438..e537f9ee4bb2acf2b08aace88998ba48d2a52b2d 100644 --- a/website/docs/self-hosted-configuration.md +++ b/website/docs/self-hosted-configuration.md @@ -66,6 +66,10 @@ Set this to `false` if (a) you configure Renovate entirely on the bot side (i.e. ## prFooter +## 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 ## repositories