-
Notifications
You must be signed in to change notification settings - Fork 119
Fixing review state to APPROVED whe 'LGTM' in COMMENTED review #72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 8 commits
ed5b97e
4c15b16
0992b79
37cff9d
a053af6
0868d7a
f43df7e
b9b6608
42113f1
3e5c88a
f3f4afb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,12 @@ function buildYargs(args = null) { | |
describe: 'File to write the metadata in', | ||
type: 'string' | ||
}) | ||
.option('comments', { | ||
alias: 'c', | ||
demandOption: false, | ||
describe: 'Check for\'LGTM\' in comments', | ||
|
||
type: 'boolean' | ||
}) | ||
.help() | ||
.alias('help', 'h') | ||
.argv; | ||
|
@@ -47,8 +53,8 @@ const PR_RE = new RegExp( | |
'([0-9]+)(?:/(?:files)?)?$'); | ||
|
||
function checkAndParseArgs(args) { | ||
const { owner = 'nodejs', repo = 'node', identifier, file } = args; | ||
const result = { owner, repo, file }; | ||
const { owner = 'nodejs', repo = 'node', identifier, file, comments } = args; | ||
const result = { owner, repo, file, comments }; | ||
if (!isNaN(identifier)) { | ||
result.prid = +identifier; | ||
} else { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -252,6 +252,8 @@ For more information about the governance of the Node.js project, see | |
**Foo User** <[email protected]> (she/her) | ||
* [Quo](https://github.com/quo) - | ||
**Quo User** <[email protected]> (she/her) | ||
* [Quux](https://github.com/quux) - | ||
**Quux User** <[email protected]> (he/him) | ||
|
||
### Collaborator Emeriti | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,5 +22,11 @@ | |
"name": "Quo User", | ||
"email": "[email protected]", | ||
"type": "COLLABORATOR" | ||
}, | ||
{ | ||
"login": "Quux", | ||
"name": "Quux User", | ||
"email": "[email protected]", | ||
"type": "COLLABORATOR" | ||
} | ||
] |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,20 @@ | |
"source": "review" | ||
} | ||
}, | ||
{ | ||
"reviewer": { | ||
"login": "Quux", | ||
"name": "Quux User", | ||
"email": "[email protected]", | ||
"type": "COLLABORATOR" | ||
}, | ||
"review": { | ||
"state": "APPROVED", | ||
"date": "2017-10-24T14:49:52Z", | ||
"ref": "LGTM", | ||
"source": "review_comment" | ||
} | ||
}, | ||
{ | ||
"reviewer": { | ||
"login": "Baz", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ const expected = `PR-URL: https://github.com/nodejs/node/pull/16438 | |
Fixes: https://github.com/nodejs/node/issues/16437 | ||
Refs: https://github.com/nodejs/node/pull/15148 | ||
Reviewed-By: Foo User <[email protected]> | ||
Reviewed-By: Quux User <[email protected]> | ||
Reviewed-By: Baz User <[email protected]> | ||
Reviewed-By: Bar User <[email protected]> | ||
`; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,12 +80,13 @@ describe('PRChecker', () => { | |
|
||
const expectedLogs = { | ||
warn: [ | ||
['Quux User(Quux)) approved in via LGTM in comments'], | ||
|
||
['Bar User(bar)) approved in via LGTM in comments'], | ||
['semver-major requires at least two TSC approvals'] | ||
], | ||
info: [ | ||
['Rejections: 0'], | ||
['Approvals: 3, 1 from TSC (bar)'], | ||
['Bar User(bar)) approved in via LGTM in comments'] | ||
['Approvals: 4, 1 from TSC (bar)'] | ||
], | ||
error: [], | ||
trace: [] | ||
|
@@ -100,7 +101,7 @@ describe('PRChecker', () => { | |
collaborators | ||
}); | ||
|
||
const status = checker.checkReviews(); | ||
const status = checker.checkReviews(true); | ||
assert(!status); | ||
assert.deepStrictEqual(logger.logs, expectedLogs); | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather let this be
--check-comments
with no aliases, in case we need thec
later. This does not seem to be very in demand.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your desires are my commands!