Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/mergebot/src/_tests/fixtures/74980/_downloads.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"bluebird": 10914323
}
4 changes: 4 additions & 0 deletions packages/mergebot/src/_tests/fixtures/74980/_files.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"c6d1344b3c7e49f62f4befd1aaa8665eb6bd6864:types/bluebird/package.json": "{\n \"private\": true,\n \"name\": \"@types/bluebird\",\n \"version\": \"3.5.9999\",\n \"projects\": [\n \"https://github.com/petkaantonov/bluebird\"\n ],\n \"devDependencies\": {\n \"@types/bluebird\": \"workspace:.\"hjhbjkbkvhjc\n },\n \"owners\": xe[\n {\n \"name\": \"Leonard Hecker\",\n \"githubUsername\": \"lhecker\"\n }\n ]\n}\n",
"84efd8820459db1cdaad122f2347683b7db023ee:types/bluebird/package.json": "{\n \"private\": true,\n \"name\": \"@types/bluebird\",\n \"version\": \"3.5.9999\",\n \"projects\": [\n \"https://github.com/petkaantonov/bluebird\"\n ],\n \"devDependencies\": {\n \"@types/bluebird\": \"workspace:.\"\n },\n \"owners\": [\n {\n \"name\": \"Leonard Hecker\",\n \"githubUsername\": \"lhecker\"\n }\n ]\n}\n"
}
139 changes: 139 additions & 0 deletions packages/mergebot/src/_tests/fixtures/74980/_response.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
{
"data": {
"repository": {
"id": "MDEwOlJlcG9zaXRvcnk2MDkzMzE2",
"pullRequest": {
"id": "PR_kwDOAFz6BM7aQ8jd",
"title": "just Update package.json",
"createdAt": "2026-05-11T13:20:01Z",
"author": {
"login": "justinkrn68-droid",
"__typename": "User"
},
"authorAssociation": "FIRST_TIME_CONTRIBUTOR",
"baseRef": {
"name": "master",
"__typename": "Ref"
},
"labels": {
"nodes": [],
"__typename": "LabelConnection"
},
"isDraft": false,
"mergeable": "MERGEABLE",
"number": 74980,
"state": "OPEN",
"headRefOid": "c6d1344b3c7e49f62f4befd1aaa8665eb6bd6864",
"baseRefOid": "84efd8820459db1cdaad122f2347683b7db023ee",
"changedFiles": 1,
"additions": 2,
"deletions": 2,
"commitIds": {
"totalCount": 1,
"nodes": [
{
"commit": {
"oid": "c6d1344b3c7e49f62f4befd1aaa8665eb6bd6864",
"parents": {
"nodes": [
{
"oid": "84efd8820459db1cdaad122f2347683b7db023ee",
"__typename": "Commit"
}
],
"__typename": "CommitConnection"
},
"__typename": "Commit"
},
"__typename": "PullRequestCommit"
}
],
"__typename": "PullRequestCommitConnection"
},
"timelineItems": {
"nodes": [],
"__typename": "PullRequestTimelineItemsConnection"
},
"reviews": {
"totalCount": 0,
"nodes": [],
"__typename": "PullRequestReviewConnection"
},
"commits": {
"totalCount": 1,
"nodes": [
{
"commit": {
"checkSuites": {
"nodes": [
{
"databaseId": 68415365071,
"app": {
"name": "GitHub Actions",
"__typename": "App"
},
"conclusion": "ACTION_REQUIRED",
"resourcePath": "/DefinitelyTyped/DefinitelyTyped/commit/c6d1344b3c7e49f62f4befd1aaa8665eb6bd6864/checks?check_suite_id=68415365071",
"status": "COMPLETED",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped/commit/c6d1344b3c7e49f62f4befd1aaa8665eb6bd6864/checks?check_suite_id=68415365071",
"checkRuns": {
"nodes": [],
"__typename": "CheckRunConnection"
},
"createdAt": "2026-05-11T13:20:11Z",
"workflowRun": {
"file": {
"path": ".github/workflows/CI.yml",
"__typename": "WorkflowRunFile"
},
"__typename": "WorkflowRun"
},
"__typename": "CheckSuite"
}
],
"__typename": "CheckSuiteConnection"
},
"status": null,
"authoredDate": "2026-05-11T13:19:36Z",
"committedDate": "2026-05-11T13:19:36Z",
"pushedDate": null,
"oid": "c6d1344b3c7e49f62f4befd1aaa8665eb6bd6864",
"__typename": "Commit"
},
"__typename": "PullRequestCommit"
}
],
"__typename": "PullRequestCommitConnection"
},
"comments": {
"totalCount": 0,
"nodes": [],
"__typename": "IssueCommentConnection"
},
"files": {
"totalCount": 1,
"nodes": [
{
"path": "types/bluebird/package.json",
"additions": 2,
"deletions": 2,
"__typename": "PullRequestChangedFile"
}
],
"pageInfo": {
"hasNextPage": false,
"endCursor": "MQ",
"__typename": "PageInfo"
},
"__typename": "PullRequestChangedFileConnection"
},
"projectItems": {
"nodes": [],
"__typename": "ProjectV2ItemConnection"
},
"__typename": "PullRequest"
},
"__typename": "Repository"
}
}
}
41 changes: 41 additions & 0 deletions packages/mergebot/src/_tests/fixtures/74980/derived.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"type": "info",
"now": "2026-06-09T18:11:33.900Z",
"pr_number": 74980,
"author": "justinkrn68-droid",
"headCommitOid": "c6d1344b3c7e49f62f4befd1aaa8665eb6bd6864",
"mergeBaseOid": "84efd8820459db1cdaad122f2347683b7db023ee",
"lastPushDate": "2026-05-11T13:20:01.000Z",
"lastActivityDate": "2026-05-11T13:20:01.000Z",
"hasMergeConflict": false,
"isFirstContribution": true,
"tooManyFiles": false,
"hugeChange": false,
"tooManyCommits": false,
"tooManyReviews": false,
"popularityLevel": "Critical",
"pkgInfo": [
{
"name": "bluebird",
"kind": "edit",
"files": [
{
"path": "types/bluebird/package.json",
"kind": "package-meta",
"suspect": "couldn't parse json"
}
],
"owners": [
"lhecker"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Critical"
}
],
"reviews": [],
"ciResult": "action_required",
"reRunCheckSuiteIDs": [
68415365071
]
}
68 changes: 68 additions & 0 deletions packages/mergebot/src/_tests/fixtures/74980/mutations.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
[
{
"mutation": "mutation ($input: AddCommentInput!) {\n addComment(input: $input) {\n __typename\n }\n}",
"variables": {
"input": {
"subjectId": "PR_kwDOAFz6BM7aQ8jd",
"body": "@justinkrn68-droid Thank you for submitting this PR! I see this is your first time submitting to DefinitelyTyped 👋 — I'm the local bot who will help you through the process of getting things through.\n\n***This is a live comment that I will keep updated.***\n\n## 1 package in this PR\n\n* `bluebird` — [on npm](https://www.npmjs.com/package/bluebird), [on unpkg](https://unpkg.com/browse/bluebird@latest/)\n - Config files to check:\n - [`bluebird/package.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/74980/files/c6d1344b3c7e49f62f4befd1aaa8665eb6bd6864#diff-a7758061c91486db4772fdf646baf1596c98b99a50204a6b3185b4a7e021fb9f): couldn't parse json\n\n## Code Reviews\n\nBecause this is a widely-used package, a DT maintainer will need to review it before it can be merged.\n\nYou can test the changes of this PR [in the Playground](https://www.typescriptlang.org/play/?dtPR=74980&install-plugin=playground-dt-review).\n\n## Status\n\n * ✅ No merge conflicts\n * 🕐 Continuous integration tests are still running\n * 🕐 A DT maintainer needs to approve changes that affect module config files\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 29 days — it is *still* unreviewed!\n\n----------------------\n... diagnostics scrubbed ...\n<!--typescript_bot_welcome-->"
}
}
},
{
"mutation": "mutation ($input: AddLabelsToLabelableInput!) {\n addLabelsToLabelable(input: $input) {\n __typename\n }\n}",
"variables": {
"input": {
"labelIds": [
"MDU6TGFiZWwxNjA4NjM0NDg0",
"MDU6TGFiZWwyMTU0ODE2NTQ5",
"MDU6TGFiZWwyNDYyODA0MzE1"
],
"labelableId": "PR_kwDOAFz6BM7aQ8jd"
}
}
},
{
"mutation": "mutation ($input: AddProjectV2ItemByIdInput!) {\n addProjectV2ItemById(input: $input) {\n __typename\n item {\n id\n }\n }\n}",
"variables": {
"input": {
"contentId": "PR_kwDOAFz6BM7aQ8jd",
"projectId": "PVT_kwDOADeBNM4AkH1q"
}
}
},
{
"mutation": "mutation ($input: UpdateProjectV2ItemFieldValueInput!) {\n updateProjectV2ItemFieldValue(input: $input) {\n __typename\n }\n}",
"variables": {
"input": {
"itemId": "TEST",
"projectId": "PVT_kwDOADeBNM4AkH1q",
"fieldId": "PVTSSF_lADOADeBNM4AkH1qzgcYOEM",
"value": {
"singleSelectOptionId": "f75ad846"
}
}
}
},
{
"mutation": "mutation ($input: AddCommentInput!) {\n addComment(input: $input) {\n __typename\n }\n}",
"variables": {
"input": {
"subjectId": "PR_kwDOAFz6BM7aQ8jd",
"body": "🔔 @lhecker — please [review this PR](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/74980/files) in the next few days. Be sure to explicitly select **`Approve`** or **`Request Changes`** in the GitHub UI so I know what's going on.\n<!--typescript_bot_pinging-reviewers-->"
}
}
},
{
"mutation": "mutation ($input: AddCommentInput!) {\n addComment(input: $input) {\n __typename\n }\n}",
"variables": {
"input": {
"subjectId": "PR_kwDOAFz6BM7aQ8jd",
"body": "It has been more than two weeks and this PR still has no reviews.\n\nI'll bump it to the DT maintainer queue. Thank you for your patience, @justinkrn68-droid.\n\n(Ping @lhecker.)\n<!--typescript_bot_Unreviewed:done-->"
}
}
},
{
"method": "POST",
"op": "check-suites/68415365071/rerequest"
}
]
28 changes: 28 additions & 0 deletions packages/mergebot/src/_tests/fixtures/74980/result.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"projectColumn": "Needs Maintainer Action",
"labels": [
"Critical package",
"Check Config",
"Unreviewed"
],
"responseComments": [
{
"tag": "welcome",
"status": "@justinkrn68-droid Thank you for submitting this PR! I see this is your first time submitting to DefinitelyTyped 👋 — I'm the local bot who will help you through the process of getting things through.\n\n***This is a live comment that I will keep updated.***\n\n## 1 package in this PR\n\n* `bluebird` — [on npm](https://www.npmjs.com/package/bluebird), [on unpkg](https://unpkg.com/browse/bluebird@latest/)\n - Config files to check:\n - [`bluebird/package.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/74980/files/c6d1344b3c7e49f62f4befd1aaa8665eb6bd6864#diff-a7758061c91486db4772fdf646baf1596c98b99a50204a6b3185b4a7e021fb9f): couldn't parse json\n\n## Code Reviews\n\nBecause this is a widely-used package, a DT maintainer will need to review it before it can be merged.\n\nYou can test the changes of this PR [in the Playground](https://www.typescriptlang.org/play/?dtPR=74980&install-plugin=playground-dt-review).\n\n## Status\n\n * ✅ No merge conflicts\n * 🕐 Continuous integration tests are still running\n * 🕐 A DT maintainer needs to approve changes that affect module config files\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 29 days — it is *still* unreviewed!\n\n----------------------\n... diagnostics scrubbed ..."
},
{
"tag": "pinging-reviewers",
"status": "🔔 @lhecker — please [review this PR](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/74980/files) in the next few days. Be sure to explicitly select **`Approve`** or **`Request Changes`** in the GitHub UI so I know what's going on."
},
{
"tag": "Unreviewed:done",
"status": "It has been more than two weeks and this PR still has no reviews.\n\nI'll bump it to the DT maintainer queue. Thank you for your patience, @justinkrn68-droid.\n\n(Ping @lhecker.)"
}
],
"shouldClose": false,
"shouldMerge": false,
"shouldUpdateLabels": true,
"reRunActionsCheckSuiteIDs": [
68415365071
]
}
12 changes: 4 additions & 8 deletions packages/mergebot/src/pr-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -561,14 +561,10 @@ function makeChecker(
) {
const diffFromExpected = (text: string) => {
let data: any;
if (options?.parse) {
data = options.parse(text);
} else {
try {
data = JSON.parse(text);
} catch (e) {
return "couldn't parse json";
}
try {
data = options?.parse ? options.parse(text) : JSON.parse(text);
} catch (e) {
return "couldn't parse json";
}
options?.ignore?.(data);
try {
Expand Down
Loading