Repository navigation
Relax check for reviewer checklist - #13247
Conversation
|
cc @tgolen |
|
@rushatgabhane @techievivek One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
|
||
| // Found the reviewer checklist, so count how many completed checklist items there are | ||
| if (comment.startsWith(reviewerChecklistStartsWith)) { | ||
| if (comment.indexOf(reviewerChecklistContains) !== -1) { |
There was a problem hiding this comment.
NAB:
| if (comment.indexOf(reviewerChecklistContains) !== -1) { | |
| if (comment.toLowerCase().includes(reviewerChecklistContains)) { |
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes
There was a problem hiding this comment.
Something like this
const reviewerChecklistPattern = /#{0,6}\s?reviewer checklist\n/gi;and then
if (reviewerChecklistPattern.test(comment)) {
// code
}But then this is not a blocker.
There was a problem hiding this comment.
Hmm, I believe this /#{0,6}\s?reviewer checklist\n/gi; allows even no #, right? I'm a bit concerned about relaxing the check too much and finding the wrong comment. I also think the regex may be overkill for something so simple.
There was a problem hiding this comment.
Agree that it seems over-engineered. I will go forward and merge it.
|
P.S. i don't think this PR needs a C+ |
|
|
||
| const pathToReviewerChecklist = 'https://raw.githubusercontent.com/Expensify/App/main/contributingGuides/REVIEWER_CHECKLIST.md'; | ||
| const reviewerChecklistStartsWith = '## Reviewer Checklist'; | ||
| const reviewerChecklistContains = '## Reviewer Checklist'; |
There was a problem hiding this comment.
To handle the case when a reviewer uses ### instead of ##
| const reviewerChecklistContains = '## Reviewer Checklist'; | |
| const reviewerChecklistContains = 'Reviewer Checklist'; |
There was a problem hiding this comment.
My suggestion here would be to use regex. Because it can come in any form so let's create a pattern and test it.
There was a problem hiding this comment.
The current code change would fine ### Reviewer Checklist just fine, but it wouldn't find # Reviewer Checklist. For now I'll leave as it is, and if we find cases of a reviewer changing the type of heading to a single #, then we can make that change.
Reviewer Checklist
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
@aldo-expensify Can you QA this internally? |
I think this has to be QA'd when it reaches production, once that happens, I can take care of it |
|
There is no staging or production environment for the GH actions, so this can be QAed as soon as it was merged. |
|
QAing now then! |
|
QA passed: #13442 (comment) |
|
🚀 Deployed to production by @chiragsalian in version: 1.2.38-6 🚀
|

Details
Use
indexOfinstead ofstartsWith. It is common for reviewers to add something at the start of the comment that made this check fail.It is unlikely that we will find
## Reviewer Checklistas part of a comment that is not the real reviewer checklist.Fixed Issues
$ #13244
Tests
Add a reviewer checklist typing something of top of the comment before the title
## Reviewer Checklistin this PRVerify that no errors appear in the JS console
QA Steps
Add a reviewer checklist typing something of top of the comment before the title
## Reviewer Checklistin a PR that is under review in AppVerify that no errors appear in the JS console
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*filesWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)Avataris modified, I verified thatAvataris working as expected in all cases)