diff --git a/lib/config/options/index.ts b/lib/config/options/index.ts index 0216f2b956a3a1d380fff502726319b81c3e7278..a98159d00acfbd68d6c2d61280e81bd4706f7026 100644 --- a/lib/config/options/index.ts +++ b/lib/config/options/index.ts @@ -2060,6 +2060,7 @@ const options: RenovateOptions[] = [ 'artifactErrors', 'deprecationWarningIssues', 'onboardingClose', + 'configErrorIssue', ], cli: false, env: false, diff --git a/lib/workers/repository/error-config.spec.ts b/lib/workers/repository/error-config.spec.ts index 84b3c6c38002d513c5103a503702434026c14522..90b57ae868e8139ce5184bc2a376bafefd8e7061 100644 --- a/lib/workers/repository/error-config.spec.ts +++ b/lib/workers/repository/error-config.spec.ts @@ -66,5 +66,20 @@ describe('workers/repository/error-config', () => { const res = await raiseConfigWarningIssue(config, error); expect(res).toBeUndefined(); }); + + it('disable issue creation on config failure', async () => { + const error = new Error(CONFIG_VALIDATION); + error.validationSource = 'package.json'; + error.validationMessage = 'some-message'; + // config.suppressNotifications = ['deprecationWarningIssues'] + config.suppressNotifications = ['configErrorIssue']; + platform.getBranchPr.mockResolvedValueOnce({ + ...mock<Pr>(), + number: 1, + state: PrState.NotOpen, + }); + const res = await raiseConfigWarningIssue(config, error); + expect(res).toBeUndefined(); + }); }); }); diff --git a/lib/workers/repository/error-config.ts b/lib/workers/repository/error-config.ts index 4a082c997d2ff89e1ac3bb199c582b4501883a8d..598ba15272f98f6e4a4edd9cc051e9d1e24cf627 100644 --- a/lib/workers/repository/error-config.ts +++ b/lib/workers/repository/error-config.ts @@ -41,6 +41,10 @@ export async function raiseConfigWarningIssue( } } else if (GlobalConfig.get('dryRun')) { logger.info('DRY-RUN: Would ensure config error issue'); + } else if (config.suppressNotifications?.includes('configErrorIssue')) { + logger.info( + 'configErrorIssue - configuration failure, issues will be suppressed' + ); } else { const once = false; const shouldReopen = config.configWarningReuseIssue;