Skip to content

Commit 57af266

Browse files
committed
[fix][api][ux] extracted operations and commits out and replaced them with a list of which multipl with possible commits operations can be run in series
1 parent d5bf4ff commit 57af266

File tree

3 files changed

+193
-88
lines changed

3 files changed

+193
-88
lines changed

app.js

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,35 @@ var gitCommitMessage = botOptions.gitCommitMessage = '[fix]
5757
+ '[' + botname + '](https://github.com/blakmatrix/node-migrator-bot)'
5858
].join('\n');
5959

60+
botOptions.changesList = [
61+
{name: "DoStuff1",
62+
message: '[fix] git commit message',
63+
func: function (fileList, settings, cb) {
64+
if (fileList.some(function (ele) {return ele.indexOf('wscript') !== -1}) && fileList.some(function (ele) {return ele.indexOf('package.json') !== -1})) {
65+
setTotalRepositoryMatches(settings.link);
66+
app.log.info('MATCH FOUND!'.green.bold.inverse + ' for ' + settings.link.blue.bold);
67+
return cb(null, 'OK');
68+
} else {
69+
return cb(null, 'DONE');
70+
}
71+
}},
72+
{name: "DoStuff2",
73+
message: '[fix] git commit message',
74+
func: function (fileList, settings, cb) {
75+
app.log.info('Hello world 2');
76+
return cb(null, 'OK');
77+
}},
78+
{name: "DoStuff3",
79+
message: '[fix] git commit message',
80+
func: function (fileList, settings, cb) {
81+
app.log.info('Hello world 3');
82+
return cb(null, 'OK');
83+
}}
84+
];
85+
6086
botOptions.makeFileChanges = function makeFileChanges(fileList, link, cb) {
6187

62-
if (fileList.some(function (ele) {return ele.indexOf('wscript') !== -1}) && fileList.some(function (ele) {return ele.indexOf('package.json') !== -1})) {
63-
setTotalRepositoryMatches(link);
64-
app.log.info('MATCH FOUND!'.green.bold.inverse + ' for ' + link.blue.bold);
65-
return cb(null, 'OK');
66-
} else {
67-
return cb(null, 'DONE');
68-
}
88+
6989

7090
};
7191

@@ -130,9 +150,12 @@ botOptions.dbCheck = function dbCheck(link, cb) {
130150
cb(null, hashk_value);
131151
});
132152
};
133-
botOptions.makePullRequest = false;
134-
botOptions.forkRepo = false;
135-
botOptions.deleteRepo = false;
153+
154+
botOptions.makePullRequest = false;
155+
botOptions.forkRepo = false;
156+
botOptions.deleteRepo = false;
157+
botOptions.addOnFailedCommit = true;
158+
botOptions.addOnSuccessfulPR = true;
136159

137160
botOptions.setTotalNPMPackages = function setTotalNPMPackages(result) {
138161
totalNPMPackages = result.length;

config/config.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"name": "node-migrator-bot",
33
"username":"node-migrator-bot",
4-
"password":"XXXX",
5-
"bot-name": "migrationBot",
4+
"password":"MoarNodePl0x!",
5+
"bot-name": "XXXX",
66
"database": {
77
"port": 9041,
88
"host": "barreleye.redistogo.com",
99
"password": "XXXX",
10-
"npm_hash": "npm_june_2012"
10+
"npm_hash": "npm_july_2012"
1111
}
1212
}

0 commit comments

Comments
 (0)