Skip to content
This repository has been archived by the owner on Jul 1, 2024. It is now read-only.

Commit

Permalink
Don't ping people who have approving reviews
Browse files Browse the repository at this point in the history
Shouldn't happen in general, but due to another bug it does.  That should
be fixed too, but it's still good to run a filter to be safe.
  • Loading branch information
elibarzilay committed Mar 3, 2021
1 parent 49c6588 commit f862c19
Show file tree
Hide file tree
Showing 9 changed files with 429 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/_tests/fixtures/44989-14days/mutations.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"variables": {
"input": {
"subjectId": "MDExOlB1bGxSZXF1ZXN0NDIyMDc5Mjk3",
"body": "Re-ping @petr-motejlek / @TheHandsomeCoder, @donnut, @mdekrey, @sbking, @afharo, @teves-castro, @1M0reBug, @hojberg, @samsonkeung, @angeloocana, @raynerd, @moshensky, @ethanresnick, @deftomat, @blimusiek, @biern, @rayhaneh, @rgm, @drewwyatt, @jottenlips, @minitesh, @krantisinh, @pirix-gh, @brekk, @nemo108, @jituanlin, @Philippe-mills, @Saul-Mirone, @Nicholaiii:\n\nThis PR has been ready to merge for over a week, and I haven't seen any requests to merge it. I will close it on Jun 22nd (in three weeks) if this doesn't happen.\n\n(If there's no reason to avoid merging it, please do so. Otherwise, if it shouldn't be merged or if it needs more time, please close it or turn it into a draft.)\n<!--typescript_bot_Unmerged:nearly:2020-05-23-->"
"body": "Re-ping @petr-motejlek / @TheHandsomeCoder, @donnut, @mdekrey, @sbking, @afharo, @teves-castro, @1M0reBug, @hojberg, @samsonkeung, @angeloocana, @raynerd, @moshensky, @ethanresnick, @deftomat, @blimusiek, @biern, @rayhaneh, @rgm, @drewwyatt, @jottenlips, @minitesh, @krantisinh, @pirix-gh, @brekk, @nemo108, @jituanlin, @Philippe-mills, @Saul-Mirone:\n\nThis PR has been ready to merge for over a week, and I haven't seen any requests to merge it. I will close it on Jun 22nd (in three weeks) if this doesn't happen.\n\n(If there's no reason to avoid merging it, please do so. Otherwise, if it shouldn't be merged or if it needs more time, please close it or turn it into a draft.)\n<!--typescript_bot_Unmerged:nearly:2020-05-23-->"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/_tests/fixtures/44989-14days/result.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
{
"tag": "Unmerged:nearly:2020-05-23",
"status": "Re-ping @petr-motejlek / @TheHandsomeCoder, @donnut, @mdekrey, @sbking, @afharo, @teves-castro, @1M0reBug, @hojberg, @samsonkeung, @angeloocana, @raynerd, @moshensky, @ethanresnick, @deftomat, @blimusiek, @biern, @rayhaneh, @rgm, @drewwyatt, @jottenlips, @minitesh, @krantisinh, @pirix-gh, @brekk, @nemo108, @jituanlin, @Philippe-mills, @Saul-Mirone, @Nicholaiii:\n\nThis PR has been ready to merge for over a week, and I haven't seen any requests to merge it. I will close it on Jun 22nd (in three weeks) if this doesn't happen.\n\n(If there's no reason to avoid merging it, please do so. Otherwise, if it shouldn't be merged or if it needs more time, please close it or turn it into a draft.)"
"status": "Re-ping @petr-motejlek / @TheHandsomeCoder, @donnut, @mdekrey, @sbking, @afharo, @teves-castro, @1M0reBug, @hojberg, @samsonkeung, @angeloocana, @raynerd, @moshensky, @ethanresnick, @deftomat, @blimusiek, @biern, @rayhaneh, @rgm, @drewwyatt, @jottenlips, @minitesh, @krantisinh, @pirix-gh, @brekk, @nemo108, @jituanlin, @Philippe-mills, @Saul-Mirone:\n\nThis PR has been ready to merge for over a week, and I haven't seen any requests to merge it. I will close it on Jun 22nd (in three weeks) if this doesn't happen.\n\n(If there's no reason to avoid merging it, please do so. Otherwise, if it shouldn't be merged or if it needs more time, please close it or turn it into a draft.)"
}
],
"shouldClose": false,
Expand Down
3 changes: 3 additions & 0 deletions src/_tests/fixtures/51338/_downloads.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"koa": 5708514
}
6 changes: 6 additions & 0 deletions src/_tests/fixtures/51338/_files.json

Large diffs are not rendered by default.

306 changes: 306 additions & 0 deletions src/_tests/fixtures/51338/_response.json

Large diffs are not rendered by default.

51 changes: 51 additions & 0 deletions src/_tests/fixtures/51338/derived.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"type": "info",
"now": "2021-03-02T21:43:39.396Z",
"pr_number": 51338,
"author": "pkuczynski",
"headCommitOid": "4a7712f61d17eb33e89171f317deeb31b3d555ae",
"lastPushDate": "2021-02-19T17:22:27.000Z",
"lastActivityDate": "2021-02-20T14:48:26.000Z",
"maintainerBlessed": false,
"hasMergeConflict": false,
"isFirstContribution": false,
"popularityLevel": "Critical",
"pkgInfo": [
{
"name": "koa",
"kind": "edit",
"files": [
{
"path": "types/koa/index.d.ts",
"kind": "definition"
},
{
"path": "types/koa/tsconfig.json",
"kind": "package-meta",
"suspect": "not [the expected form](https://github.com/DefinitelyTyped/DefinitelyTyped#user-content-tsconfigjson) and not moving towards it"
}
],
"owners": [
"DavidCai1993",
"jkeylu",
"brikou",
"harryparkdotio",
"chatoo2412",
"tellnes",
"pkuczynski"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Critical"
}
],
"reviews": [
{
"type": "approved",
"reviewer": "tellnes",
"date": "2021-02-20T14:48:26.000Z",
"isMaintainer": false
}
],
"ciResult": "pass"
}
31 changes: 31 additions & 0 deletions src/_tests/fixtures/51338/mutations.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[
{
"mutation": "mutation ($input: AddLabelsToLabelableInput!) {\n addLabelsToLabelable(input: $input) {\n __typename\n }\n}\n",
"variables": {
"input": {
"labelIds": [
"MDU6TGFiZWwyNDYyODA0MzE1"
],
"labelableId": "MDExOlB1bGxSZXF1ZXN0NTc2NTk4OTQ2"
}
}
},
{
"mutation": "mutation ($input: UpdateIssueCommentInput!) {\n updateIssueComment(input: $input) {\n __typename\n }\n}\n",
"variables": {
"input": {
"id": "MDEyOklzc3VlQ29tbWVudDc4MjIxMzI4Nw==",
"body": "@pkuczynski Thank you for submitting this PR!\n\n***This is a live comment which I will keep updated.***\n\n## 1 package in this PR\n\n* `koa` [on npm](https://www.npmjs.com/package/koa), [on unpkg](https://unpkg.com/browse/koa@latest/) (author is owner)\n - owner-approval: @tellnes\n - Config files to check:\n - [`koa/tsconfig.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/51338/files/4a7712f61d17eb33e89171f317deeb31b3d555ae#diff-1730c5405d0220a98f28feeec2de3f5a511ebc6a04ceadf12415b81de841672e): not [the expected form](https://github.com/DefinitelyTyped/DefinitelyTyped#user-content-tsconfigjson) and not moving towards it\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\n## Status\n\n * ✅ No merge conflicts\n * ✅ Continuous integration tests have passed\n * ❌ A DT maintainer needs to approve changes which 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 11 days — please try to get reviewers!\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": "MDExOlB1bGxSZXF1ZXN0NTc2NTk4OTQ2",
"body": "Re-ping @DavidCai1993, @jkeylu, @brikou, @harryparkdotio, @chatoo2412:\n\nThis PR has been out for over a week, yet I haven't seen any reviews.\n\nCould someone please give it some attention? Thanks!\n<!--typescript_bot_Unreviewed:nearly:2021-02-19-->"
}
}
}
]
28 changes: 28 additions & 0 deletions src/_tests/fixtures/51338/result.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"projectColumn": "Needs Maintainer Review",
"labels": [
"Critical package",
"Owner Approved",
"Author is Owner",
"Check Config",
"Untested Change",
"Unreviewed"
],
"responseComments": [
{
"tag": "suggest-testing",
"status": "Hey @pkuczynski,\n\n:unamused: Your PR doesn't modify any tests, so it's hard to know what's being fixed, and your changes might regress in the future. Please consider [adding tests](https://github.com/DefinitelyTyped/DefinitelyTyped#user-content-test-editing-an-existing-package) to cover the change you're making. Including tests allows this PR to be merged by yourself and the owners of this module. This can potentially save days of time for you."
},
{
"tag": "welcome",
"status": "@pkuczynski Thank you for submitting this PR!\n\n***This is a live comment which I will keep updated.***\n\n## 1 package in this PR\n\n* `koa` [on npm](https://www.npmjs.com/package/koa), [on unpkg](https://unpkg.com/browse/koa@latest/) (author is owner)\n - owner-approval: @tellnes\n - Config files to check:\n - [`koa/tsconfig.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/51338/files/4a7712f61d17eb33e89171f317deeb31b3d555ae#diff-1730c5405d0220a98f28feeec2de3f5a511ebc6a04ceadf12415b81de841672e): not [the expected form](https://github.com/DefinitelyTyped/DefinitelyTyped#user-content-tsconfigjson) and not moving towards it\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\n## Status\n\n * ✅ No merge conflicts\n * ✅ Continuous integration tests have passed\n * ❌ A DT maintainer needs to approve changes which 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 11 days — please try to get reviewers!\n\n----------------------\n... diagnostics scrubbed ..."
},
{
"tag": "Unreviewed:nearly:2021-02-19",
"status": "Re-ping @DavidCai1993, @jkeylu, @brikou, @harryparkdotio, @chatoo2412:\n\nThis PR has been out for over a week, yet I haven't seen any reviews.\n\nCould someone please give it some attention? Thanks!"
}
],
"shouldClose": false,
"shouldMerge": false,
"shouldUpdateLabels": true
}
3 changes: 2 additions & 1 deletion src/compute-pr-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ function extendPrInfo(info: PrInfo): ExtendedPrInfo {

// Staleness timeline configurations (except for texts that are all in `comments.ts`)
function getStaleness() {
const ownersToPing = otherOwners.length === 0 ? ["«anyone?»"] : otherOwners;
const ownersToPing = otherOwners.length === 0 ? ["«anyone?»"]
: otherOwners.filter(o => !approvedReviews.some(r => o === r.reviewer));
const mkStaleness = makeStaleness(info.now, info.author, ownersToPing);
if (canBeSelfMerged && info.mergeOfferDate) return mkStaleness(
"Unmerged", info.mergeOfferDate, 4, 9, 30, "CLOSE");
Expand Down

0 comments on commit f862c19

Please sign in to comment.