Skip to content

Commit 8ba409a

Browse files
committed
Merge branch 'main' of github.com:Expensify/Expensify.cash into fix-link-native
2 parents d42b51b + a24839f commit 8ba409a

File tree

145 files changed

+48220
-28356
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

145 files changed

+48220
-28356
lines changed

.github/actions/javascript/awaitStagingDeploys/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ inputs:
88
description: If provided, this action will only wait for a deploy matching this tag.
99
required: false
1010
runs:
11-
using: 'node12'
11+
using: 'node16'
1212
main: './index.js'

.github/actions/javascript/bumpVersion/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ outputs:
1111
NEW_VERSION:
1212
description: The new semver version of the application, updated in the JS and native layers.
1313
runs:
14-
using: 'node12'
14+
using: 'node16'
1515
main: './index.js'

.github/actions/javascript/checkBundleVersionStringMatch/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ outputs:
44
BUNDLE_VERSIONS_MATCH:
55
description: Whether or not the bundle versions match
66
runs:
7-
using: 'node12'
7+
using: 'node16'
88
main: './index.js'

.github/actions/javascript/checkDeployBlockers/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ outputs:
1111
HAS_DEPLOY_BLOCKERS:
1212
description: A true/false indicating whether or not a deploy blocker was found.
1313
runs:
14-
using: 'node12'
14+
using: 'node16'
1515
main: 'index.js'
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: 'Contributor Checklist Test'
2+
description: 'Verifies that both PR checklists are filled out'
3+
inputs:
4+
GITHUB_TOKEN:
5+
description: Auth token for New Expensify Github
6+
required: true
7+
runs:
8+
using: 'node16'
9+
main: './index.js'
Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
const core = require('@actions/core');
2+
const github = require('@actions/github');
3+
const GitHubUtils = require('../../../libs/GithubUtils');
4+
5+
/* eslint-disable max-len */
6+
const completedContributorChecklist = `- [x] I linked the correct issue in the \`### Fixed Issues\` section above
7+
- [x] I wrote clear testing steps that cover the changes made in this PR
8+
- [x] I added steps for local testing in the \`Tests\` section
9+
- [x] I added steps for Staging and/or Production testing in the \`QA steps\` section
10+
- [x] I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
11+
- [x] I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
12+
- [x] I included screenshots or videos for tests on [all platforms](https://github.com/Expensify/App/blob/main/contributingGuides/CONTRIBUTING.md#make-sure-you-can-test-on-all-platforms)
13+
- [x] I ran the tests on **all platforms** & verified they passed on:
14+
- [x] iOS / native
15+
- [x] Android / native
16+
- [x] iOS / Safari
17+
- [x] Android / Chrome
18+
- [x] MacOS / Chrome
19+
- [x] MacOS / Desktop
20+
- [x] I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
21+
- [x] I followed proper code patterns (see [Reviewing the code](https://github.com/Expensify/App/blob/main/contributingGuides/PR_REVIEW_GUIDELINES.md#reviewing-the-code))
22+
- [x] I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. \`toggleReport\` and not \`onIconClick\`)
23+
- [x] I verified that comments were added to code that is not self explanatory
24+
- [x] I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
25+
- [x] I verified any copy / text shown in the product was added in all \`src/languages/*\` files
26+
- [x] I verified any copy / text that was added to the app is correct English and approved by marketing by tagging the marketing team on the original GH to get the correct copy.
27+
- [x] I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
28+
- [x] I verified the JSDocs style guidelines (in [\`STYLE.md\`](https://github.com/Expensify/App/blob/main/contributingGuides/STYLE.md#jsdocs)) were followed
29+
- [x] If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
30+
- [x] I followed the guidelines as stated in the [Review Guidelines](https://github.com/Expensify/App/blob/main/contributingGuides/PR_REVIEW_GUIDELINES.md)
31+
- [x] I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like \`Avatar\`, I verified the components using \`Avatar\` are working as expected)
32+
- [x] I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
33+
- [x] I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
34+
- [x] If a new component is created I verified that:
35+
- [x] A similar component doesn't exist in the codebase
36+
- [x] All props are defined accurately and each prop has a \`/** comment above it */\`
37+
- [x] Any functional components have the \`displayName\` property
38+
- [x] The file is named correctly
39+
- [x] The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
40+
- [x] The only data being stored in the state is data necessary for rendering and nothing else
41+
- [x] For Class Components, any internal methods passed to components event handlers are bound to \`this\` properly so there are no scoping issues (i.e. for \`onClick={this.submit}\` the method \`this.submit\` should be bound to \`this\` in the constructor)
42+
- [x] Any internal methods bound to \`this\` are necessary to be bound (i.e. avoid \`this.submit = this.submit.bind(this);\` if \`this.submit\` is never passed to a component event handler like \`onClick\`)
43+
- [x] All JSX used for rendering exists in the render method
44+
- [x] The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
45+
- [x] If a new CSS style is added I verified that:
46+
- [x] A similar style doesn't already exist
47+
- [x] The style can't be created with an existing [StyleUtils](https://github.com/Expensify/App/blob/main/src/styles/StyleUtils.js) function (i.e. \`StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG\`)
48+
- [x] If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like \`Avatar\` is modified, I verified that \`Avatar\` is working as expected in all cases)
49+
- [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.
50+
- [x] I have checked off every checkbox in the PR author checklist, including those that don't apply to this PR.`;
51+
52+
const completedContributorPlusChecklist = `- [x] I have verified the author checklist is complete (all boxes are checked off).
53+
- [x] I verified the correct issue is linked in the \`### Fixed Issues\` section above
54+
- [x] I verified testing steps are clear and they cover the changes made in this PR
55+
- [x] I verified the steps for local testing are in the \`Tests\` section
56+
- [x] I verified the steps for Staging and/or Production testing are in the \`QA steps\` section
57+
- [x] I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
58+
- [x] I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
59+
- [x] I checked that screenshots or videos are included for tests on [all platforms](https://github.com/Expensify/App/blob/main/contributingGuides/CONTRIBUTING.md#make-sure-you-can-test-on-all-platforms)
60+
- [x] I verified tests pass on **all platforms** & I tested again on:
61+
- [x] iOS / native
62+
- [x] Android / native
63+
- [x] iOS / Safari
64+
- [x] Android / Chrome
65+
- [x] MacOS / Chrome
66+
- [x] MacOS / Desktop
67+
- [x] I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
68+
- [x] I verified proper code patterns were followed (see [Reviewing the code](https://github.com/Expensify/App/blob/main/contributingGuides/PR_REVIEW_GUIDELINES.md#reviewing-the-code))
69+
- [x] I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. \`toggleReport\` and not \`onIconClick\`).
70+
- [x] I verified that comments were added to code that is not self explanatory
71+
- [x] I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
72+
- [x] I verified any copy / text shown in the product was added in all \`src/languages/*\` files
73+
- [x] I verified any copy / text that was added to the app is correct English and approved by marketing by tagging the marketing team on the original GH to get the correct copy.
74+
- [x] I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
75+
- [x] I verified the JSDocs style guidelines (in [\`STYLE.md\`](https://github.com/Expensify/App/blob/main/contributingGuides/STYLE.md#jsdocs)) were followed
76+
- [x] If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
77+
- [x] I verified that this PR follows the guidelines as stated in the [Review Guidelines](https://github.com/Expensify/App/blob/main/contributingGuides/PR_REVIEW_GUIDELINES.md)
78+
- [x] I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like \`Avatar\`, I verified the components using \`Avatar\` have been tested & I retested again)
79+
- [x] I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
80+
- [x] I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
81+
- [x] If a new component is created I verified that:
82+
- [x] A similar component doesn't exist in the codebase
83+
- [x] All props are defined accurately and each prop has a \`/** comment above it */\`
84+
- [x] Any functional components have the \`displayName\` property
85+
- [x] The file is named correctly
86+
- [x] The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
87+
- [x] The only data being stored in the state is data necessary for rendering and nothing else
88+
- [x] For Class Components, any internal methods passed to components event handlers are bound to \`this\` properly so there are no scoping issues (i.e. for \`onClick={this.submit}\` the method \`this.submit\` should be bound to \`this\` in the constructor)
89+
- [x] Any internal methods bound to \`this\` are necessary to be bound (i.e. avoid \`this.submit = this.submit.bind(this);\` if \`this.submit\` is never passed to a component event handler like \`onClick\`)
90+
- [x] All JSX used for rendering exists in the render method
91+
- [x] The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
92+
- [x] If a new CSS style is added I verified that:
93+
- [x] A similar style doesn't already exist
94+
- [x] The style can't be created with an existing [StyleUtils](https://github.com/Expensify/App/blob/main/src/styles/StyleUtils.js) function (i.e. \`StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG\`)
95+
- [x] If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like \`Avatar\` is modified, I verified that \`Avatar\` is working as expected in all cases)
96+
- [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.
97+
- [x] I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.`;
98+
99+
const issue = github.context.payload.issue ? github.context.payload.issue.number : github.context.payload.pull_request.number;
100+
const combinedData = [];
101+
102+
function printUncheckedItems(result) {
103+
const checklist = result.split('\n');
104+
105+
checklist.forEach((line) => {
106+
// Provide a search string with the first 30 characters to figure out if the checkbox item is in the checklist
107+
const lineSearchString = line.replace('- [ ] ', '').slice(0, 30);
108+
if (line.includes('- [ ]') && (completedContributorChecklist.includes(lineSearchString) || completedContributorPlusChecklist.includes(lineSearchString))) {
109+
console.log(`Unchecked checklist item: ${line}`);
110+
}
111+
});
112+
}
113+
114+
// Get all user text from the pull request, review comments, and pull request comments
115+
GitHubUtils.octokit.pulls.get({
116+
owner: GitHubUtils.GITHUB_OWNER,
117+
repo: GitHubUtils.APP_REPO,
118+
pull_number: issue,
119+
}).then(({data: pullRequestComment}) => {
120+
combinedData.push(pullRequestComment.body);
121+
}).then(() => GitHubUtils.octokit.pulls.listReviews({
122+
owner: GitHubUtils.GITHUB_OWNER,
123+
repo: GitHubUtils.APP_REPO,
124+
pull_number: issue,
125+
})).then(({data: pullRequestReviewComments}) => {
126+
pullRequestReviewComments.forEach(pullRequestReviewComment => combinedData.push(pullRequestReviewComment.body));
127+
})
128+
.then(() => GitHubUtils.octokit.issues.listComments({
129+
owner: GitHubUtils.GITHUB_OWNER,
130+
repo: GitHubUtils.APP_REPO,
131+
issue_number: issue,
132+
per_page: 100,
133+
}))
134+
.then(({data: pullRequestComments}) => {
135+
pullRequestComments.forEach(pullRequestComment => combinedData.push(pullRequestComment.body));
136+
let contributorChecklistComplete = false;
137+
let contributorPlusChecklistComplete = false;
138+
139+
// Once we've gathered all the data, loop through each comment and look to see if it contains a completed checklist
140+
for (let i = 0; i < combinedData.length; i++) {
141+
const whitespace = /([\n\r])/gm;
142+
const comment = combinedData[i].replace(whitespace, '');
143+
144+
if (comment.includes(completedContributorChecklist.replace(whitespace, ''))) {
145+
contributorChecklistComplete = true;
146+
} else if (comment.includes('- [')) {
147+
printUncheckedItems(combinedData[i]);
148+
}
149+
150+
if (comment.includes(completedContributorPlusChecklist.replace(whitespace, ''))) {
151+
contributorPlusChecklistComplete = true;
152+
} else if (comment.includes('- [')) {
153+
printUncheckedItems(combinedData[i]);
154+
}
155+
}
156+
157+
if (!contributorChecklistComplete) {
158+
core.setFailed('Contributor checklist is not completely filled out. Please check every box to verify you\'ve thought about the item.');
159+
return;
160+
}
161+
162+
if (!contributorPlusChecklistComplete) {
163+
core.setFailed('Contributor plus checklist is not completely filled out. Please check every box to verify you\'ve thought about the item.');
164+
return;
165+
}
166+
167+
console.log('All checklists are complete 🎉');
168+
});

0 commit comments

Comments
 (0)