[rrm] stable-prs: update milestone on PRs
Paul O’Shannessy committed
Jul 21, 2016 at 14:58 UTC
114ec049d4887d9e18aeded5ab73eb7092825307
1 file changed
+18
-1
scripts/release-manager/commands/stable-prs.js
+18
-1
@@ -6,6 +6,9 @@ const chalk = require('chalk');
6
// IDEA: maybe just always use this milestone across major releases too?
7
const MILESTONE_NUMBER = 25;
8
9
+// 15.3.0
10
+const TARGET_MILESTONE_NUMBER = 31;
11
+
12
const LABELS = {
13
// Until there is a UI for it, uncomment these lines to run a patch release instead
14
// 'semver-patch': true,
@@ -101,8 +104,20 @@ module.exports = function(vorpal, app) {
104
105
this.log(`Found ${chalk.bold(richPulls.length)} pull requests:`)
106
104
- promptForPRs.call(this, app, richPulls, 0).then(actionCB);
107
+ promptForPRs.call(this, app, richPulls, 0).then(() => {
108
+
109
+ // Update the milestone
110
+ if (!TARGET_MILESTONE_NUMBER) {
111
+ return actionCB();
112
+ }
113
114
+ const milestonePromises = richPulls.map((pr) => {
115
+ return app.ghissues.editIssue(pr.number, {
116
+ milestone: TARGET_MILESTONE_NUMBER
117
+ });
118
+ });
119
+ Promise.all(milestonePromises).then(actionCB);
120
+ });
121
});
122
123
});
@@ -139,6 +154,8 @@ function promptForPRs(app, prs, start) {
154
try {
155
app.gitCherryPickMerge(pr.merge_commit_sha);
156
} catch (e) {
157
+
158
+ // TODO: add ability to mark a PR as skipped
159
failed = true;
160
this.log(`${chalk.bold.red('FAILED!')} Please fix manually and continue when ready.`);
161
promptForPRs.call(this, app, prs, i + 1).then(resolve);