MediaWiki integration & integration architecture improvements . #16

Merged
raucao merged 19 commits from feature/6-mediawiki_integration into master 2018-04-21 09:31:30 +00:00
2 changed files with 188 additions and 155 deletions
Showing only changes of commit 5259b56e53 - Show all commits

190
index.js
View File

@@ -31,6 +31,15 @@ const ipfsConfig = {
};
module.exports = async function(robot) {
function messageRoom(message) {
robot.messageRoom(process.env.KREDITS_ROOM, message);
}
//
// Ethereum wallet setup
//
let wallet;
try {
wallet = await ethers.Wallet.fromEncryptedWallet(walletJson, process.env.KREDITS_WALLET_PASSWORD);
@@ -39,26 +48,34 @@ module.exports = async function(robot) {
process.exit(1);
}
//
// Ethereum provider/node setup
//
const ethProvider = new ethers.providers.JsonRpcProvider(providerUrl, {chainId: networkId});
ethProvider.signer = wallet;
wallet.provider = ethProvider;
//
// Kredits contracts setup
//
let kredits;
try {
kredits = await Kredits.setup(ethProvider, wallet, ipfsConfig);
} catch(error) {
console.log('[hubot-kredits] Could not setup kredits:', error);
console.log('[hubot-kredits] Could not set up kredits:', error);
process.exit(1);
}
const Contributor = kredits.Contributor;
const Operator = kredits.Operator;
function messageRoom(message) {
robot.messageRoom(process.env.KREDITS_ROOM, message);
}
robot.logger.info('[hubot-kredits] Wallet address: ' + wallet.address);
//
// Check robot's wallet balance and alert when it's broke
//
ethProvider.getBalance(wallet.address).then(balance => {
robot.logger.info('[hubot-kredits] Wallet balance: ' + ethers.utils.formatEther(balance) + 'ETH');
if (balance.lt(ethers.utils.parseEther('0.0001'))) {
@@ -66,6 +83,10 @@ module.exports = async function(robot) {
}
});
//
// Robot chat commands/interaction
//
robot.respond(/got ETH\??/i, res => {
ethProvider.getBalance(wallet.address).then((balance) => {
res.send(`my wallet contains ${ethers.utils.formatEther(balance)} ETH`);
@@ -93,156 +114,9 @@ module.exports = async function(robot) {
});
});
function getContributorByGithubUser(username) {
return Contributor.all().then(contributors => {
let contrib = contributors.find(c => {
return c.github_username === username;
});
if (!contrib) {
throw new Error(`No contributor found for ${username}`);A
} else {
return contrib;
}
});
}
function createProposal(githubUser, amount, description, url, details) {
return getContributorByGithubUser(githubUser).then((contributor) => {
robot.logger.debug(`[kredits] Creating proposal to issue ${amount}₭S to ${githubUser} for ${url}...`);
let contributionAttr = {
contributorId: contributor.id,
amount: amount,
contributorIpfsHash: contributor.ipfsHash,
url,
description,
details,
kind: 'dev'
};
return Operator.addProposal(contributionAttr).then((result) => {
robot.logger.debug('[kredits] proposal created:', util.inspect(result));
});
}).catch((error) => {
console.log([hubot-kredits] Error:, error);
messageRoom(`I wanted to propose giving kredits to ${githubUser} for ${url}, but I can't find their contact data. Please add them as a contributor: https://kredits.kosmos.org`);
});
}
function amountFromIssueLabels(issue) {
let kreditsLabel = issue.labels.map(l => l.name)
.filter(n => n.match(/^kredits/))[0];
// No label, no kredits
if (typeof kreditsLabel === 'undefined') { return 0; }
// TODO move to config maybe?
let amount;
switch(kreditsLabel) {
case 'kredits-1':
amount = 50;
break;
case 'kredits-2':
amount = 150;
break;
case 'kredits-3':
amount = 500;
break;
}
return amount;
}
function handleGitHubIssueClosed(data) {
let recipients;
let issue = data.issue;
let assignees = issue.assignees.map(a => a.login);
let web_url = issue.html_url;
let amount = amountFromIssueLabels(issue);
if (amount === 0) {
console.log('[hubot-kredits] Proposal amount from issue label is zero; ignoring');
return Promise.resolve();
}
if (assignees.length > 0) {
recipients = assignees;
} else {
recipients = [issue.user.login];
}
let repoName = issue.repository_url.match(/.*\/(.+\/.+)$/)[1];
let description = `${repoName}: ${issue.title}`;
let proposalPromisses = [];
recipients.forEach(recipient => {
proposalPromisses.push(
createProposal(recipient, amount, description, web_url, issue)
.catch(err => robot.logger.error(err))
);
});
return Promise.all(proposalPromisses);
}
function handleGitHubPullRequestClosed(data) {
let recipients;
let pull_request = data.pull_request;
let assignees = pull_request.assignees.map(a => a.login);
let web_url = pull_request._links.html.href;
let pr_issue_url = pull_request.issue_url;
if (assignees.length > 0) {
recipients = assignees;
} else {
recipients = [pull_request.user.login];
}
return fetch(pr_issue_url)
.then(response => {
if (response.status >= 400) {
throw new Error('Bad response from fetching PR issue');
}
return response.json();
})
.then(issue => {
let amount = amountFromIssueLabels(issue);
if (amount === 0) {
console.log('[hubot-kredits] Proposal amount from issue label is zero; ignoring');
return;
}
let repoName = pull_request.base.repo.full_name;
let description = `${repoName}: ${pull_request.title}`;
let proposalPromisses = [];
recipients.forEach(recipient => {
console.debug(`[hubot-kredits] Creating proposal for ${recipient}...`);
proposalPromisses.push(
createProposal(recipient, amount, description, web_url, pull_request)
.catch(err => robot.logger.error(err))
);
});
return Promise.all(proposalPromisses);
});
}
robot.router.post('/incoming/kredits/github/'+process.env.KREDITS_WEBHOOK_TOKEN, (req, res) => {
let evt = req.header('X-GitHub-Event');
let data = req.body;
// For some reason data is contained in a payload property on one
// machine, but directly in the root of the object on others
if (data.payload) { data = JSON.parse(data.payload); }
robot.logger.info(`Received GitHub hook. Event: ${evt}, action: ${data.action}`);
if (evt === 'pull_request' && data.action === 'closed') {
handleGitHubPullRequestClosed(data).then(() => res.send(200));
}
else if (evt === 'issues' && data.action === 'closed') {
handleGitHubIssueClosed(data).then(() => res.send(200));
} else {
res.send(200);
}
});
//
// Smart contract events
//
function watchContractEvents() {
ethProvider.getBlockNumber().then((blockNumber) => {
@@ -267,4 +141,10 @@ module.exports = async function(robot) {
watchContractEvents();
//
// Integrations
//
require('integrations/github')(robot, kredits);
};

153
integrations/github.js Normal file
View File

@@ -0,0 +1,153 @@
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
module.exports = async function(robot, kredits) {
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
function getContributorByGithubUser(username) {
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
return Contributor.all().then(contributors => {
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
let contrib = contributors.find(c => {
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
return c.github_username === username;
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
});
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
if (!contrib) {
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
throw new Error(`No contributor found for ${username}`);A
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
} else {
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
return contrib;
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
}
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
});
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
}
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
function createProposal(githubUser, amount, description, url, details) {
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
return getContributorByGithubUser(githubUser).then((contributor) => {
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
robot.logger.debug(`[kredits] Creating proposal to issue ${amount}₭S to ${githubUser} for ${url}...`);
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
let contributionAttr = {
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
contributorId: contributor.id,
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
amount: amount,
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
contributorIpfsHash: contributor.ipfsHash,
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
url,
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
description,
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
details,
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
kind: 'dev'
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
};
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
return Operator.addProposal(contributionAttr).then((result) => {
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
robot.logger.debug('[kredits] proposal created:', util.inspect(result));
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
});
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
}).catch((error) => {
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
console.log([hubot-kredits] Error:, error);
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
messageRoom(`I wanted to propose giving kredits to ${githubUser} for ${url}, but I can't find their contact data. Please add them as a contributor: https://kredits.kosmos.org`);
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
});
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
}
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
function amountFromIssueLabels(issue) {
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
let kreditsLabel = issue.labels.map(l => l.name)
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
.filter(n => n.match(/^kredits/))[0];
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
// No label, no kredits
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
if (typeof kreditsLabel === 'undefined') { return 0; }
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
// TODO move to config maybe?
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
let amount;
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
switch(kreditsLabel) {
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
case 'kredits-1':
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
amount = 50;
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
break;
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
case 'kredits-2':
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
amount = 150;
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
break;
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
case 'kredits-3':
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
amount = 500;
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
break;
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
}
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
return amount;
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
}
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
function handleGitHubIssueClosed(data) {
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
let recipients;
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
let issue = data.issue;
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
let assignees = issue.assignees.map(a => a.login);
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
let web_url = issue.html_url;
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
let amount = amountFromIssueLabels(issue);
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
if (amount === 0) {
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
console.log('[hubot-kredits] Proposal amount from issue label is zero; ignoring');
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
return Promise.resolve();
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
}
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
if (assignees.length > 0) {
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
recipients = assignees;
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
} else {
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
recipients = [issue.user.login];
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
}
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
let repoName = issue.repository_url.match(/.*\/(.+\/.+)$/)[1];
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
let description = `${repoName}: ${issue.title}`;
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
let proposalPromisses = [];
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
recipients.forEach(recipient => {
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
proposalPromisses.push(
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
createProposal(recipient, amount, description, web_url, issue)
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
.catch(err => robot.logger.error(err))
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
);
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
});
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
return Promise.all(proposalPromisses);
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
}
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
function handleGitHubPullRequestClosed(data) {
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
let recipients;
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
let pull_request = data.pull_request;
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
let assignees = pull_request.assignees.map(a => a.login);
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
let web_url = pull_request._links.html.href;
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
let pr_issue_url = pull_request.issue_url;
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
if (assignees.length > 0) {
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
recipients = assignees;
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
} else {
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
recipients = [pull_request.user.login];
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
}
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
return fetch(pr_issue_url)
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
.then(response => {
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
if (response.status >= 400) {
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
throw new Error('Bad response from fetching PR issue');
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
}
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
return response.json();
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
})
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
.then(issue => {
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
let amount = amountFromIssueLabels(issue);
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
if (amount === 0) {
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
console.log('[hubot-kredits] Proposal amount from issue label is zero; ignoring');
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
return;
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
}
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
let repoName = pull_request.base.repo.full_name;
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
let description = `${repoName}: ${pull_request.title}`;
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
let proposalPromisses = [];
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
recipients.forEach(recipient => {
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
console.debug(`[hubot-kredits] Creating proposal for ${recipient}...`);
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
proposalPromisses.push(
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
createProposal(recipient, amount, description, web_url, pull_request)
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
.catch(err => robot.logger.error(err))
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
);
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
});
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
return Promise.all(proposalPromisses);
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
});
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
}
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
robot.router.post('/incoming/kredits/github/'+process.env.KREDITS_WEBHOOK_TOKEN, (req, res) => {
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
let evt = req.header('X-GitHub-Event');
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
let data = req.body;
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
// For some reason data is contained in a payload property on one
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
// machine, but directly in the root of the object on others
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
if (data.payload) { data = JSON.parse(data.payload); }
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
robot.logger.info(`Received GitHub hook. Event: ${evt}, action: ${data.action}`);
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
if (evt === 'pull_request' && data.action === 'closed') {
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
handleGitHubPullRequestClosed(data).then(() => res.send(200));
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
}
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
else if (evt === 'issues' && data.action === 'closed') {
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
handleGitHubIssueClosed(data).then(() => res.send(200));
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
} else {
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
res.send(200);
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
}
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
});
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.
};
bumi commented 2018-04-19 11:38:20 +00:00 (Migrated from github.com)
Review

do we need a const util = require('util'); in this file?

do we need a `const util = require('util');` in this file?
raucao commented 2018-04-19 11:40:25 +00:00 (Migrated from github.com)
Review

Please ignore the code until I have pushed all of my changes. Thanks.

Please ignore the code until I have pushed all of my changes. Thanks.