Skip to content

Commit

Permalink
Don't ignore "ready to merge" when followed by additional approvals
Browse files Browse the repository at this point in the history
Since #190 we ignore "ready to merge" comments predating the most recent
review. That change explicitly discounts the most recent comment date,
so additional comments don't trample the "ready to merge" request,
however additional approvals still do:
DefinitelyTyped/DefinitelyTyped#48236

We can't drop the `lastReviewDate` from the `sinceDates` entirely
without reopening #164, demonstrated in
DefinitelyTyped/DefinitelyTyped#46120, so the next simplest thing is to
replace it with the earliest (non-stale) approval date.

This works for DefinitelyTyped/DefinitelyTyped#46120 (continues to
ignore requests preceding approval) and
DefinitelyTyped/DefinitelyTyped#48236 (additional approvals don't
trample requests, like additional comments don't).
  • Loading branch information
jablko authored and elibarzilay committed Oct 16, 2020
1 parent 804d7b0 commit ac82aec
Show file tree
Hide file tree
Showing 27 changed files with 544 additions and 22 deletions.
3 changes: 2 additions & 1 deletion src/_tests/fixtures/38979/derived.json
Original file line number Diff line number Diff line change
Expand Up @@ -404,5 +404,6 @@
}
],
"approvalFlags": 1,
"isChangesRequested": false
"isChangesRequested": false,
"firstApprovalDate": "2020-05-12T04:51:52.000Z"
}
3 changes: 2 additions & 1 deletion src/_tests/fixtures/43144/derived.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,6 @@
"lastReviewDate": "2020-03-15T01:29:09.000Z",
"reviewersWithStaleReviews": [],
"approvalFlags": 2,
"isChangesRequested": false
"isChangesRequested": false,
"firstApprovalDate": "2020-03-15T01:29:09.000Z"
}
3 changes: 2 additions & 1 deletion src/_tests/fixtures/43160/derived.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,6 @@
"lastReviewDate": "2020-03-17T14:33:47.000Z",
"reviewersWithStaleReviews": [],
"approvalFlags": 2,
"isChangesRequested": false
"isChangesRequested": false,
"firstApprovalDate": "2020-03-17T14:33:47.000Z"
}
3 changes: 2 additions & 1 deletion src/_tests/fixtures/44267/derived.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,6 @@
"lastReviewDate": "2020-04-28T06:48:36.000Z",
"reviewersWithStaleReviews": [],
"approvalFlags": 2,
"isChangesRequested": false
"isChangesRequested": false,
"firstApprovalDate": "2020-04-28T06:48:36.000Z"
}
3 changes: 2 additions & 1 deletion src/_tests/fixtures/44437/derived.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,6 @@
"lastReviewDate": "2020-05-02T12:17:22.000Z",
"reviewersWithStaleReviews": [],
"approvalFlags": 2,
"isChangesRequested": false
"isChangesRequested": false,
"firstApprovalDate": "2020-05-02T12:17:22.000Z"
}
3 changes: 2 additions & 1 deletion src/_tests/fixtures/44631/derived.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,6 @@
"lastReviewDate": "2020-05-15T15:41:39.000Z",
"reviewersWithStaleReviews": [],
"approvalFlags": 4,
"isChangesRequested": false
"isChangesRequested": false,
"firstApprovalDate": "2020-05-15T15:41:39.000Z"
}
3 changes: 2 additions & 1 deletion src/_tests/fixtures/44989-3days/derived.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,6 @@
"lastReviewDate": "2020-05-23T10:05:48.000Z",
"reviewersWithStaleReviews": [],
"approvalFlags": 2,
"isChangesRequested": false
"isChangesRequested": false,
"firstApprovalDate": "2020-05-23T10:05:48.000Z"
}
3 changes: 2 additions & 1 deletion src/_tests/fixtures/44989-5days/derived.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,6 @@
"lastReviewDate": "2020-05-23T10:05:48.000Z",
"reviewersWithStaleReviews": [],
"approvalFlags": 2,
"isChangesRequested": false
"isChangesRequested": false,
"firstApprovalDate": "2020-05-23T10:05:48.000Z"
}
3 changes: 2 additions & 1 deletion src/_tests/fixtures/44989-6days/derived.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,6 @@
"lastReviewDate": "2020-05-23T10:05:48.000Z",
"reviewersWithStaleReviews": [],
"approvalFlags": 2,
"isChangesRequested": false
"isChangesRequested": false,
"firstApprovalDate": "2020-05-23T10:05:48.000Z"
}
3 changes: 2 additions & 1 deletion src/_tests/fixtures/44989-9days/derived.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,6 @@
"lastReviewDate": "2020-05-23T10:05:48.000Z",
"reviewersWithStaleReviews": [],
"approvalFlags": 2,
"isChangesRequested": false
"isChangesRequested": false,
"firstApprovalDate": "2020-05-23T10:05:48.000Z"
}
3 changes: 2 additions & 1 deletion src/_tests/fixtures/45137/derived.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,6 @@
"lastReviewDate": "2020-05-29T07:13:24.000Z",
"reviewersWithStaleReviews": [],
"approvalFlags": 2,
"isChangesRequested": false
"isChangesRequested": false,
"firstApprovalDate": "2020-05-29T07:13:24.000Z"
}
3 changes: 2 additions & 1 deletion src/_tests/fixtures/45627/derived.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,6 @@
"lastReviewDate": "2020-07-03T17:33:39.000Z",
"reviewersWithStaleReviews": [],
"approvalFlags": 2,
"isChangesRequested": false
"isChangesRequested": false,
"firstApprovalDate": "2020-07-03T17:33:39.000Z"
}
3 changes: 2 additions & 1 deletion src/_tests/fixtures/45836/derived.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,6 @@
"lastReviewDate": "2020-07-03T22:31:28.000Z",
"reviewersWithStaleReviews": [],
"approvalFlags": 2,
"isChangesRequested": false
"isChangesRequested": false,
"firstApprovalDate": "2020-07-03T22:31:28.000Z"
}
3 changes: 2 additions & 1 deletion src/_tests/fixtures/45884/derived.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,6 @@
"lastReviewDate": "2020-07-04T11:08:20.000Z",
"reviewersWithStaleReviews": [],
"approvalFlags": 2,
"isChangesRequested": false
"isChangesRequested": false,
"firstApprovalDate": "2020-07-04T11:08:20.000Z"
}
3 changes: 2 additions & 1 deletion src/_tests/fixtures/45888/derived.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@
"lastReviewDate": "2020-07-06T05:28:20.000Z",
"reviewersWithStaleReviews": [],
"approvalFlags": 1,
"isChangesRequested": false
"isChangesRequested": false,
"firstApprovalDate": "2020-07-06T05:28:20.000Z"
}
3 changes: 2 additions & 1 deletion src/_tests/fixtures/45890/derived.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,6 @@
"lastReviewDate": "2020-07-05T08:20:29.000Z",
"reviewersWithStaleReviews": [],
"approvalFlags": 1,
"isChangesRequested": false
"isChangesRequested": false,
"firstApprovalDate": "2020-07-05T08:20:29.000Z"
}
3 changes: 2 additions & 1 deletion src/_tests/fixtures/45999/derived.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,6 @@
"lastReviewDate": "2020-07-10T14:49:32.000Z",
"reviewersWithStaleReviews": [],
"approvalFlags": 2,
"isChangesRequested": false
"isChangesRequested": false,
"firstApprovalDate": "2020-07-10T13:34:29.000Z"
}
3 changes: 2 additions & 1 deletion src/_tests/fixtures/46008/derived.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,6 @@
"lastReviewDate": "2020-07-10T18:53:03.000Z",
"reviewersWithStaleReviews": [],
"approvalFlags": 2,
"isChangesRequested": false
"isChangesRequested": false,
"firstApprovalDate": "2020-07-10T18:53:03.000Z"
}
3 changes: 2 additions & 1 deletion src/_tests/fixtures/46019/derived.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,6 @@
"lastReviewDate": "2020-07-12T02:01:31.000Z",
"reviewersWithStaleReviews": [],
"approvalFlags": 4,
"isChangesRequested": false
"isChangesRequested": false,
"firstApprovalDate": "2020-07-12T02:01:31.000Z"
}
3 changes: 2 additions & 1 deletion src/_tests/fixtures/46120/derived.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,6 @@
"lastReviewDate": "2020-07-19T20:19:03.000Z",
"reviewersWithStaleReviews": [],
"approvalFlags": 2,
"isChangesRequested": false
"isChangesRequested": false,
"firstApprovalDate": "2020-07-19T20:19:03.000Z"
}
3 changes: 3 additions & 0 deletions src/_tests/fixtures/48236/_downloads.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"woocommerce__woocommerce-rest-api": 1271
}
5 changes: 5 additions & 0 deletions src/_tests/fixtures/48236/_files.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"b4d71f672f0f204a514002348ebc2025d18866ca:types/woocommerce__woocommerce-rest-api/tsconfig.json": "{\n \"compilerOptions\": {\n \"module\": \"commonjs\",\n \"lib\": [\n \"es6\"\n ],\n \"noImplicitAny\": true,\n \"noImplicitThis\": true,\n \"strictFunctionTypes\": true,\n \"strictNullChecks\": true,\n \"baseUrl\": \"../\",\n \"typeRoots\": [\n \"../\"\n ],\n \"types\": [],\n \"noEmit\": true,\n \"forceConsistentCasingInFileNames\": true,\n \"paths\": {\n \"@woocommerce/*\": [\n \"woocommerce__*\"\n ]\n }\n },\n \"files\": [\n \"index.d.ts\",\n \"woocommerce__woocommerce-rest-api-tests.ts\"\n ]\n}\n",
"master:types/woocommerce__woocommerce-rest-api/tsconfig.json": "{\n \"compilerOptions\": {\n \"module\": \"commonjs\",\n \"lib\": [\n \"es6\"\n ],\n \"noImplicitAny\": true,\n \"noImplicitThis\": true,\n \"strictFunctionTypes\": true,\n \"strictNullChecks\": true,\n \"baseUrl\": \"../\",\n \"typeRoots\": [\n \"../\"\n ],\n \"types\": [],\n \"noEmit\": true,\n \"forceConsistentCasingInFileNames\": true\n },\n \"files\": [\n \"index.d.ts\",\n \"woocommerce__woocommerce-rest-api-tests.ts\"\n ]\n}\n",
"master:types/woocommerce__woocommerce-rest-api/index.d.ts": "// Type definitions for @woocommerce/woocommerce-rest-api 1.0\n// Project: https://github.com/woocommerce/woocommerce-rest-api-js-lib\n// Definitions by: KaKa <https://github.com/climba03003>\n// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped\nexport type WooCommerceRestApiVersion = 'wc/v3' | 'wc/v2' | 'wc/v1' | 'wc-api/v3' | 'wc-api/v2' | 'wc-api/v1';\nexport type WooCommerceRestApiEncoding = 'utf-8' | 'ascii';\nexport type WooCommerceRestApiMethod = 'get' | 'post' | 'put' | 'delete' | 'options';\n\nexport interface WooCommerceRestApiOptions {\n /* Your Store URL, example: http://woo.dev/ */\n url: string;\n /* Your API consumer key */\n consumerKey: string;\n /* Your API consumer secret */\n consumerSecret: string;\n /* Custom WP REST API URL prefix, used to support custom prefixes created with the `rest_url_prefix filter` */\n wpAPIPrefix?: string;\n /* API version, default is `v3` */\n version?: WooCommerceRestApiVersion;\n /* Encoding, default is 'utf-8' */\n encoding?: WooCommerceRestApiEncoding;\n /* When `true` and using under HTTPS force Basic Authentication as query string, default is `false` */\n queryStringAuth?: boolean;\n /* Provide support for URLs with ports, eg: `8080` */\n port?: number;\n /* Define the request timeout */\n timeout?: number;\n /* Define the custom Axios config, also override this library options */\n axiosConfig?: any;\n}\n\nexport interface WooCommerceRestApiQuery {\n [key: string]: string;\n}\n\n/**\n * WooCommerce REST API wrapper\n */\nexport default class WooCommerceRestApi {\n classVersion: string;\n url: string;\n consumerKey: string;\n consumerSecret: string;\n wpAPIPrefix: string;\n version: WooCommerceRestApiVersion;\n encoding: WooCommerceRestApiEncoding;\n queryStringAuth: boolean;\n port: number;\n timeout: number;\n axiosConfig: any;\n\n /**\n * Class constructor.\n */\n constructor(opt: WooCommerceRestApiOptions | WooCommerceRestApi);\n\n /**\n * Set default options\n */\n _setDefaultsOptions(opt: WooCommerceRestApiOptions): void;\n\n /**\n * Parse params object.\n */\n _parseParamsObject(params: any, query: any): WooCommerceRestApiQuery;\n\n /**\n * Normalize query string for oAuth\n */\n _normalizeQueryString(url: string, params: any): string;\n\n /**\n * Get URL\n */\n _getUrl(endpoint: string, params: any): string;\n\n /**\n * Get OAuth\n */\n _getOAuth(): any;\n\n /**\n * Do requests\n */\n _request(method: WooCommerceRestApiMethod, endpoint: string, data: any, params: any): Promise<any>;\n\n /**\n * GET requests\n */\n get(endpoint: string, params?: any): Promise<any>;\n\n /**\n * POST requests\n */\n post(endpoint: string, data: any, params?: any): Promise<any>;\n\n /**\n * PUT requests\n */\n put(endpoint: string, data: any, params?: any): Promise<any>;\n\n /**\n * DELETE requests\n */\n delete(endpoint: string, params?: any): Promise<any>;\n\n /**\n * OPTIONS requests\n */\n options(endpoint: string, params?: any): Promise<any>;\n}\n\n/**\n * Options Exception.\n */\nexport class OptionsException {\n name: 'Options Error';\n message: string;\n\n /**\n * Constructor.\n */\n constructor(message: string);\n}\n"
}

0 comments on commit ac82aec

Please sign in to comment.