From 35e014fc5437d2c5594e2c25def3676533ed265a Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Thu, 30 Jan 2025 12:25:33 -0800 Subject: [PATCH] Don't treat eslintrc deleting as needing a config check --- .../mergebot/src/_tests/fixtures/71725/derived.json | 2 +- .../src/_tests/fixtures/71725/mutations.json | 2 +- .../mergebot/src/_tests/fixtures/71725/result.json | 2 +- .../mergebot/src/_tests/fixtures/71790/derived.json | 3 +-- .../src/_tests/fixtures/71790/mutations.json | 13 ++++++++++++- .../mergebot/src/_tests/fixtures/71790/result.json | 5 ++--- packages/mergebot/src/pr-info.ts | 1 + packages/mergebot/src/urls.ts | 1 + 8 files changed, 20 insertions(+), 9 deletions(-) diff --git a/packages/mergebot/src/_tests/fixtures/71725/derived.json b/packages/mergebot/src/_tests/fixtures/71725/derived.json index 581fe2b579..6a8ecb2dd4 100644 --- a/packages/mergebot/src/_tests/fixtures/71725/derived.json +++ b/packages/mergebot/src/_tests/fixtures/71725/derived.json @@ -21,7 +21,7 @@ { "path": "types/enhance__enhance/.eslintrc.json", "kind": "package-meta", - "suspect": "edited" + "suspect": "not [the expected form](https://github.com/DefinitelyTyped/DefinitelyTyped#user-content-linter-eslintrcjson) (check: `rules`)" }, { "path": "types/enhance__enhance/.npmignore", diff --git a/packages/mergebot/src/_tests/fixtures/71725/mutations.json b/packages/mergebot/src/_tests/fixtures/71725/mutations.json index ee713a4b5c..7a3e8cb7cc 100644 --- a/packages/mergebot/src/_tests/fixtures/71725/mutations.json +++ b/packages/mergebot/src/_tests/fixtures/71725/mutations.json @@ -4,7 +4,7 @@ "variables": { "input": { "id": "IC_kwDOAFz6BM6bcLgn", - "body": "@agawley 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* `enhance__enhance` (*new!*) — [on npm](https://www.npmjs.com/package/@enhance/enhance), [on unpkg](https://unpkg.com/browse/@enhance/enhance@latest/)\n - 1 added owner: ✎@agawley\n - Config files to check:\n - [`enhance__enhance/.eslintrc.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/71725/files/10894aa4e8d1717516ae8867f3fbaa50e88785ea#diff-8396f43ae17f6ac375fa3ccd977f1fa5f4623a11ad7d4bb5d770a7f49d0feebd): edited\n\n## Code Reviews\n\nThis PR adds a new definition, so it needs to be reviewed by a DT maintainer before it can be merged.\n\nYou can test the changes of this PR [in the Playground](https://www.typescriptlang.org/play/?dtPR=71725&install-plugin=playground-dt-review).\n\n## Status\n\n * ✅ No merge conflicts\n * ✅ Continuous integration tests have passed\n * ✅ Only a DT maintainer can approve changes when there are new packages added\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" + "body": "@agawley 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* `enhance__enhance` (*new!*) — [on npm](https://www.npmjs.com/package/@enhance/enhance), [on unpkg](https://unpkg.com/browse/@enhance/enhance@latest/)\n - 1 added owner: ✎@agawley\n - Config files to check:\n - [`enhance__enhance/.eslintrc.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/71725/files/10894aa4e8d1717516ae8867f3fbaa50e88785ea#diff-8396f43ae17f6ac375fa3ccd977f1fa5f4623a11ad7d4bb5d770a7f49d0feebd): not [the expected form](https://github.com/DefinitelyTyped/DefinitelyTyped#user-content-linter-eslintrcjson) (check: `rules`)\n\n## Code Reviews\n\nThis PR adds a new definition, so it needs to be reviewed by a DT maintainer before it can be merged.\n\nYou can test the changes of this PR [in the Playground](https://www.typescriptlang.org/play/?dtPR=71725&install-plugin=playground-dt-review).\n\n## Status\n\n * ✅ No merge conflicts\n * ✅ Continuous integration tests have passed\n * ✅ Only a DT maintainer can approve changes when there are new packages added\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" } } } diff --git a/packages/mergebot/src/_tests/fixtures/71725/result.json b/packages/mergebot/src/_tests/fixtures/71725/result.json index fb854d6dbe..af182c8a1b 100644 --- a/packages/mergebot/src/_tests/fixtures/71725/result.json +++ b/packages/mergebot/src/_tests/fixtures/71725/result.json @@ -9,7 +9,7 @@ "responseComments": [ { "tag": "welcome", - "status": "@agawley 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* `enhance__enhance` (*new!*) — [on npm](https://www.npmjs.com/package/@enhance/enhance), [on unpkg](https://unpkg.com/browse/@enhance/enhance@latest/)\n - 1 added owner: ✎@agawley\n - Config files to check:\n - [`enhance__enhance/.eslintrc.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/71725/files/10894aa4e8d1717516ae8867f3fbaa50e88785ea#diff-8396f43ae17f6ac375fa3ccd977f1fa5f4623a11ad7d4bb5d770a7f49d0feebd): edited\n\n## Code Reviews\n\nThis PR adds a new definition, so it needs to be reviewed by a DT maintainer before it can be merged.\n\nYou can test the changes of this PR [in the Playground](https://www.typescriptlang.org/play/?dtPR=71725&install-plugin=playground-dt-review).\n\n## Status\n\n * ✅ No merge conflicts\n * ✅ Continuous integration tests have passed\n * ✅ Only a DT maintainer can approve changes when there are new packages added\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 ..." + "status": "@agawley 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* `enhance__enhance` (*new!*) — [on npm](https://www.npmjs.com/package/@enhance/enhance), [on unpkg](https://unpkg.com/browse/@enhance/enhance@latest/)\n - 1 added owner: ✎@agawley\n - Config files to check:\n - [`enhance__enhance/.eslintrc.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/71725/files/10894aa4e8d1717516ae8867f3fbaa50e88785ea#diff-8396f43ae17f6ac375fa3ccd977f1fa5f4623a11ad7d4bb5d770a7f49d0feebd): not [the expected form](https://github.com/DefinitelyTyped/DefinitelyTyped#user-content-linter-eslintrcjson) (check: `rules`)\n\n## Code Reviews\n\nThis PR adds a new definition, so it needs to be reviewed by a DT maintainer before it can be merged.\n\nYou can test the changes of this PR [in the Playground](https://www.typescriptlang.org/play/?dtPR=71725&install-plugin=playground-dt-review).\n\n## Status\n\n * ✅ No merge conflicts\n * ✅ Continuous integration tests have passed\n * ✅ Only a DT maintainer can approve changes when there are new packages added\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", diff --git a/packages/mergebot/src/_tests/fixtures/71790/derived.json b/packages/mergebot/src/_tests/fixtures/71790/derived.json index 603f158d39..526e907167 100644 --- a/packages/mergebot/src/_tests/fixtures/71790/derived.json +++ b/packages/mergebot/src/_tests/fixtures/71790/derived.json @@ -34,8 +34,7 @@ "files": [ { "path": "types/hapi__catbox-memory/.eslintrc.json", - "kind": "package-meta", - "suspect": "edited" + "kind": "package-meta-ok" }, { "path": "types/hapi__catbox-memory/.npmignore", diff --git a/packages/mergebot/src/_tests/fixtures/71790/mutations.json b/packages/mergebot/src/_tests/fixtures/71790/mutations.json index ec1ddec56a..ad9395c19d 100644 --- a/packages/mergebot/src/_tests/fixtures/71790/mutations.json +++ b/packages/mergebot/src/_tests/fixtures/71790/mutations.json @@ -4,7 +4,18 @@ "variables": { "input": { "id": "IC_kwDOAFz6BM6cXqlQ", - "body": "@hkleungai Thank you for submitting this PR!\n\n***This is a live comment that 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## 1 package in this PR (and infra files)\n\n* `hapi__catbox-memory` (*probably deleted!*) — [on npm](https://www.npmjs.com/package/@hapi/catbox-memory), [on unpkg](https://unpkg.com/browse/@hapi/catbox-memory@latest/)\n - Config files to check:\n - [`hapi__catbox-memory/.eslintrc.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/71790/files/0a964f11f0a26b05b176e5d56763599b0c16e044#diff-8bad4f61b3e70b922be4f5f4505b1c009299493d2ba9644e4ecd61fa761c6fc1): edited\n* Infra files\n - [`notNeededPackages.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/71790/files/0a964f11f0a26b05b176e5d56763599b0c16e044#diff-a275c2eae7b8f788a52327e76809026ee1bc5ea614393806c8f3cbab07202621)\n\n## Code Reviews\n\nBecause this PR edits the configuration file, it can be merged once it's reviewed by a DT maintainer.\n\nYou can test the changes of this PR [in the Playground](https://www.typescriptlang.org/play/?dtPR=71790&install-plugin=playground-dt-review).\n\n## Status\n\n * ✅ No merge conflicts\n * ✅ Continuous integration tests have passed\n * 🕐 A DT maintainer needs to approve changes that affect DT infrastructure ([`notNeededPackages.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/71790/files/0a964f11f0a26b05b176e5d56763599b0c16e044#diff-a275c2eae7b8f788a52327e76809026ee1bc5ea614393806c8f3cbab07202621))\n\nOnce every item on this list is checked, I'll ask you for permission to merge and publish the changes.\n\n----------------------\n... diagnostics scrubbed ...\n" + "body": "@hkleungai Thank you for submitting this PR!\n\n***This is a live comment that 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## 1 package in this PR (and infra files)\n\n* `hapi__catbox-memory` (*probably deleted!*) — [on npm](https://www.npmjs.com/package/@hapi/catbox-memory), [on unpkg](https://unpkg.com/browse/@hapi/catbox-memory@latest/)\n* Infra files\n - [`notNeededPackages.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/71790/files/0a964f11f0a26b05b176e5d56763599b0c16e044#diff-a275c2eae7b8f788a52327e76809026ee1bc5ea614393806c8f3cbab07202621)\n\n## Code Reviews\n\nThis PR can be merged once it's reviewed by a DT maintainer.\n\nYou can test the changes of this PR [in the Playground](https://www.typescriptlang.org/play/?dtPR=71790&install-plugin=playground-dt-review).\n\n## Status\n\n * ✅ No merge conflicts\n * ✅ Continuous integration tests have passed\n * 🕐 A DT maintainer needs to approve changes that affect DT infrastructure ([`notNeededPackages.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/71790/files/0a964f11f0a26b05b176e5d56763599b0c16e044#diff-a275c2eae7b8f788a52327e76809026ee1bc5ea614393806c8f3cbab07202621))\n\nOnce every item on this list is checked, I'll ask you for permission to merge and publish the changes.\n\n----------------------\n... diagnostics scrubbed ...\n" + } + } + }, + { + "mutation": "mutation ($input: RemoveLabelsFromLabelableInput!) {\n removeLabelsFromLabelable(input: $input) {\n __typename\n }\n}\n", + "variables": { + "input": { + "labelIds": [ + "MDU6TGFiZWwyMTU0ODE2NTQ5" + ], + "labelableId": "PR_kwDOAFz6BM6Jcn5W" } } } diff --git a/packages/mergebot/src/_tests/fixtures/71790/result.json b/packages/mergebot/src/_tests/fixtures/71790/result.json index 561b797361..c70a58dd99 100644 --- a/packages/mergebot/src/_tests/fixtures/71790/result.json +++ b/packages/mergebot/src/_tests/fixtures/71790/result.json @@ -1,13 +1,12 @@ { "projectColumn": "Needs Maintainer Action", "labels": [ - "Edits Infrastructure", - "Check Config" + "Edits Infrastructure" ], "responseComments": [ { "tag": "welcome", - "status": "@hkleungai Thank you for submitting this PR!\n\n***This is a live comment that 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## 1 package in this PR (and infra files)\n\n* `hapi__catbox-memory` (*probably deleted!*) — [on npm](https://www.npmjs.com/package/@hapi/catbox-memory), [on unpkg](https://unpkg.com/browse/@hapi/catbox-memory@latest/)\n - Config files to check:\n - [`hapi__catbox-memory/.eslintrc.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/71790/files/0a964f11f0a26b05b176e5d56763599b0c16e044#diff-8bad4f61b3e70b922be4f5f4505b1c009299493d2ba9644e4ecd61fa761c6fc1): edited\n* Infra files\n - [`notNeededPackages.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/71790/files/0a964f11f0a26b05b176e5d56763599b0c16e044#diff-a275c2eae7b8f788a52327e76809026ee1bc5ea614393806c8f3cbab07202621)\n\n## Code Reviews\n\nBecause this PR edits the configuration file, it can be merged once it's reviewed by a DT maintainer.\n\nYou can test the changes of this PR [in the Playground](https://www.typescriptlang.org/play/?dtPR=71790&install-plugin=playground-dt-review).\n\n## Status\n\n * ✅ No merge conflicts\n * ✅ Continuous integration tests have passed\n * 🕐 A DT maintainer needs to approve changes that affect DT infrastructure ([`notNeededPackages.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/71790/files/0a964f11f0a26b05b176e5d56763599b0c16e044#diff-a275c2eae7b8f788a52327e76809026ee1bc5ea614393806c8f3cbab07202621))\n\nOnce every item on this list is checked, I'll ask you for permission to merge and publish the changes.\n\n----------------------\n... diagnostics scrubbed ..." + "status": "@hkleungai Thank you for submitting this PR!\n\n***This is a live comment that 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## 1 package in this PR (and infra files)\n\n* `hapi__catbox-memory` (*probably deleted!*) — [on npm](https://www.npmjs.com/package/@hapi/catbox-memory), [on unpkg](https://unpkg.com/browse/@hapi/catbox-memory@latest/)\n* Infra files\n - [`notNeededPackages.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/71790/files/0a964f11f0a26b05b176e5d56763599b0c16e044#diff-a275c2eae7b8f788a52327e76809026ee1bc5ea614393806c8f3cbab07202621)\n\n## Code Reviews\n\nThis PR can be merged once it's reviewed by a DT maintainer.\n\nYou can test the changes of this PR [in the Playground](https://www.typescriptlang.org/play/?dtPR=71790&install-plugin=playground-dt-review).\n\n## Status\n\n * ✅ No merge conflicts\n * ✅ Continuous integration tests have passed\n * 🕐 A DT maintainer needs to approve changes that affect DT infrastructure ([`notNeededPackages.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/71790/files/0a964f11f0a26b05b176e5d56763599b0c16e044#diff-a275c2eae7b8f788a52327e76809026ee1bc5ea614393806c8f3cbab07202621))\n\nOnce every item on this list is checked, I'll ask you for permission to merge and publish the changes.\n\n----------------------\n... diagnostics scrubbed ..." }, { "tag": "pinging-reviewers", diff --git a/packages/mergebot/src/pr-info.ts b/packages/mergebot/src/pr-info.ts index 3a92a73275..df966a0df3 100644 --- a/packages/mergebot/src/pr-info.ts +++ b/packages/mergebot/src/pr-info.ts @@ -511,6 +511,7 @@ configSuspicious["tsconfig.json"] = makeChecker( }, }, ); +configSuspicious[".eslintrc.json"] = makeChecker({}, urls.eslintrc); type JSONLike = boolean | number | string | null | { [key: string]: JSONLike } | JSONLike[]; diff --git a/packages/mergebot/src/urls.ts b/packages/mergebot/src/urls.ts index 02b13c5e30..770646cd6d 100644 --- a/packages/mergebot/src/urls.ts +++ b/packages/mergebot/src/urls.ts @@ -12,6 +12,7 @@ export const definitionOwners = readmeLink("Definition Owners"); export const workflow = readmeLink("Make a pull request"); export const tsconfigJson = readmeLink("`tsconfig.json`"); export const packageJson = readmeLink("`package.json`"); +export const eslintrc = readmeLink("Linter: `.eslintrc.json`"); export const testsTs = readmeLink("`-tests.ts`"); export const playground = (prNum: number) =>