Skip to content

Commit

Permalink
Change error log messages to warnings in commodore-helm
Browse files Browse the repository at this point in the history
This allows us to enable the manager globally without Renovate exiting
with an error if the manager is active on a repo which isn't a component
repo.
  • Loading branch information
simu committed Feb 24, 2022
1 parent 1ee65ce commit 68a4feb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
16 changes: 8 additions & 8 deletions src/commodore-helm/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,10 @@ describe('manager/commodore-helm/index', () => {
const res = await extractAllPackageFiles({}, ['class/defaults.yml']);
expect(res).toBeNull();
const errors = getLoggerErrors();
expect(errors.length).toBe(1);
const err0 = errors[0];
expect(err0.msg).toBe('Expected exactly two package files, aborting.');
if (errors.length > 0) {
console.log(errors);
}
expect(errors.length).toBe(0);
});
it('records an error for non-component repositories which have two package files', async () => {
const res = await extractAllPackageFiles({}, [
Expand All @@ -296,11 +297,10 @@ describe('manager/commodore-helm/index', () => {
]);
expect(res).toBeNull();
const errors = getLoggerErrors();
expect(errors.length).toBe(1);
const err0 = errors[0];
expect(err0.msg).toBe(
'Component repository has no `class/defaults.ya?ml`'
);
if (errors.length > 0) {
console.log(errors);
}
expect(errors.length).toBe(0);
});
it('extracts new and old standard Helm dependencies in the same file', async () => {
setGlobalConfig('7');
Expand Down
10 changes: 5 additions & 5 deletions src/commodore-helm/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ export async function extractAllPackageFiles(
let defaults_file: string | null = null;

if (packageFiles.length != 2) {
logger.error(
logger.warn(
{ packageFiles },
'Expected exactly two package files, aborting.'
'Expected exactly two package files, skipping.'
);
return null;
}
Expand All @@ -148,14 +148,14 @@ export async function extractAllPackageFiles(
}

if (!fileContents.has('defaults') || !defaults_file) {
logger.error('Component repository has no `class/defaults.ya?ml`');
logger.warn('Repository has no `class/defaults.ya?ml`, skipping');
return null;
}

if (!componentName) {
logger.error(
logger.warn(
{ packageFiles },
'Unable to identify component name from package files'
'Unable to identify component name from package files, skipping'
);
return null;
}
Expand Down

0 comments on commit 68a4feb

Please sign in to comment.