Skip to content

Commit 4947b31

Browse files
committed
Update scripts for octokit 17
Also put playwright in alphabetical order, npm seems to like that.
1 parent d0c961e commit 4947b31

6 files changed

+12
-11
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
"mocha-fivemat-progress-reporter": "latest",
8888
"ms": "latest",
8989
"node-fetch": "^2.6.0",
90+
"playwright": "latest",
9091
"plugin-error": "latest",
9192
"pretty-hrtime": "^1.0.3",
9293
"prex": "^0.4.3",
@@ -96,7 +97,6 @@
9697
"through2": "latest",
9798
"travis-fold": "latest",
9899
"typescript": "next",
99-
"playwright": "latest",
100100
"vinyl": "latest",
101101
"vinyl-sourcemaps-apply": "latest",
102102
"xml2js": "^0.4.19"

scripts/open-cherry-pick-pr.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ cc ${reviewers.map(r => "@" + r).join(" ")}`,
101101
console.log(`Pull request ${num} created.`);
102102

103103
await gh.issues.createComment({
104-
number: +process.env.SOURCE_ISSUE,
104+
issue_number: +process.env.SOURCE_ISSUE,
105105
owner: "Microsoft",
106106
repo: "TypeScript",
107107
body: `Hey @${process.env.REQUESTING_USER}, I've opened #${num} for you.`
@@ -118,7 +118,7 @@ main().catch(async e => {
118118
token: process.argv[2]
119119
});
120120
await gh.issues.createComment({
121-
number: +process.env.SOURCE_ISSUE,
121+
issue_number: +process.env.SOURCE_ISSUE,
122122
owner: "Microsoft",
123123
repo: "TypeScript",
124124
body: `Hey @${process.env.REQUESTING_USER}, I couldn't open a PR with the cherry-pick. ([You can check the log here](https://typescript.visualstudio.com/TypeScript/_build/index?buildId=${process.env.BUILD_BUILDID}&_a=summary)). You may need to squash and pick this PR into ${process.env.TARGET_BRANCH} manually.`

scripts/open-user-pr.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/// <reference lib="esnext.asynciterable" />
22
/// <reference lib="es2015.promise" />
33
// Must reference esnext.asynciterable lib, since octokit uses AsyncIterable internally
4-
import Octokit = require("@octokit/rest");
4+
import { Octokit } from "@octokit/rest";
55
import {runSequence} from "./run-sequence";
66

77
function padNum(num: number) {
@@ -54,7 +54,7 @@ cc ${reviewers.map(r => "@" + r).join(" ")}`,
5454
}
5555
else {
5656
await gh.issues.createComment({
57-
number: +process.env.SOURCE_ISSUE,
57+
issue_number: +process.env.SOURCE_ISSUE,
5858
owner: "Microsoft",
5959
repo: "TypeScript",
6060
body: `The user suite test run you requested has finished and _failed_. I've opened a [PR with the baseline diff from master](${r.data.html_url}).`

scripts/perf-result-post.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// @ts-check
22
/// <reference lib="esnext.asynciterable" />
33
// Must reference esnext.asynciterable lib, since octokit uses AsyncIterable internally
4-
const Octokit = require("@octokit/rest");
4+
const { Octokit } = require("@octokit/rest");
55
const fs = require("fs");
66

77
const requester = process.env.requesting_user;
@@ -18,7 +18,7 @@ gh.authenticate({
1818
token: process.argv[2]
1919
});
2020
gh.issues.createComment({
21-
number: +source,
21+
issue_number: +source,
2222
owner: "Microsoft",
2323
repo: "TypeScript",
2424
body: `@${requester}

scripts/post-vsts-artifact-comment.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// @ts-check
22
/// <reference lib="esnext.asynciterable" />
33
// Must reference esnext.asynciterable lib, since octokit uses AsyncIterable internally
4-
const Octokit = require("@octokit/rest");
4+
const { Octokit } = require("@octokit/rest");
55
const ado = require("azure-devops-node-api");
66
const { default: fetch } = require("node-fetch");
77

@@ -63,7 +63,7 @@ main().catch(async e => {
6363
token: process.argv[2]
6464
});
6565
await gh.issues.createComment({
66-
number: +process.env.SOURCE_ISSUE,
66+
issue_number: +process.env.SOURCE_ISSUE,
6767
owner: "Microsoft",
6868
repo: "TypeScript",
6969
body: `Hey @${process.env.REQUESTING_USER}, something went wrong when looking for the build artifact. ([You can check the log here](https://typescript.visualstudio.com/TypeScript/_build/index?buildId=${process.env.BUILD_BUILDID}&_a=summary)).`

scripts/update-experimental-branches.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-check
22
/// <reference lib="esnext.asynciterable" />
3-
const Octokit = require("@octokit/rest");
3+
const { Octokit } = require("@octokit/rest");
44
const { runSequence } = require("./run-sequence");
55

66
// The first is used by bot-based kickoffs, the second by automatic triggers
@@ -76,7 +76,8 @@ async function main() {
7676
]);
7777

7878
// Merge each branch into `experimental` (which, if there is a conflict, we now know is from inter-experiment conflict)
79-
for (const branch of prnums) {
79+
for (const branchnum of prnums) {
80+
const branch = "" + branchnum;
8081
// Find the merge base
8182
const mergeBase = runSequence([
8283
["git", ["merge-base", branch, "experimental"]],

0 commit comments

Comments
 (0)