Skip to content

Commit

Permalink
feat: log "hasConfig"
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m committed Dec 1, 2018
1 parent 2f03efa commit f7482ed
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
10 changes: 7 additions & 3 deletions lib/logs/get-child.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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 () {
Expand Down
6 changes: 3 additions & 3 deletions lib/pro/get-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ async function getConfig (context) {

if (!config) {
return {
config: [defaultConfig],
isDefaultConfig: true
config: [defaultConfig]
}
}

Expand All @@ -36,6 +35,7 @@ async function getConfig (context) {
})

return {
config
config,
hasCustomConfig: true
}
}
6 changes: 3 additions & 3 deletions lib/pro/get-status.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ async function getStatusPro (context) {
}
}

const { config, isDefaultConfig } = await getConfig(context)
const { config, hasCustomConfig } = await getConfig(context)

const state = {
commitSubjects: []
Expand All @@ -32,7 +32,7 @@ async function getStatusPro (context) {
return {
wip: true,
config,
isDefaultConfig,
hasCustomConfig,
...match
}
}
Expand All @@ -41,7 +41,7 @@ async function getStatusPro (context) {
return {
wip: false,
config,
isDefaultConfig
hasCustomConfig
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/pro/set-status.js
Original file line number Diff line number Diff line change
Expand Up @@ -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:
<table>
Expand Down

1 comment on commit f7482ed

@vercel
Copy link

@vercel vercel bot commented on f7482ed Dec 1, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully aliased the URL https://wip-efzjondtyk.now.sh to the following alias.

Please sign in to comment.