mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-11 22:46:27 +00:00
feat: display extended error in onboarding if lookup fails (#744)
Closes #626
This commit is contained in:
parent
7c3df0ba23
commit
8ebb32cd87
6 changed files with 13 additions and 3 deletions
|
@ -91,7 +91,10 @@ async function processBranch(branchConfig) {
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
logger.debug('Ensuring PR');
|
logger.debug('Ensuring PR');
|
||||||
logger.trace({ config }, 'test');
|
logger.debug(
|
||||||
|
`There are ${config.errors.length} errors and ${config.warnings
|
||||||
|
.length} warnings`
|
||||||
|
);
|
||||||
const pr = await prWorker.ensurePr(config);
|
const pr = await prWorker.ensurePr(config);
|
||||||
// TODO: ensurePr should check for automerge itself
|
// TODO: ensurePr should check for automerge itself
|
||||||
if (pr) {
|
if (pr) {
|
||||||
|
|
|
@ -43,6 +43,10 @@ async function renovatePackage(config) {
|
||||||
type: 'error',
|
type: 'error',
|
||||||
message: 'Failed to look up dependency',
|
message: 'Failed to look up dependency',
|
||||||
};
|
};
|
||||||
|
if (config.hasYarnLock || config.hasPackageLock) {
|
||||||
|
result.message +=
|
||||||
|
'. This will block *all* dependencies from being updated due to presence of lock file.';
|
||||||
|
}
|
||||||
results = [result];
|
results = [result];
|
||||||
if (config.depName[0] === '@') {
|
if (config.depName[0] === '@') {
|
||||||
logger.info(result.message);
|
logger.info(result.message);
|
||||||
|
|
|
@ -14,7 +14,6 @@ module.exports = {
|
||||||
async function ensurePr(prConfig) {
|
async function ensurePr(prConfig) {
|
||||||
const config = { ...prConfig };
|
const config = { ...prConfig };
|
||||||
const { logger } = config;
|
const { logger } = config;
|
||||||
logger.debug('ensuring PR');
|
|
||||||
logger.trace({ config }, 'ensurePr');
|
logger.trace({ config }, 'ensurePr');
|
||||||
// If there is a group, it will use the config of the first upgrade in the array
|
// If there is a group, it will use the config of the first upgrade in the array
|
||||||
const upgrades = config.upgrades;
|
const upgrades = config.upgrades;
|
||||||
|
|
|
@ -30,6 +30,8 @@ describe('workers/branch', () => {
|
||||||
config = {
|
config = {
|
||||||
...defaultConfig,
|
...defaultConfig,
|
||||||
api: { branchExists: jest.fn() },
|
api: { branchExists: jest.fn() },
|
||||||
|
errors: [],
|
||||||
|
warnings: [],
|
||||||
logger,
|
logger,
|
||||||
upgrades: [{}],
|
upgrades: [{}],
|
||||||
};
|
};
|
||||||
|
|
|
@ -147,9 +147,10 @@ This {{#if isGitHub}}PR{{else}}MR{{/if}} has been generated by [Renovate Bot](ht
|
||||||
},
|
},
|
||||||
"groupName": null,
|
"groupName": null,
|
||||||
"groupSlug": null,
|
"groupSlug": null,
|
||||||
|
"hasYarnLock": true,
|
||||||
"labels": Array [],
|
"labels": Array [],
|
||||||
"lazyGrouping": true,
|
"lazyGrouping": true,
|
||||||
"message": "Failed to look up dependency",
|
"message": "Failed to look up dependency. This will block *all* dependencies from being updated due to presence of lock file.",
|
||||||
"packageFiles": Array [],
|
"packageFiles": Array [],
|
||||||
"prBody": "This {{#if isGitHub}}Pull{{else}}Merge{{/if}} Request {{#if isRollback}}rolls back{{else}}updates{{/if}} dependency {{#if repositoryUrl}}[{{depName}}]({{repositoryUrl}}){{else}}\`{{depName}}\`{{/if}} from \`v{{currentVersion}}\` to \`v{{newVersion}}\`{{#if isRollback}}. This is necessary and important because \`v{{currentVersion}}\` cannot be found in the npm registry - probably because of it being unpublished.{{/if}}
|
"prBody": "This {{#if isGitHub}}Pull{{else}}Merge{{/if}} Request {{#if isRollback}}rolls back{{else}}updates{{/if}} dependency {{#if repositoryUrl}}[{{depName}}]({{repositoryUrl}}){{else}}\`{{depName}}\`{{/if}} from \`v{{currentVersion}}\` to \`v{{newVersion}}\`{{#if isRollback}}. This is necessary and important because \`v{{currentVersion}}\` cannot be found in the npm registry - probably because of it being unpublished.{{/if}}
|
||||||
{{#if releases.length}}
|
{{#if releases.length}}
|
||||||
|
|
|
@ -29,6 +29,7 @@ describe('lib/workers/package/index', () => {
|
||||||
it('returns error if no npm dep found', async () => {
|
it('returns error if no npm dep found', async () => {
|
||||||
config.repoIsOnboarded = true;
|
config.repoIsOnboarded = true;
|
||||||
config.schedule = 'some schedule';
|
config.schedule = 'some schedule';
|
||||||
|
config.hasYarnLock = true;
|
||||||
const res = await pkgWorker.renovatePackage(config);
|
const res = await pkgWorker.renovatePackage(config);
|
||||||
expect(res).toMatchSnapshot();
|
expect(res).toMatchSnapshot();
|
||||||
expect(res).toHaveLength(1);
|
expect(res).toHaveLength(1);
|
||||||
|
|
Loading…
Reference in a new issue