Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(warnings): add encryptedWarning text parameter #29120

Merged
merged 37 commits into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
0c8f60f
fix(worker): don't coerce valid semver versions
viceice Jun 5, 2023
a41862e
Merge branch 'main' of https://github.com/renovateBot/renovate
PhilipAbed Jul 12, 2023
ebdbd00
Merge branch 'main' of https://github.com/renovateBot/renovate
PhilipAbed Jul 24, 2023
f963606
Merge branch 'main' of https://github.com/renovateBot/renovate
PhilipAbed Aug 2, 2023
89fa0b8
Merge branch 'main' of https://github.com/renovateBot/renovate
PhilipAbed Aug 3, 2023
b7837af
Merge branch 'main' of https://github.com/renovateBot/renovate
PhilipAbed Aug 8, 2023
4634ff3
Merge branch 'main' of https://github.com/renovateBot/renovate
PhilipAbed Aug 9, 2023
aeba91b
Merge branch 'main' of https://github.com/renovateBot/renovate
PhilipAbed Aug 15, 2023
3d430bf
Merge branch 'main' of https://github.com/renovateBot/renovate
PhilipAbed Aug 16, 2023
5b94272
Merge branch 'main' of https://github.com/renovateBot/renovate
PhilipAbed Aug 21, 2023
ca8bce3
Merge branch 'main' of https://github.com/renovateBot/renovate
PhilipAbed Aug 21, 2023
64fe0cf
Merge branch 'main' of https://github.com/renovateBot/renovate
PhilipAbed Sep 14, 2023
5a8aed2
Merge branch 'main' of https://github.com/renovateBot/renovate
PhilipAbed Oct 26, 2023
d7ded40
Merge branch 'main' of https://github.com/renovateBot/renovate
PhilipAbed Nov 1, 2023
602a2df
Merge branch 'main' of https://github.com/renovateBot/renovate
PhilipAbed Nov 16, 2023
a002cbb
Merge branch 'main' of https://github.com/renovateBot/renovate
PhilipAbed Nov 21, 2023
0864d5e
Merge branch 'main' of https://github.com/renovateBot/renovate
PhilipAbed Feb 4, 2024
9c4c2c1
Merge branch 'main' of https://github.com/renovateBot/renovate
PhilipAbed Mar 3, 2024
6fa5fc3
Merge branch 'main' of https://github.com/renovateBot/renovate
PhilipAbed Mar 14, 2024
e9f6bb7
Merge branch 'main' of https://github.com/renovateBot/renovate
PhilipAbed Apr 2, 2024
a6d9d2f
Merge branch 'main' of https://github.com/renovateBot/renovate
PhilipAbed May 7, 2024
7d0e609
Merge branch 'main' of https://github.com/renovateBot/renovate
PhilipAbed May 15, 2024
94803f3
add to dashboard
PhilipAbed May 15, 2024
5bfb337
add docs
PhilipAbed May 16, 2024
eae4e1a
fix lint
PhilipAbed May 16, 2024
725bc97
fix comments
PhilipAbed May 16, 2024
6ecea13
fix comments
PhilipAbed May 21, 2024
fcbf255
fix comments
PhilipAbed May 22, 2024
68c2d08
rollback
PhilipAbed May 26, 2024
84e550f
lint fix
PhilipAbed May 26, 2024
ccb4fb6
lint fix
PhilipAbed May 26, 2024
2e0e246
lint fix
PhilipAbed May 26, 2024
d75f295
lint fix
PhilipAbed May 27, 2024
3341ec2
lint fix
PhilipAbed May 27, 2024
5b390b6
Update lib/config/options/index.ts
PhilipAbed May 27, 2024
2fb6682
Update docs/usage/self-hosted-configuration.md
PhilipAbed May 27, 2024
d1c6ede
Update lib/config/options/index.ts
viceice May 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/usage/self-hosted-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,12 @@ You can choose from the following behaviors for the `dryRun` config option:

Information provided mainly in debug log level.

## encryptedWarning
PhilipAbed marked this conversation as resolved.
Show resolved Hide resolved

Use this if you want to stop supporting `encrypted` configuration capabilities but want to warn users first to migrate.

If set to a string value, Renovate will log warnings with the `encryptedWarning` text, meaning the message will be visible to users such as on the Dependency Dashboard.

## endpoint

## executionTimeout
Expand Down
5 changes: 5 additions & 0 deletions lib/config/decrypt.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { logger } from '../../test/util';
import { decryptConfig } from './decrypt';
import { GlobalConfig } from './global';
import type { RenovateConfig } from './types';
Expand All @@ -21,7 +22,11 @@ describe('config/decrypt', () => {

it('warns if no privateKey found', async () => {
config.encrypted = { a: '1' };
GlobalConfig.set({ encryptedWarning: 'text' });

const res = await decryptConfig(config, repository);

expect(logger.logger.once.warn).toHaveBeenCalledWith('text');
expect(res.encrypted).toBeUndefined();
expect(res.a).toBeUndefined();
});
Expand Down
6 changes: 6 additions & 0 deletions lib/config/decrypt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,12 @@ export async function decryptConfig(
for (const [key, val] of Object.entries(config)) {
if (key === 'encrypted' && is.object(val)) {
logger.debug({ config: val }, 'Found encrypted config');

const encryptedWarning = GlobalConfig.get('encryptedWarning');
if (is.string(encryptedWarning)) {
logger.once.warn(encryptedWarning);
}

if (privateKey) {
for (const [eKey, eVal] of Object.entries(val)) {
logger.debug('Trying to decrypt ' + eKey);
Expand Down
1 change: 1 addition & 0 deletions lib/config/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export class GlobalConfig {
'dockerSidecarImage',
'dockerUser',
'dryRun',
'encryptedWarning',
'exposeAllEnv',
'executionTimeout',
'githubTokenWarn',
Expand Down
9 changes: 8 additions & 1 deletion lib/config/options/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -627,10 +627,17 @@ const options: RenovateOptions[] = [
default: true,
globalOnly: true,
},
{
name: 'encryptedWarning',
PhilipAbed marked this conversation as resolved.
Show resolved Hide resolved
description: 'Warning text to use if encrypted config is found.',
type: 'string',
globalOnly: true,
PhilipAbed marked this conversation as resolved.
Show resolved Hide resolved
advancedUse: true,
},
{
name: 'inheritConfig',
description:
'If `true`, Renovate will inherit configuration from the `inheritConfigFileName` file in `inheritConfigRepoName',
'If `true`, Renovate will inherit configuration from the `inheritConfigFileName` file in `inheritConfigRepoName`',
viceice marked this conversation as resolved.
Show resolved Hide resolved
type: 'boolean',
default: false,
globalOnly: true,
Expand Down
1 change: 1 addition & 0 deletions lib/config/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ export interface RepoGlobalConfig {
dockerSidecarImage?: string;
dockerUser?: string;
dryRun?: DryRunConfig;
encryptedWarning?: string;
endpoint?: string;
executionTimeout?: number;
exposeAllEnv?: boolean;
Expand Down