From 2141c8261cea89ec01b7dab06d2e87f76226b45a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Ch=C3=A1vez?= Date: Mon, 3 Oct 2022 13:00:23 -0500 Subject: [PATCH 1/7] rename contributor to reviewer --- .github/PULL_REQUEST_TEMPLATE.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 8d0dc882bb59..e085ab4dae57 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -35,7 +35,7 @@ For example: -#### Contributor (PR Author) Checklist +#### PR Author Checklist - [ ] I linked the correct issue in the `### Fixed Issues` section above - [ ] I wrote clear testing steps that cover the changes made in this PR - [ ] I added steps for local testing in the `Tests` section @@ -85,7 +85,7 @@ This is a checklist for PR authors & reviewers. Please make sure to complete all

PR Reviewer Checklist

-The Contributor+ will copy/paste it into a new comment and complete it after the author checklist is completed +The reviewer will copy/paste it into a new comment and complete it after the author checklist is completed
- [ ] I have verified the author checklist is complete (all boxes are checked off). From 6178bd68f8062b6f960345e3536cb9e47c332789 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Ch=C3=A1vez?= Date: Mon, 3 Oct 2022 13:00:49 -0500 Subject: [PATCH 2/7] rename workflow names --- .github/workflows/contributorChecklists.yml | 2 +- .github/workflows/contributorPlusChecklists.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/contributorChecklists.yml b/.github/workflows/contributorChecklists.yml index 338ec6ba1e55..632fd5355d92 100644 --- a/.github/workflows/contributorChecklists.yml +++ b/.github/workflows/contributorChecklists.yml @@ -1,4 +1,4 @@ -name: Contributor Checklist +name: PR Author Checklist on: pull_request diff --git a/.github/workflows/contributorPlusChecklists.yml b/.github/workflows/contributorPlusChecklists.yml index 76dda02da067..05b30e2622db 100644 --- a/.github/workflows/contributorPlusChecklists.yml +++ b/.github/workflows/contributorPlusChecklists.yml @@ -1,4 +1,4 @@ -name: Contributor+ Checklist +name: PR Reviewer Checklist on: pull_request_review From 2af39624988e94093274733aa9e8b43459aa6b53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Ch=C3=A1vez?= Date: Mon, 3 Oct 2022 13:08:45 -0500 Subject: [PATCH 3/7] rename variables to use author and reviewer words --- .../contributorChecklist.js | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/actions/javascript/contributorChecklist/contributorChecklist.js b/.github/actions/javascript/contributorChecklist/contributorChecklist.js index 552e1c374071..e5c5f205b1a8 100644 --- a/.github/actions/javascript/contributorChecklist/contributorChecklist.js +++ b/.github/actions/javascript/contributorChecklist/contributorChecklist.js @@ -4,7 +4,7 @@ const _ = require('underscore'); const GitHubUtils = require('../../../libs/GithubUtils'); /* eslint-disable max-len */ -const completedContributorChecklist = `- [x] I linked the correct issue in the \`### Fixed Issues\` section above +const completedAuthorChecklist = `- [x] I linked the correct issue in the \`### Fixed Issues\` section above - [x] I wrote clear testing steps that cover the changes made in this PR - [x] I added steps for local testing in the \`Tests\` section - [x] I added steps for Staging and/or Production testing in the \`QA steps\` section @@ -50,7 +50,7 @@ const completedContributorChecklist = `- [x] I linked the correct issue in the \ - [x] If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected. - [x] I have checked off every checkbox in the PR author checklist, including those that don't apply to this PR.`; -const completedContributorPlusChecklist = `- [x] I have verified the author checklist is complete (all boxes are checked off). +const completedReviewerChecklist = `- [x] I have verified the author checklist is complete (all boxes are checked off). - [x] I verified the correct issue is linked in the \`### Fixed Issues\` section above - [x] I verified testing steps are clear and they cover the changes made in this PR - [x] I verified the steps for local testing are in the \`Tests\` section @@ -98,7 +98,7 @@ const completedContributorPlusChecklist = `- [x] I have verified the author chec - [x] I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.`; // True if we are validating a contributor checklist, otherwise we are validating a contributor+ checklist -const verifyingContributorChecklist = core.getInput('CHECKLIST', {required: true}) === 'contributor'; +const verifyingAuthorChecklist = core.getInput('CHECKLIST', {required: true}) === 'contributor'; const issue = github.context.payload.issue ? github.context.payload.issue.number : github.context.payload.pull_request.number; const combinedData = []; @@ -135,34 +135,34 @@ getPullRequestBody() .then(() => getAllComments()) .then(comments => combinedData.push(...comments)) .then(() => { - let contributorChecklistComplete = false; - let contributorPlusChecklistComplete = false; + let authorChecklistComplete = false; + let reviewerChecklistComplete = false; // Once we've gathered all the data, loop through each comment and look to see if it contains a completed checklist for (let i = 0; i < combinedData.length; i++) { const whitespace = /([\n\r])/gm; const comment = combinedData[i].replace(whitespace, ''); - if (comment.includes(completedContributorChecklist.replace(whitespace, ''))) { - contributorChecklistComplete = true; + if (comment.includes(completedAuthorChecklist.replace(whitespace, ''))) { + authorChecklistComplete = true; } - if (comment.includes(completedContributorPlusChecklist.replace(whitespace, ''))) { - contributorPlusChecklistComplete = true; + if (comment.includes(completedReviewerChecklist.replace(whitespace, ''))) { + reviewerChecklistComplete = true; } } - if (verifyingContributorChecklist && !contributorChecklistComplete) { + if (verifyingAuthorChecklist && !authorChecklistComplete) { console.log('Make sure you are using the most up to date checklist found here: https://raw.githubusercontent.com/Expensify/App/main/.github/PULL_REQUEST_TEMPLATE.md'); core.setFailed('Contributor checklist is not completely filled out. Please check every box to verify you\'ve thought about the item.'); return; } - if (!verifyingContributorChecklist && !contributorPlusChecklistComplete) { + if (!verifyingAuthorChecklist && !reviewerChecklistComplete) { console.log('Make sure you are using the most up to date checklist found here: https://raw.githubusercontent.com/Expensify/App/main/.github/PULL_REQUEST_TEMPLATE.md'); core.setFailed('Contributor+ checklist is not completely filled out. Please check every box to verify you\'ve thought about the item.'); return; } - console.log(`${verifyingContributorChecklist ? 'Contributor' : 'Contributor+'} checklist is complete 🎉`); + console.log(`${verifyingAuthorChecklist ? 'Contributor' : 'Contributor+'} checklist is complete 🎉`); }); From a51fd2d5c326f1d6792ebbecc6f4c750aab3f24a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Ch=C3=A1vez?= Date: Mon, 3 Oct 2022 13:11:03 -0500 Subject: [PATCH 4/7] change success and failed messages --- .../javascript/contributorChecklist/contributorChecklist.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/javascript/contributorChecklist/contributorChecklist.js b/.github/actions/javascript/contributorChecklist/contributorChecklist.js index e5c5f205b1a8..33def701b3f7 100644 --- a/.github/actions/javascript/contributorChecklist/contributorChecklist.js +++ b/.github/actions/javascript/contributorChecklist/contributorChecklist.js @@ -154,15 +154,15 @@ getPullRequestBody() if (verifyingAuthorChecklist && !authorChecklistComplete) { console.log('Make sure you are using the most up to date checklist found here: https://raw.githubusercontent.com/Expensify/App/main/.github/PULL_REQUEST_TEMPLATE.md'); - core.setFailed('Contributor checklist is not completely filled out. Please check every box to verify you\'ve thought about the item.'); + core.setFailed('PR Author Checklist is not completely filled out. Please check every box to verify you\'ve thought about the item.'); return; } if (!verifyingAuthorChecklist && !reviewerChecklistComplete) { console.log('Make sure you are using the most up to date checklist found here: https://raw.githubusercontent.com/Expensify/App/main/.github/PULL_REQUEST_TEMPLATE.md'); - core.setFailed('Contributor+ checklist is not completely filled out. Please check every box to verify you\'ve thought about the item.'); + core.setFailed('PR Reviewer Checklist is not completely filled out. Please check every box to verify you\'ve thought about the item.'); return; } - console.log(`${verifyingAuthorChecklist ? 'Contributor' : 'Contributor+'} checklist is complete 🎉`); + console.log(`${verifyingAuthorChecklist ? 'PR Author' : 'PR Reviewer'} checklist is complete 🎉`); }); From d32e5f5b03392ddbccbca30ef4406e8e6b3b30a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Ch=C3=A1vez?= Date: Mon, 3 Oct 2022 13:13:09 -0500 Subject: [PATCH 5/7] change variable value --- .../javascript/contributorChecklist/contributorChecklist.js | 4 ++-- .github/workflows/contributorChecklists.yml | 2 +- .github/workflows/contributorPlusChecklists.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/actions/javascript/contributorChecklist/contributorChecklist.js b/.github/actions/javascript/contributorChecklist/contributorChecklist.js index 33def701b3f7..afadd774e3b5 100644 --- a/.github/actions/javascript/contributorChecklist/contributorChecklist.js +++ b/.github/actions/javascript/contributorChecklist/contributorChecklist.js @@ -97,8 +97,8 @@ const completedReviewerChecklist = `- [x] I have verified the author checklist i - [x] If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected. - [x] I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.`; -// True if we are validating a contributor checklist, otherwise we are validating a contributor+ checklist -const verifyingAuthorChecklist = core.getInput('CHECKLIST', {required: true}) === 'contributor'; +// True if we are validating an author checklist, otherwise we are validating a reviewer checklist +const verifyingAuthorChecklist = core.getInput('CHECKLIST', {required: true}) === 'author'; const issue = github.context.payload.issue ? github.context.payload.issue.number : github.context.payload.pull_request.number; const combinedData = []; diff --git a/.github/workflows/contributorChecklists.yml b/.github/workflows/contributorChecklists.yml index 632fd5355d92..2acc3e8e427c 100644 --- a/.github/workflows/contributorChecklists.yml +++ b/.github/workflows/contributorChecklists.yml @@ -11,4 +11,4 @@ jobs: uses: Expensify/App/.github/actions/javascript/contributorChecklist@main with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CHECKLIST: 'contributor' + CHECKLIST: 'author' diff --git a/.github/workflows/contributorPlusChecklists.yml b/.github/workflows/contributorPlusChecklists.yml index 05b30e2622db..46dc8ae5a733 100644 --- a/.github/workflows/contributorPlusChecklists.yml +++ b/.github/workflows/contributorPlusChecklists.yml @@ -11,4 +11,4 @@ jobs: uses: Expensify/App/.github/actions/javascript/contributorChecklist@main with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CHECKLIST: 'contributorPlus' + CHECKLIST: 'reviewer' From 0cc64e23f8821ae8f80ecaf05bf2a9fd9ee20046 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Ch=C3=A1vez?= Date: Mon, 3 Oct 2022 13:36:06 -0500 Subject: [PATCH 6/7] rebuilt new gh action --- .../javascript/contributorChecklist/index.js | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/actions/javascript/contributorChecklist/index.js b/.github/actions/javascript/contributorChecklist/index.js index 28a984ad8987..ab3a5dadb266 100644 --- a/.github/actions/javascript/contributorChecklist/index.js +++ b/.github/actions/javascript/contributorChecklist/index.js @@ -14,7 +14,7 @@ const _ = __nccwpck_require__(3571); const GitHubUtils = __nccwpck_require__(7999); /* eslint-disable max-len */ -const completedContributorChecklist = `- [x] I linked the correct issue in the \`### Fixed Issues\` section above +const completedAuthorChecklist = `- [x] I linked the correct issue in the \`### Fixed Issues\` section above - [x] I wrote clear testing steps that cover the changes made in this PR - [x] I added steps for local testing in the \`Tests\` section - [x] I added steps for Staging and/or Production testing in the \`QA steps\` section @@ -60,7 +60,7 @@ const completedContributorChecklist = `- [x] I linked the correct issue in the \ - [x] If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected. - [x] I have checked off every checkbox in the PR author checklist, including those that don't apply to this PR.`; -const completedContributorPlusChecklist = `- [x] I have verified the author checklist is complete (all boxes are checked off). +const completedReviewerChecklist = `- [x] I have verified the author checklist is complete (all boxes are checked off). - [x] I verified the correct issue is linked in the \`### Fixed Issues\` section above - [x] I verified testing steps are clear and they cover the changes made in this PR - [x] I verified the steps for local testing are in the \`Tests\` section @@ -107,8 +107,8 @@ const completedContributorPlusChecklist = `- [x] I have verified the author chec - [x] If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected. - [x] I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.`; -// True if we are validating a contributor checklist, otherwise we are validating a contributor+ checklist -const verifyingContributorChecklist = core.getInput('CHECKLIST', {required: true}) === 'contributor'; +// True if we are validating an author checklist, otherwise we are validating a reviewer checklist +const verifyingAuthorChecklist = core.getInput('CHECKLIST', {required: true}) === 'author'; const issue = github.context.payload.issue ? github.context.payload.issue.number : github.context.payload.pull_request.number; const combinedData = []; @@ -145,36 +145,36 @@ getPullRequestBody() .then(() => getAllComments()) .then(comments => combinedData.push(...comments)) .then(() => { - let contributorChecklistComplete = false; - let contributorPlusChecklistComplete = false; + let authorChecklistComplete = false; + let reviewerChecklistComplete = false; // Once we've gathered all the data, loop through each comment and look to see if it contains a completed checklist for (let i = 0; i < combinedData.length; i++) { const whitespace = /([\n\r])/gm; const comment = combinedData[i].replace(whitespace, ''); - if (comment.includes(completedContributorChecklist.replace(whitespace, ''))) { - contributorChecklistComplete = true; + if (comment.includes(completedAuthorChecklist.replace(whitespace, ''))) { + authorChecklistComplete = true; } - if (comment.includes(completedContributorPlusChecklist.replace(whitespace, ''))) { - contributorPlusChecklistComplete = true; + if (comment.includes(completedReviewerChecklist.replace(whitespace, ''))) { + reviewerChecklistComplete = true; } } - if (verifyingContributorChecklist && !contributorChecklistComplete) { + if (verifyingAuthorChecklist && !authorChecklistComplete) { console.log('Make sure you are using the most up to date checklist found here: https://raw.githubusercontent.com/Expensify/App/main/.github/PULL_REQUEST_TEMPLATE.md'); - core.setFailed('Contributor checklist is not completely filled out. Please check every box to verify you\'ve thought about the item.'); + core.setFailed('PR Author Checklist is not completely filled out. Please check every box to verify you\'ve thought about the item.'); return; } - if (!verifyingContributorChecklist && !contributorPlusChecklistComplete) { + if (!verifyingAuthorChecklist && !reviewerChecklistComplete) { console.log('Make sure you are using the most up to date checklist found here: https://raw.githubusercontent.com/Expensify/App/main/.github/PULL_REQUEST_TEMPLATE.md'); - core.setFailed('Contributor+ checklist is not completely filled out. Please check every box to verify you\'ve thought about the item.'); + core.setFailed('PR Reviewer Checklist is not completely filled out. Please check every box to verify you\'ve thought about the item.'); return; } - console.log(`${verifyingContributorChecklist ? 'Contributor' : 'Contributor+'} checklist is complete 🎉`); + console.log(`${verifyingAuthorChecklist ? 'PR Author' : 'PR Reviewer'} checklist is complete 🎉`); }); From 8f92b3addb8e3a8b8521128b6acc47a8ba69192d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Ch=C3=A1vez?= Date: Mon, 3 Oct 2022 13:42:31 -0500 Subject: [PATCH 7/7] re-use old CHECKLIST value --- .../javascript/contributorChecklist/contributorChecklist.js | 2 +- .github/actions/javascript/contributorChecklist/index.js | 2 +- .github/workflows/contributorChecklists.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/javascript/contributorChecklist/contributorChecklist.js b/.github/actions/javascript/contributorChecklist/contributorChecklist.js index afadd774e3b5..9093e3d3197d 100644 --- a/.github/actions/javascript/contributorChecklist/contributorChecklist.js +++ b/.github/actions/javascript/contributorChecklist/contributorChecklist.js @@ -98,7 +98,7 @@ const completedReviewerChecklist = `- [x] I have verified the author checklist i - [x] I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.`; // True if we are validating an author checklist, otherwise we are validating a reviewer checklist -const verifyingAuthorChecklist = core.getInput('CHECKLIST', {required: true}) === 'author'; +const verifyingAuthorChecklist = core.getInput('CHECKLIST', {required: true}) === 'contributor'; const issue = github.context.payload.issue ? github.context.payload.issue.number : github.context.payload.pull_request.number; const combinedData = []; diff --git a/.github/actions/javascript/contributorChecklist/index.js b/.github/actions/javascript/contributorChecklist/index.js index ab3a5dadb266..e55b85a2df97 100644 --- a/.github/actions/javascript/contributorChecklist/index.js +++ b/.github/actions/javascript/contributorChecklist/index.js @@ -108,7 +108,7 @@ const completedReviewerChecklist = `- [x] I have verified the author checklist i - [x] I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.`; // True if we are validating an author checklist, otherwise we are validating a reviewer checklist -const verifyingAuthorChecklist = core.getInput('CHECKLIST', {required: true}) === 'author'; +const verifyingAuthorChecklist = core.getInput('CHECKLIST', {required: true}) === 'contributor'; const issue = github.context.payload.issue ? github.context.payload.issue.number : github.context.payload.pull_request.number; const combinedData = []; diff --git a/.github/workflows/contributorChecklists.yml b/.github/workflows/contributorChecklists.yml index 2acc3e8e427c..632fd5355d92 100644 --- a/.github/workflows/contributorChecklists.yml +++ b/.github/workflows/contributorChecklists.yml @@ -11,4 +11,4 @@ jobs: uses: Expensify/App/.github/actions/javascript/contributorChecklist@main with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CHECKLIST: 'author' + CHECKLIST: 'contributor'