-
Notifications
You must be signed in to change notification settings - Fork 3k
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
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] |
@@ -65,7 +65,7 @@ function checkIssueForCompletedChecklist(numberOfChecklistItems) { | |||
console.log(`Comment ${i} starts with: ${comment.slice(0, 20)}...`); | |||
|
|||
// 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree that it seems over-engineered. I will go forward and merge it.
P.S. i don't think this PR needs a C+ |
@@ -4,7 +4,7 @@ const https = require('https'); | |||
const GitHubUtils = require('../../../libs/GithubUtils'); | |||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
|
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.
Looks good, feel free to self-merge.
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.
Looks good.
✋ 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
indexOf
instead 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 Checklist
as 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 Checklist
in 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 Checklist
in a PR that is under review in AppVerify that no errors appear in the JS console
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
filesWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)