diff --git a/lib/logs/get-child.js b/lib/logs/get-child.js index c9801bc43..ad68b7a92 100644 --- a/lib/logs/get-child.js +++ b/lib/logs/get-child.js @@ -3,7 +3,7 @@ module.exports = getChildLog const getConfig = require('../app-config') function getChildLog ({ context, action, plan, newStatus, repo, hasChange, shortUrl }) { - const log = context.log.child({ + const options = { name: getConfig().name, event: context.event, action, @@ -12,11 +12,15 @@ function getChildLog ({ context, action, plan, newStatus, repo, hasChange, short repo: repo.id, private: repo.private, change: hasChange, - override: newStatus.override, wip: newStatus.wip, location: newStatus.location, match: newStatus.match - }) + } + if (plan === 'pro') { + options.hasConfig = !!newStatus.hasCustomConfig + options.override = newStatus.override + } + const log = context.log.child(options) return { noUpdate () { diff --git a/lib/pro/get-config.js b/lib/pro/get-config.js index 05fb5e90e..b5d024050 100644 --- a/lib/pro/get-config.js +++ b/lib/pro/get-config.js @@ -10,8 +10,7 @@ async function getConfig (context) { if (!config) { return { - config: [defaultConfig], - isDefaultConfig: true + config: [defaultConfig] } } @@ -36,6 +35,7 @@ async function getConfig (context) { }) return { - config + config, + hasCustomConfig: true } } diff --git a/lib/pro/get-status.js b/lib/pro/get-status.js index 0a474e827..29095d5fe 100644 --- a/lib/pro/get-status.js +++ b/lib/pro/get-status.js @@ -15,7 +15,7 @@ async function getStatusPro (context) { } } - const { config, isDefaultConfig } = await getConfig(context) + const { config, hasCustomConfig } = await getConfig(context) const state = { commitSubjects: [] @@ -32,7 +32,7 @@ async function getStatusPro (context) { return { wip: true, config, - isDefaultConfig, + hasCustomConfig, ...match } } @@ -41,7 +41,7 @@ async function getStatusPro (context) { return { wip: false, config, - isDefaultConfig + hasCustomConfig } } diff --git a/lib/pro/set-status.js b/lib/pro/set-status.js index 3600a644b..4891eba23 100644 --- a/lib/pro/set-status.js +++ b/lib/pro/set-status.js @@ -59,7 +59,7 @@ Read more about [WIP configuration](https://github.com/wip/app#configuration)` description: 'Remove status override', identifier: `reset:${pullRequest.number}` }) - } else if (!newStatus.isDefaultConfig) { + } else if (newStatus.hasCustomConfig) { checkOptions.output.text = `The following configuration was applied: