Repository: DefinitelyTyped/dt-mergebot
Pull request #270 (2020-12-11 17:44:15)

Offer to merge infrastructure PRs
Putting this out there for feedback. Revisit #213 and retire the exception for infrastructure PRs. As currently implemented this reverses the change in #50.

elibarzilay: Rebased & squashed & added a tweak to the welcome message.  I want to have a run with this to see how it looks, but I'm getting rate limit errors now, so will retry later.


Patch:
diff --git a/src/compute-pr-actions.ts b/src/compute-pr-actions.ts
index d7b8e09..33d0d77 100644
--- a/src/compute-pr-actions.ts
+++ b/src/compute-pr-actions.ts
@@ -289,12 +289,6 @@ export function process(prInfo: BotNotFail,
     label("Untested Change", info.isUntested);
     if (info.staleness?.state === "nearly" || info.staleness?.state === "done") label(info.staleness.kind);
 
-    if (!info.pkgInfo.some(p => p.name)) {
-        context.targetColumn = "Needs Maintainer Action";
-        context.labels.push("Edits Infrastructure");
-        return context;
-    }
-
     // Update intro comment
     post({ tag: "welcome", status: createWelcomeComment(info, post) });
 
@@ -431,7 +425,7 @@ function createWelcomeComment(info: ExtendedPrInfo, post: (c: Comments.Comment)
                 `This PR touches some part of DefinitelyTyped infrastructure, so ${requiredApprover} will need to review it. This is rare — did you mean to do this?`);
     }
 
-    const announceList = (what: string, xs: readonly string[]) => `${xs.length} ${what}${xs.length > 1 ? "s" : ""}`
+    const announceList = (what: string, xs: readonly string[]) => `${xs.length} ${what}${xs.length !== 1 ? "s" : ""}`
     const usersToString = (users: string[]) => users.map(u => (info.isAuthor(u) ? "✎" : "") + "@" + u).join(", ");
     const reviewLink = (f: FileInfo) =>
         `[\`${f.path.replace(/^types\/(.*\/)/, "$1")}\`](${
@@ -440,10 +434,10 @@ function createWelcomeComment(info: ExtendedPrInfo, post: (c: Comments.Comment)
     display(``,
             `## ${announceList("package", info.packages)} in this PR`,
             ``);
-    if (info.packages.length === 0) { // should not happen atm
-        throw new Error("Internal Error: unexpected Infrastructure-only PR in `createWelcomeComment`");
-    }
     let addedSelfToManyOwners = 0;
+    if (info.pkgInfo.length === 0) {
+        display(`This PR is editing only infrastructure files!`);
+    }
     for (const p of info.pkgInfo) {
         if (p.name === null) continue;
         const kind = p.kind === "add" ? " (*new!*)" : p.kind === "delete" ? " (*probably deleted!*)" : "";


Test patch:
diff --git a/src/_tests/fixtures/44402/mutations.json b/src/_tests/fixtures/44402/mutations.json
index 812fc8f..2a6e7aa 100644
--- a/src/_tests/fixtures/44402/mutations.json
+++ b/src/_tests/fixtures/44402/mutations.json
@@ -4,6 +4,7 @@
     "variables": {
       "input": {
         "labelIds": [
+          "MDU6TGFiZWw2OTcwMTg5NzI=",
           "MDU6TGFiZWwxNjA4MjA4ODM1"
         ],
         "labelableId": "MDExOlB1bGxSZXF1ZXN0NDExODkwMDY5"
@@ -15,15 +16,25 @@
     "variables": {
       "input": {
         "contentId": "MDExOlB1bGxSZXF1ZXN0NDExODkwMDY5",
-        "projectColumnId": "MDEzOlByb2plY3RDb2x1bW45ODY3MDA2"
+        "projectColumnId": "MDEzOlByb2plY3RDb2x1bW43NTUyOTIz"
       }
     }
   },
   {
-    "mutation": "mutation ($input: DeleteIssueCommentInput!) {\n  deleteIssueComment(input: $input) {\n    __typename\n  }\n}\n",
+    "mutation": "mutation ($input: UpdateIssueCommentInput!) {\n  updateIssueComment(input: $input) {\n    __typename\n  }\n}\n",
     "variables": {
       "input": {
-        "id": "MDEyOklzc3VlQ29tbWVudDYyMjE3NTQ3NA=="
+        "id": "MDEyOklzc3VlQ29tbWVudDYyMjE3MDA0NQ==",
+        "body": "@sandersn Thank you for submitting this PR!\n\n***This is a live comment which I will keep updated.***\n\nThis PR touches some part of DefinitelyTyped infrastructure, so a DT maintainer will need to review it. This is rare — did you mean to do this?\n\n## 0 packages in this PR\n\n\n## Code Reviews\n\nThere aren't any other owners of this package, so a DT maintainer will review it.\n\n## Status\n\n * ✅ No merge conflicts\n * ✅ Continuous integration tests have passed\n * ✅ A DT maintainer needs to approve changes which affect DT infrastructure ([`README.cn.md`](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/44402/files/5dfb9945fc5c243f011a9436cbcc12d1ad12b012#diff-97a2a8d47e133a2b24ad7bc1a2e25710f534470e28a73efb62da312a3bb19235), [`README.es.md`](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/44402/files/5dfb9945fc5c243f011a9436cbcc12d1ad12b012#diff-42010a55cd1784b825a37c762cc91d75421f3ed4515f1047cf5506444949a0c2), [`README.ko.md`](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/44402/files/5dfb9945fc5c243f011a9436cbcc12d1ad12b012#diff-86fa6921bcebf260d55d8a3742c1b513bd78f4ea18366db989b5a03c68c563ae), [`README.md`](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/44402/files/5dfb9945fc5c243f011a9436cbcc12d1ad12b012#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5), [`README.ru.md`](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/44402/files/5dfb9945fc5c243f011a9436cbcc12d1ad12b012#diff-fb460bf71153d8224708cfa7298df0409d20c207f5b252b74906895bd8e1ac42))\n\nAll of the items on the list are green. **To merge, you need to post a comment including the string \"Ready to merge\"** to bring in your changes.\n\n----------------------\n... diagnostics scrubbed ...\n<!--typescript_bot_welcome-->"
+      }
+    }
+  },
+  {
+    "mutation": "mutation ($input: UpdateIssueCommentInput!) {\n  updateIssueComment(input: $input) {\n    __typename\n  }\n}\n",
+    "variables": {
+      "input": {
+        "id": "MDEyOklzc3VlQ29tbWVudDYyMjE3NTQ3NA==",
+        "body": "@sandersn Everything looks good here. Great job! I am ready to merge this PR (at 5dfb994) on your behalf.\n\nIf you'd like that to happen, please post a comment saying:\n\n> Ready to merge\n\nand I'll merge this PR almost instantly. Thanks for helping out! :heart:\n\n<!--typescript_bot_merge-offer-->"
       }
     }
   }
diff --git a/src/_tests/fixtures/44402/result.json b/src/_tests/fixtures/44402/result.json
index 5dafe61..fb8b49e 100644
--- a/src/_tests/fixtures/44402/result.json
+++ b/src/_tests/fixtures/44402/result.json
@@ -1,13 +1,22 @@
 {
   "pr_number": 44402,
-  "targetColumn": "Needs Maintainer Action",
+  "targetColumn": "Waiting for Author to Merge",
   "labels": [
     "Other Approved",
     "Maintainer Approved",
     "Edits Infrastructure",
-    "Edits Infrastructure"
+    "Self Merge"
+  ],
+  "responseComments": [
+    {
+      "tag": "welcome",
+      "status": "@sandersn Thank you for submitting this PR!\n\n***This is a live comment which I will keep updated.***\n\nThis PR touches some part of DefinitelyTyped infrastructure, so a DT maintainer will need to review it. This is rare — did you mean to do this?\n\n## 0 packages in this PR\n\n\n## Code Reviews\n\nThere aren't any other owners of this package, so a DT maintainer will review it.\n\n## Status\n\n * ✅ No merge conflicts\n * ✅ Continuous integration tests have passed\n * ✅ A DT maintainer needs to approve changes which affect DT infrastructure ([`README.cn.md`](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/44402/files/5dfb9945fc5c243f011a9436cbcc12d1ad12b012#diff-97a2a8d47e133a2b24ad7bc1a2e25710f534470e28a73efb62da312a3bb19235), [`README.es.md`](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/44402/files/5dfb9945fc5c243f011a9436cbcc12d1ad12b012#diff-42010a55cd1784b825a37c762cc91d75421f3ed4515f1047cf5506444949a0c2), [`README.ko.md`](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/44402/files/5dfb9945fc5c243f011a9436cbcc12d1ad12b012#diff-86fa6921bcebf260d55d8a3742c1b513bd78f4ea18366db989b5a03c68c563ae), [`README.md`](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/44402/files/5dfb9945fc5c243f011a9436cbcc12d1ad12b012#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5), [`README.ru.md`](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/44402/files/5dfb9945fc5c243f011a9436cbcc12d1ad12b012#diff-fb460bf71153d8224708cfa7298df0409d20c207f5b252b74906895bd8e1ac42))\n\nAll of the items on the list are green. **To merge, you need to post a comment including the string \"Ready to merge\"** to bring in your changes.\n\n----------------------\n... diagnostics scrubbed ..."
+    },
+    {
+      "tag": "merge-offer",
+      "status": "@sandersn Everything looks good here. Great job! I am ready to merge this PR (at 5dfb994) on your behalf.\n\nIf you'd like that to happen, please post a comment saying:\n\n> Ready to merge\n\nand I'll merge this PR almost instantly. Thanks for helping out! :heart:\n"
+    }
   ],
-  "responseComments": [],
   "shouldClose": false,
   "shouldMerge": false,
   "shouldUpdateLabels": true,
diff --git a/src/_tests/fixtures/49575/_downloads.json b/src/_tests/fixtures/49575/_downloads.json
new file mode 100644
index 0000000..0967ef4
--- /dev/null
+++ b/src/_tests/fixtures/49575/_downloads.json
@@ -0,0 +1,1 @@
+{}
diff --git a/src/_tests/fixtures/49575/_files.json b/src/_tests/fixtures/49575/_files.json
new file mode 100644
index 0000000..0967ef4
--- /dev/null
+++ b/src/_tests/fixtures/49575/_files.json
@@ -0,0 +1,1 @@
+{}
diff --git a/src/_tests/fixtures/49575/_response.json b/src/_tests/fixtures/49575/_response.json
new file mode 100644
index 0000000..04ad701
--- /dev/null
+++ b/src/_tests/fixtures/49575/_response.json
@@ -0,0 +1,749 @@
+{
+  "data": {
+    "repository": {
+      "pullRequest": {
+        "id": "MDExOlB1bGxSZXF1ZXN0NTIxMTM3NjEy",
+        "title": "Move tslint.json advice from PULL_REQUEST_TEMPLATE.md",
+        "createdAt": "2020-11-15T03:25:30Z",
+        "author": {
+          "login": "jablko",
+          "__typename": "User"
+        },
+        "authorAssociation": "CONTRIBUTOR",
+        "baseRef": {
+          "name": "master",
+          "__typename": "Ref"
+        },
+        "labels": {
+          "nodes": [
+            {
+              "name": "Edits Infrastructure",
+              "__typename": "Label"
+            },
+            {
+              "name": "Maintainer Approved",
+              "__typename": "Label"
+            }
+          ],
+          "__typename": "LabelConnection"
+        },
+        "isDraft": false,
+        "mergeable": "MERGEABLE",
+        "number": 49575,
+        "state": "OPEN",
+        "headRefOid": "cdd66f483bb0103f6e6d1eb7b07192ff95718f25",
+        "timelineItems": {
+          "nodes": [
+            {
+              "__typename": "IssueComment",
+              "author": {
+                "login": "sheetalkamat",
+                "__typename": "User"
+              },
+              "createdAt": "2020-11-23T20:49:44Z"
+            },
+            {
+              "__typename": "IssueComment",
+              "author": {
+                "login": "rbuckton",
+                "__typename": "User"
+              },
+              "createdAt": "2020-12-11T00:00:50Z"
+            },
+            {
+              "__typename": "IssueComment",
+              "author": {
+                "login": "elibarzilay",
+                "__typename": "User"
+              },
+              "createdAt": "2020-12-11T16:34:06Z"
+            }
+          ],
+          "__typename": "PullRequestTimelineItemsConnection"
+        },
+        "reviews": {
+          "nodes": [
+            {
+              "author": {
+                "login": "elibarzilay",
+                "__typename": "User"
+              },
+              "commit": {
+                "oid": "6400f4c47e063373c0d9e3d5978b4b24ec14048c",
+                "abbreviatedOid": "6400f4c",
+                "__typename": "Commit"
+              },
+              "comments": {
+                "nodes": [
+                  {
+                    "author": {
+                      "login": "elibarzilay",
+                      "__typename": "User"
+                    },
+                    "createdAt": "2020-11-15T06:56:24Z",
+                    "__typename": "PullRequestReviewComment"
+                  },
+                  {
+                    "author": {
+                      "login": "elibarzilay",
+                      "__typename": "User"
+                    },
+                    "createdAt": "2020-11-15T06:59:02Z",
+                    "__typename": "PullRequestReviewComment"
+                  },
+                  {
+                    "author": {
+                      "login": "elibarzilay",
+                      "__typename": "User"
+                    },
+                    "createdAt": "2020-11-15T07:00:31Z",
+                    "__typename": "PullRequestReviewComment"
+                  }
+                ],
+                "__typename": "PullRequestReviewCommentConnection"
+              },
+              "authorAssociation": "CONTRIBUTOR",
+              "state": "CHANGES_REQUESTED",
+              "submittedAt": "2020-11-15T07:00:39Z",
+              "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/pull/49575#pullrequestreview-530771686",
+              "__typename": "PullRequestReview"
+            },
+            {
+              "author": {
+                "login": "sandersn",
+                "__typename": "User"
+              },
+              "commit": {
+                "oid": "6400f4c47e063373c0d9e3d5978b4b24ec14048c",
+                "abbreviatedOid": "6400f4c",
+                "__typename": "Commit"
+              },
+              "comments": {
+                "nodes": [],
+                "__typename": "PullRequestReviewCommentConnection"
+              },
+              "authorAssociation": "CONTRIBUTOR",
+              "state": "APPROVED",
+              "submittedAt": "2020-11-16T16:27:02Z",
+              "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/pull/49575#pullrequestreview-531487745",
+              "__typename": "PullRequestReview"
+            },
+            {
+              "author": {
+                "login": "jablko",
+                "__typename": "User"
+              },
+              "commit": {
+                "oid": "f55f95bcf01674dc20e2f3cf0f9dbce4710f582d",
+                "abbreviatedOid": "f55f95b",
+                "__typename": "Commit"
+              },
+              "comments": {
+                "nodes": [
+                  {
+                    "author": {
+                      "login": "jablko",
+                      "__typename": "User"
+                    },
+                    "createdAt": "2020-11-16T17:12:36Z",
+                    "__typename": "PullRequestReviewComment"
+                  }
+                ],
+                "__typename": "PullRequestReviewCommentConnection"
+              },
+              "authorAssociation": "CONTRIBUTOR",
+              "state": "COMMENTED",
+              "submittedAt": "2020-11-16T17:12:36Z",
+              "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/pull/49575#pullrequestreview-531532162",
+              "__typename": "PullRequestReview"
+            },
+            {
+              "author": {
+                "login": "jablko",
+                "__typename": "User"
+              },
+              "commit": {
+                "oid": "f55f95bcf01674dc20e2f3cf0f9dbce4710f582d",
+                "abbreviatedOid": "f55f95b",
+                "__typename": "Commit"
+              },
+              "comments": {
+                "nodes": [
+                  {
+                    "author": {
+                      "login": "jablko",
+                      "__typename": "User"
+                    },
+                    "createdAt": "2020-11-16T17:13:59Z",
+                    "__typename": "PullRequestReviewComment"
+                  }
+                ],
+                "__typename": "PullRequestReviewCommentConnection"
+              },
+              "authorAssociation": "CONTRIBUTOR",
+              "state": "COMMENTED",
+              "submittedAt": "2020-11-16T17:13:59Z",
+              "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/pull/49575#pullrequestreview-531533372",
+              "__typename": "PullRequestReview"
+            },
+            {
+              "author": {
+                "login": "jablko",
+                "__typename": "User"
+              },
+              "commit": {
+                "oid": "f55f95bcf01674dc20e2f3cf0f9dbce4710f582d",
+                "abbreviatedOid": "f55f95b",
+                "__typename": "Commit"
+              },
+              "comments": {
+                "nodes": [
+                  {
+                    "author": {
+                      "login": "jablko",
+                      "__typename": "User"
+                    },
+                    "createdAt": "2020-11-16T17:14:09Z",
+                    "__typename": "PullRequestReviewComment"
+                  }
+                ],
+                "__typename": "PullRequestReviewCommentConnection"
+              },
+              "authorAssociation": "CONTRIBUTOR",
+              "state": "COMMENTED",
+              "submittedAt": "2020-11-16T17:14:09Z",
+              "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/pull/49575#pullrequestreview-531533505",
+              "__typename": "PullRequestReview"
+            },
+            {
+              "author": {
+                "login": "elibarzilay",
+                "__typename": "User"
+              },
+              "commit": {
+                "oid": "84495e87102cbe52430828596821ec7647742f65",
+                "abbreviatedOid": "84495e8",
+                "__typename": "Commit"
+              },
+              "comments": {
+                "nodes": [
+                  {
+                    "author": {
+                      "login": "elibarzilay",
+                      "__typename": "User"
+                    },
+                    "createdAt": "2020-11-17T08:56:50Z",
+                    "__typename": "PullRequestReviewComment"
+                  },
+                  {
+                    "author": {
+                      "login": "elibarzilay",
+                      "__typename": "User"
+                    },
+                    "createdAt": "2020-11-17T09:01:35Z",
+                    "__typename": "PullRequestReviewComment"
+                  },
+                  {
+                    "author": {
+                      "login": "elibarzilay",
+                      "__typename": "User"
+                    },
+                    "createdAt": "2020-11-17T09:03:29Z",
+                    "__typename": "PullRequestReviewComment"
+                  },
+                  {
+                    "author": {
+                      "login": "elibarzilay",
+                      "__typename": "User"
+                    },
+                    "createdAt": "2020-11-17T09:06:12Z",
+                    "__typename": "PullRequestReviewComment"
+                  },
+                  {
+                    "author": {
+                      "login": "elibarzilay",
+                      "__typename": "User"
+                    },
+                    "createdAt": "2020-11-17T09:13:27Z",
+                    "__typename": "PullRequestReviewComment"
+                  },
+                  {
+                    "author": {
+                      "login": "elibarzilay",
+                      "__typename": "User"
+                    },
+                    "createdAt": "2020-11-17T09:17:36Z",
+                    "__typename": "PullRequestReviewComment"
+                  }
+                ],
+                "__typename": "PullRequestReviewCommentConnection"
+              },
+              "authorAssociation": "CONTRIBUTOR",
+              "state": "CHANGES_REQUESTED",
+              "submittedAt": "2020-11-17T09:18:17Z",
+              "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/pull/49575#pullrequestreview-532144684",
+              "__typename": "PullRequestReview"
+            },
+            {
+              "author": {
+                "login": "jablko",
+                "__typename": "User"
+              },
+              "commit": {
+                "oid": "cd5cc0c6e9f922a5686adfdd2b1dfa4fa0c4ce92",
+                "abbreviatedOid": "cd5cc0c",
+                "__typename": "Commit"
+              },
+              "comments": {
+                "nodes": [
+                  {
+                    "author": {
+                      "login": "jablko",
+                      "__typename": "User"
+                    },
+                    "createdAt": "2020-11-17T20:44:58Z",
+                    "__typename": "PullRequestReviewComment"
+                  }
+                ],
+                "__typename": "PullRequestReviewCommentConnection"
+              },
+              "authorAssociation": "CONTRIBUTOR",
+              "state": "COMMENTED",
+              "submittedAt": "2020-11-17T20:44:58Z",
+              "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/pull/49575#pullrequestreview-532797068",
+              "__typename": "PullRequestReview"
+            },
+            {
+              "author": {
+                "login": "jablko",
+                "__typename": "User"
+              },
+              "commit": {
+                "oid": "cd5cc0c6e9f922a5686adfdd2b1dfa4fa0c4ce92",
+                "abbreviatedOid": "cd5cc0c",
+                "__typename": "Commit"
+              },
+              "comments": {
+                "nodes": [
+                  {
+                    "author": {
+                      "login": "jablko",
+                      "__typename": "User"
+                    },
+                    "createdAt": "2020-11-17T20:45:18Z",
+                    "__typename": "PullRequestReviewComment"
+                  }
+                ],
+                "__typename": "PullRequestReviewCommentConnection"
+              },
+              "authorAssociation": "CONTRIBUTOR",
+              "state": "COMMENTED",
+              "submittedAt": "2020-11-17T20:45:18Z",
+              "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/pull/49575#pullrequestreview-532797285",
+              "__typename": "PullRequestReview"
+            },
+            {
+              "author": {
+                "login": "jablko",
+                "__typename": "User"
+              },
+              "commit": {
+                "oid": "cd5cc0c6e9f922a5686adfdd2b1dfa4fa0c4ce92",
+                "abbreviatedOid": "cd5cc0c",
+                "__typename": "Commit"
+              },
+              "comments": {
+                "nodes": [
+                  {
+                    "author": {
+                      "login": "jablko",
+                      "__typename": "User"
+                    },
+                    "createdAt": "2020-11-17T20:45:35Z",
+                    "__typename": "PullRequestReviewComment"
+                  }
+                ],
+                "__typename": "PullRequestReviewCommentConnection"
+              },
+              "authorAssociation": "CONTRIBUTOR",
+              "state": "COMMENTED",
+              "submittedAt": "2020-11-17T20:45:35Z",
+              "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/pull/49575#pullrequestreview-532797467",
+              "__typename": "PullRequestReview"
+            },
+            {
+              "author": {
+                "login": "jablko",
+                "__typename": "User"
+              },
+              "commit": {
+                "oid": "cd5cc0c6e9f922a5686adfdd2b1dfa4fa0c4ce92",
+                "abbreviatedOid": "cd5cc0c",
+                "__typename": "Commit"
+              },
+              "comments": {
+                "nodes": [
+                  {
+                    "author": {
+                      "login": "jablko",
+                      "__typename": "User"
+                    },
+                    "createdAt": "2020-11-17T20:46:27Z",
+                    "__typename": "PullRequestReviewComment"
+                  }
+                ],
+                "__typename": "PullRequestReviewCommentConnection"
+              },
+              "authorAssociation": "CONTRIBUTOR",
+              "state": "COMMENTED",
+              "submittedAt": "2020-11-17T20:46:27Z",
+              "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/pull/49575#pullrequestreview-532798093",
+              "__typename": "PullRequestReview"
+            },
+            {
+              "author": {
+                "login": "amcasey",
+                "__typename": "User"
+              },
+              "commit": {
+                "oid": "08733870ea4eb468ed857e8946383f2cc14f881d",
+                "abbreviatedOid": "0873387",
+                "__typename": "Commit"
+              },
+              "comments": {
+                "nodes": [
+                  {
+                    "author": {
+                      "login": "amcasey",
+                      "__typename": "User"
+                    },
+                    "createdAt": "2020-11-30T18:46:26Z",
+                    "__typename": "PullRequestReviewComment"
+                  },
+                  {
+                    "author": {
+                      "login": "amcasey",
+                      "__typename": "User"
+                    },
+                    "createdAt": "2020-11-30T18:47:08Z",
+                    "__typename": "PullRequestReviewComment"
+                  }
+                ],
+                "__typename": "PullRequestReviewCommentConnection"
+              },
+              "authorAssociation": "CONTRIBUTOR",
+              "state": "COMMENTED",
+              "submittedAt": "2020-11-30T18:49:05Z",
+              "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/pull/49575#pullrequestreview-541193432",
+              "__typename": "PullRequestReview"
+            },
+            {
+              "author": {
+                "login": "jablko",
+                "__typename": "User"
+              },
+              "commit": {
+                "oid": "90ff51a18d0788afe4a5264435a52da028dd5252",
+                "abbreviatedOid": "90ff51a",
+                "__typename": "Commit"
+              },
+              "comments": {
+                "nodes": [
+                  {
+                    "author": {
+                      "login": "jablko",
+                      "__typename": "User"
+                    },
+                    "createdAt": "2020-11-30T22:11:21Z",
+                    "__typename": "PullRequestReviewComment"
+                  }
+                ],
+                "__typename": "PullRequestReviewCommentConnection"
+              },
+              "authorAssociation": "CONTRIBUTOR",
+              "state": "COMMENTED",
+              "submittedAt": "2020-11-30T22:11:22Z",
+              "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/pull/49575#pullrequestreview-541336430",
+              "__typename": "PullRequestReview"
+            },
+            {
+              "author": {
+                "login": "amcasey",
+                "__typename": "User"
+              },
+              "commit": {
+                "oid": "90ff51a18d0788afe4a5264435a52da028dd5252",
+                "abbreviatedOid": "90ff51a",
+                "__typename": "Commit"
+              },
+              "comments": {
+                "nodes": [],
+                "__typename": "PullRequestReviewCommentConnection"
+              },
+              "authorAssociation": "CONTRIBUTOR",
+              "state": "APPROVED",
+              "submittedAt": "2020-12-01T00:15:16Z",
+              "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/pull/49575#pullrequestreview-541395420",
+              "__typename": "PullRequestReview"
+            },
+            {
+              "author": {
+                "login": "elibarzilay",
+                "__typename": "User"
+              },
+              "commit": {
+                "oid": "90ff51a18d0788afe4a5264435a52da028dd5252",
+                "abbreviatedOid": "90ff51a",
+                "__typename": "Commit"
+              },
+              "comments": {
+                "nodes": [],
+                "__typename": "PullRequestReviewCommentConnection"
+              },
+              "authorAssociation": "CONTRIBUTOR",
+              "state": "APPROVED",
+              "submittedAt": "2020-12-03T12:09:12Z",
+              "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/pull/49575#pullrequestreview-543889072",
+              "__typename": "PullRequestReview"
+            },
+            {
+              "author": {
+                "login": "amcasey",
+                "__typename": "User"
+              },
+              "commit": {
+                "oid": "cdd66f483bb0103f6e6d1eb7b07192ff95718f25",
+                "abbreviatedOid": "cdd66f4",
+                "__typename": "Commit"
+              },
+              "comments": {
+                "nodes": [],
+                "__typename": "PullRequestReviewCommentConnection"
+              },
+              "authorAssociation": "CONTRIBUTOR",
+              "state": "APPROVED",
+              "submittedAt": "2020-12-08T17:01:18Z",
+              "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/pull/49575#pullrequestreview-547437938",
+              "__typename": "PullRequestReview"
+            }
+          ],
+          "__typename": "PullRequestReviewConnection"
+        },
+        "commits": {
+          "totalCount": 4,
+          "nodes": [
+            {
+              "commit": {
+                "checkSuites": {
+                  "nodes": [],
+                  "__typename": "CheckSuiteConnection"
+                },
+                "status": null,
+                "authoredDate": "2020-11-14T22:55:19Z",
+                "committedDate": "2020-12-03T17:48:26Z",
+                "pushedDate": null,
+                "abbreviatedOid": "5c2ccb5",
+                "oid": "5c2ccb517816caf8389bedf4c121eb6397a7f45f",
+                "__typename": "Commit"
+              },
+              "__typename": "PullRequestCommit"
+            },
+            {
+              "commit": {
+                "checkSuites": {
+                  "nodes": [],
+                  "__typename": "CheckSuiteConnection"
+                },
+                "status": null,
+                "authoredDate": "2020-11-16T16:32:00Z",
+                "committedDate": "2020-12-03T17:59:48Z",
+                "pushedDate": null,
+                "abbreviatedOid": "31f180a",
+                "oid": "31f180ab9d1bb3968e51ba3cbe361b4124173eb3",
+                "__typename": "Commit"
+              },
+              "__typename": "PullRequestCommit"
+            },
+            {
+              "commit": {
+                "checkSuites": {
+                  "nodes": [],
+                  "__typename": "CheckSuiteConnection"
+                },
+                "status": null,
+                "authoredDate": "2020-11-17T15:38:29Z",
+                "committedDate": "2020-12-03T18:30:33Z",
+                "pushedDate": null,
+                "abbreviatedOid": "9f77330",
+                "oid": "9f773300c4ec49329a8c4ae9bd8b0487a946de30",
+                "__typename": "Commit"
+              },
+              "__typename": "PullRequestCommit"
+            },
+            {
+              "commit": {
+                "checkSuites": {
+                  "nodes": [
+                    {
+                      "app": {
+                        "name": "GitHub Actions",
+                        "__typename": "App"
+                      },
+                      "conclusion": "SUCCESS",
+                      "resourcePath": "/DefinitelyTyped/DefinitelyTyped/commit/cdd66f483bb0103f6e6d1eb7b07192ff95718f25/checks?check_suite_id=1604607531",
+                      "status": "COMPLETED",
+                      "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/commit/cdd66f483bb0103f6e6d1eb7b07192ff95718f25/checks?check_suite_id=1604607531",
+                      "__typename": "CheckSuite"
+                    },
+                    {
+                      "app": {
+                        "name": "Azure Pipelines",
+                        "__typename": "App"
+                      },
+                      "conclusion": "SUCCESS",
+                      "resourcePath": "/DefinitelyTyped/DefinitelyTyped/commit/cdd66f483bb0103f6e6d1eb7b07192ff95718f25/checks?check_suite_id=1604608237",
+                      "status": "COMPLETED",
+                      "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/commit/cdd66f483bb0103f6e6d1eb7b07192ff95718f25/checks?check_suite_id=1604608237",
+                      "__typename": "CheckSuite"
+                    }
+                  ],
+                  "__typename": "CheckSuiteConnection"
+                },
+                "status": null,
+                "authoredDate": "2020-11-30T22:05:19Z",
+                "committedDate": "2020-12-03T18:30:37Z",
+                "pushedDate": "2020-12-03T18:35:07Z",
+                "abbreviatedOid": "cdd66f4",
+                "oid": "cdd66f483bb0103f6e6d1eb7b07192ff95718f25",
+                "__typename": "Commit"
+              },
+              "__typename": "PullRequestCommit"
+            }
+          ],
+          "__typename": "PullRequestCommitConnection"
+        },
+        "comments": {
+          "totalCount": 3,
+          "nodes": [
+            {
+              "id": "MDEyOklzc3VlQ29tbWVudDczMjQxODI2Mw==",
+              "author": {
+                "login": "sheetalkamat",
+                "__typename": "User"
+              },
+              "body": "@elibarzilay do you want to take a look again before i merge this.",
+              "createdAt": "2020-11-23T20:49:44Z",
+              "reactions": {
+                "nodes": [],
+                "__typename": "ReactionConnection"
+              },
+              "__typename": "IssueComment"
+            },
+            {
+              "id": "MDEyOklzc3VlQ29tbWVudDc0Mjg3Njg3Mw==",
+              "author": {
+                "login": "rbuckton",
+                "__typename": "User"
+              },
+              "body": "The bot didn't comment about being able to self merge. Will that still work or do we have to merge this manually?",
+              "createdAt": "2020-12-11T00:00:50Z",
+              "reactions": {
+                "nodes": [],
+                "__typename": "ReactionConnection"
+              },
+              "__typename": "IssueComment"
+            },
+            {
+              "id": "MDEyOklzc3VlQ29tbWVudDc0MzI5NTk0MA==",
+              "author": {
+                "login": "elibarzilay",
+                "__typename": "User"
+              },
+              "body": "@rbuckton, yeah needs to be merged manually like all PRs in NMA...  (And a just-merged PR from @jablko removes the label in this case, with another one that hopefully I'll get to soon-ish enabling more self-merges.)\r\n",
+              "createdAt": "2020-12-11T16:34:06Z",
+              "reactions": {
+                "nodes": [],
+                "__typename": "ReactionConnection"
+              },
+              "__typename": "IssueComment"
+            }
+          ],
+          "__typename": "IssueCommentConnection"
+        },
+        "files": {
+          "totalCount": 7,
+          "nodes": [
+            {
+              "path": ".github/PULL_REQUEST_TEMPLATE.md",
+              "additions": 1,
+              "deletions": 2,
+              "__typename": "PullRequestChangedFile"
+            },
+            {
+              "path": "README.cn.md",
+              "additions": 29,
+              "deletions": 45,
+              "__typename": "PullRequestChangedFile"
+            },
+            {
+              "path": "README.es.md",
+              "additions": 26,
+              "deletions": 39,
+              "__typename": "PullRequestChangedFile"
+            },
+            {
+              "path": "README.ko.md",
+              "additions": 26,
+              "deletions": 39,
+              "__typename": "PullRequestChangedFile"
+            },
+            {
+              "path": "README.md",
+              "additions": 30,
+              "deletions": 48,
+              "__typename": "PullRequestChangedFile"
+            },
+            {
+              "path": "README.pt.md",
+              "additions": 30,
+              "deletions": 49,
+              "__typename": "PullRequestChangedFile"
+            },
+            {
+              "path": "README.ru.md",
+              "additions": 26,
+              "deletions": 44,
+              "__typename": "PullRequestChangedFile"
+            }
+          ],
+          "__typename": "PullRequestChangedFileConnection"
+        },
+        "projectCards": {
+          "nodes": [
+            {
+              "id": "MDExOlByb2plY3RDYXJkNDkzNjY1NzY=",
+              "project": {
+                "id": "MDc6UHJvamVjdDM3NDExMDQ=",
+                "number": 5,
+                "name": "New Pull Request Status Board",
+                "__typename": "Project"
+              },
+              "column": {
+                "id": "MDEzOlByb2plY3RDb2x1bW45ODY3MDA2",
+                "name": "Needs Maintainer Action",
+                "__typename": "ProjectColumn"
+              },
+              "__typename": "ProjectCard"
+            }
+          ],
+          "__typename": "ProjectCardConnection"
+        },
+        "__typename": "PullRequest"
+      },
+      "__typename": "Repository"
+    }
+  },
+  "loading": false,
+  "networkStatus": 7,
+  "stale": false
+}
diff --git a/src/_tests/fixtures/49575/derived.json b/src/_tests/fixtures/49575/derived.json
new file mode 100644
index 0000000..cdb6ff5
--- /dev/null
+++ b/src/_tests/fixtures/49575/derived.json
@@ -0,0 +1,74 @@
+{
+  "type": "info",
+  "now": "2020-12-11T17:35:36.572Z",
+  "pr_number": 49575,
+  "author": "jablko",
+  "headCommitOid": "cdd66f483bb0103f6e6d1eb7b07192ff95718f25",
+  "lastPushDate": "2020-12-03T18:35:07.000Z",
+  "lastActivityDate": "2020-12-11T16:34:06.000Z",
+  "maintainerBlessed": false,
+  "hasMergeConflict": false,
+  "isFirstContribution": false,
+  "popularityLevel": "Well-liked by everyone",
+  "pkgInfo": [
+    {
+      "name": null,
+      "kind": "edit",
+      "files": [
+        {
+          "path": ".github/PULL_REQUEST_TEMPLATE.md",
+          "kind": "infrastructure"
+        },
+        {
+          "path": "README.cn.md",
+          "kind": "infrastructure"
+        },
+        {
+          "path": "README.es.md",
+          "kind": "infrastructure"
+        },
+        {
+          "path": "README.ko.md",
+          "kind": "infrastructure"
+        },
+        {
+          "path": "README.md",
+          "kind": "infrastructure"
+        },
+        {
+          "path": "README.pt.md",
+          "kind": "infrastructure"
+        },
+        {
+          "path": "README.ru.md",
+          "kind": "infrastructure"
+        }
+      ],
+      "owners": [],
+      "addedOwners": [],
+      "deletedOwners": [],
+      "popularityLevel": "Critical"
+    }
+  ],
+  "reviews": [
+    {
+      "type": "approved",
+      "reviewer": "amcasey",
+      "date": "2020-12-08T17:01:18.000Z",
+      "isMaintainer": false
+    },
+    {
+      "type": "stale",
+      "reviewer": "elibarzilay",
+      "date": "2020-12-03T12:09:12.000Z",
+      "abbrOid": "90ff51a"
+    },
+    {
+      "type": "stale",
+      "reviewer": "sandersn",
+      "date": "2020-11-16T16:27:02.000Z",
+      "abbrOid": "6400f4c"
+    }
+  ],
+  "ciResult": "pass"
+}
diff --git a/src/_tests/fixtures/49575/mutations.json b/src/_tests/fixtures/49575/mutations.json
new file mode 100644
index 0000000..01b2cd3
--- /dev/null
+++ b/src/_tests/fixtures/49575/mutations.json
@@ -0,0 +1,51 @@
+[
+  {
+    "mutation": "mutation ($input: AddLabelsToLabelableInput!) {\n  addLabelsToLabelable(input: $input) {\n    __typename\n  }\n}\n",
+    "variables": {
+      "input": {
+        "labelIds": [
+          "MDU6TGFiZWw1ODYxNzcwNjM="
+        ],
+        "labelableId": "MDExOlB1bGxSZXF1ZXN0NTIxMTM3NjEy"
+      }
+    }
+  },
+  {
+    "mutation": "mutation ($input: RemoveLabelsFromLabelableInput!) {\n  removeLabelsFromLabelable(input: $input) {\n    __typename\n  }\n}\n",
+    "variables": {
+      "input": {
+        "labelIds": [
+          "MDU6TGFiZWwxNjA4NTUyNDEw"
+        ],
+        "labelableId": "MDExOlB1bGxSZXF1ZXN0NTIxMTM3NjEy"
+      }
+    }
+  },
+  {
+    "mutation": "mutation ($input: AddCommentInput!) {\n  addComment(input: $input) {\n    __typename\n  }\n}\n",
+    "variables": {
+      "input": {
+        "subjectId": "MDExOlB1bGxSZXF1ZXN0NTIxMTM3NjEy",
+        "body": "@jablko Thank you for submitting this PR!\n\n***This is a live comment which I will keep updated.***\n\nThis PR touches some part of DefinitelyTyped infrastructure, so a DT maintainer will need to review it. This is rare — did you mean to do this?\n\n## 0 packages in this PR\n\n\n## Code Reviews\n\nThere aren't any other owners of this package, so a DT maintainer will review it.\n\n## Status\n\n * ✅ No merge conflicts\n * ✅ Continuous integration tests have passed\n * ❌ A DT maintainer needs to approve changes which affect DT infrastructure ([`.github/PULL_REQUEST_TEMPLATE.md`](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/49575/files/cdd66f483bb0103f6e6d1eb7b07192ff95718f25#diff-18813c86948efc57e661623d7ba48ff94325c9b5421ec9177f724922dd553a35), [`README.cn.md`](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/49575/files/cdd66f483bb0103f6e6d1eb7b07192ff95718f25#diff-97a2a8d47e133a2b24ad7bc1a2e25710f534470e28a73efb62da312a3bb19235), [`README.es.md`](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/49575/files/cdd66f483bb0103f6e6d1eb7b07192ff95718f25#diff-42010a55cd1784b825a37c762cc91d75421f3ed4515f1047cf5506444949a0c2), [`README.ko.md`](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/49575/files/cdd66f483bb0103f6e6d1eb7b07192ff95718f25#diff-86fa6921bcebf260d55d8a3742c1b513bd78f4ea18366db989b5a03c68c563ae), [`README.md`](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/49575/files/cdd66f483bb0103f6e6d1eb7b07192ff95718f25#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5), [`README.pt.md`](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/49575/files/cdd66f483bb0103f6e6d1eb7b07192ff95718f25#diff-822bdbb1cbe31bcc1afd1ddbbd7b3191052e07c9996334e645a22694e3cc2119), [`README.ru.md`](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/49575/files/cdd66f483bb0103f6e6d1eb7b07192ff95718f25#diff-fb460bf71153d8224708cfa7298df0409d20c207f5b252b74906895bd8e1ac42))\n\nOnce every item on this list is checked, I'll ask you for permission to merge and publish the changes.\n\n## Inactive\n\nThis PR has been inactive for 7 days.\n\n----------------------\n... diagnostics scrubbed ...\n<!--typescript_bot_welcome-->"
+      }
+    }
+  },
+  {
+    "mutation": "mutation ($input: AddCommentInput!) {\n  addComment(input: $input) {\n    __typename\n  }\n}\n",
+    "variables": {
+      "input": {
+        "subjectId": "MDExOlB1bGxSZXF1ZXN0NTIxMTM3NjEy",
+        "body": "🔔 @jablko — you're the only owner, but it would still be good if you find someone to [review this PR](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/49575/files) in the next few days, otherwise a maintainer will look at it. (And if you do find someone, maybe even recruit them to be a second owner to make future changes easier...)\n<!--typescript_bot_pinging-reviewers-others-->"
+      }
+    }
+  },
+  {
+    "mutation": "mutation ($input: AddCommentInput!) {\n  addComment(input: $input) {\n    __typename\n  }\n}\n",
+    "variables": {
+      "input": {
+        "subjectId": "MDExOlB1bGxSZXF1ZXN0NTIxMTM3NjEy",
+        "body": "@elibarzilay, @sandersn Thank you for reviewing this PR! The author has pushed new commits since your last review. Could you take another look and submit a fresh review?\n<!--typescript_bot_stale-ping-d2e897-6400f4c-->"
+      }
+    }
+  }
+]
diff --git a/src/_tests/fixtures/49575/result.json b/src/_tests/fixtures/49575/result.json
new file mode 100644
index 0000000..974e8ae
--- /dev/null
+++ b/src/_tests/fixtures/49575/result.json
@@ -0,0 +1,27 @@
+{
+  "pr_number": 49575,
+  "targetColumn": "Needs Maintainer Action",
+  "labels": [
+    "Other Approved",
+    "Edits Infrastructure"
+  ],
+  "responseComments": [
+    {
+      "tag": "welcome",
+      "status": "@jablko Thank you for submitting this PR!\n\n***This is a live comment which I will keep updated.***\n\nThis PR touches some part of DefinitelyTyped infrastructure, so a DT maintainer will need to review it. This is rare — did you mean to do this?\n\n## 0 packages in this PR\n\n\n## Code Reviews\n\nThere aren't any other owners of this package, so a DT maintainer will review it.\n\n## Status\n\n * ✅ No merge conflicts\n * ✅ Continuous integration tests have passed\n * ❌ A DT maintainer needs to approve changes which affect DT infrastructure ([`.github/PULL_REQUEST_TEMPLATE.md`](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/49575/files/cdd66f483bb0103f6e6d1eb7b07192ff95718f25#diff-18813c86948efc57e661623d7ba48ff94325c9b5421ec9177f724922dd553a35), [`README.cn.md`](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/49575/files/cdd66f483bb0103f6e6d1eb7b07192ff95718f25#diff-97a2a8d47e133a2b24ad7bc1a2e25710f534470e28a73efb62da312a3bb19235), [`README.es.md`](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/49575/files/cdd66f483bb0103f6e6d1eb7b07192ff95718f25#diff-42010a55cd1784b825a37c762cc91d75421f3ed4515f1047cf5506444949a0c2), [`README.ko.md`](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/49575/files/cdd66f483bb0103f6e6d1eb7b07192ff95718f25#diff-86fa6921bcebf260d55d8a3742c1b513bd78f4ea18366db989b5a03c68c563ae), [`README.md`](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/49575/files/cdd66f483bb0103f6e6d1eb7b07192ff95718f25#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5), [`README.pt.md`](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/49575/files/cdd66f483bb0103f6e6d1eb7b07192ff95718f25#diff-822bdbb1cbe31bcc1afd1ddbbd7b3191052e07c9996334e645a22694e3cc2119), [`README.ru.md`](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/49575/files/cdd66f483bb0103f6e6d1eb7b07192ff95718f25#diff-fb460bf71153d8224708cfa7298df0409d20c207f5b252b74906895bd8e1ac42))\n\nOnce every item on this list is checked, I'll ask you for permission to merge and publish the changes.\n\n## Inactive\n\nThis PR has been inactive for 7 days.\n\n----------------------\n... diagnostics scrubbed ..."
+    },
+    {
+      "tag": "pinging-reviewers-others",
+      "status": "🔔 @jablko — you're the only owner, but it would still be good if you find someone to [review this PR](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/49575/files) in the next few days, otherwise a maintainer will look at it. (And if you do find someone, maybe even recruit them to be a second owner to make future changes easier...)"
+    },
+    {
+      "tag": "stale-ping-d2e897-6400f4c",
+      "status": "@elibarzilay, @sandersn Thank you for reviewing this PR! The author has pushed new commits since your last review. Could you take another look and submit a fresh review?"
+    }
+  ],
+  "shouldClose": false,
+  "shouldMerge": false,
+  "shouldUpdateLabels": true,
+  "shouldUpdateProjectColumn": true,
+  "shouldRemoveFromActiveColumns": false
+}