feat: display extended error in onboarding if lookup fails (#744)

Closes #626
This commit is contained in:
Rhys Arkins 2017-08-27 13:55:41 +02:00 committed by GitHub
parent 7c3df0ba23
commit 8ebb32cd87
6 changed files with 13 additions and 3 deletions

View file

@ -91,7 +91,10 @@ async function processBranch(branchConfig) {
}
try {
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);
// TODO: ensurePr should check for automerge itself
if (pr) {

View file

@ -43,6 +43,10 @@ async function renovatePackage(config) {
type: 'error',
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];
if (config.depName[0] === '@') {
logger.info(result.message);

View file

@ -14,7 +14,6 @@ module.exports = {
async function ensurePr(prConfig) {
const config = { ...prConfig };
const { logger } = config;
logger.debug('ensuring PR');
logger.trace({ config }, 'ensurePr');
// If there is a group, it will use the config of the first upgrade in the array
const upgrades = config.upgrades;

View file

@ -30,6 +30,8 @@ describe('workers/branch', () => {
config = {
...defaultConfig,
api: { branchExists: jest.fn() },
errors: [],
warnings: [],
logger,
upgrades: [{}],
};

View file

@ -147,9 +147,10 @@ This {{#if isGitHub}}PR{{else}}MR{{/if}} has been generated by [Renovate Bot](ht
},
"groupName": null,
"groupSlug": null,
"hasYarnLock": true,
"labels": Array [],
"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 [],
"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}}

View file

@ -29,6 +29,7 @@ describe('lib/workers/package/index', () => {
it('returns error if no npm dep found', async () => {
config.repoIsOnboarded = true;
config.schedule = 'some schedule';
config.hasYarnLock = true;
const res = await pkgWorker.renovatePackage(config);
expect(res).toMatchSnapshot();
expect(res).toHaveLength(1);