Skip to content

Commit

Permalink
Merge branch 'main' into arrow-feature-signed
Browse files Browse the repository at this point in the history
  • Loading branch information
JediWattson committed Sep 7, 2022
2 parents 59e461c + f95b761 commit 594ff07
Show file tree
Hide file tree
Showing 66 changed files with 973 additions and 547 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ The Contributor+ will copy/paste it into a new comment and complete it after the
- [ ] Android / Chrome
- [ ] MacOS / Chrome
- [ ] MacOS / Desktop
- [ ] 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)
- [ ] If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
- [ ] 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))
- [ ] 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`).
- [ ] I verified that comments were added to code that is not self explanatory
Expand Down
3 changes: 3 additions & 0 deletions .github/actions/javascript/contributorChecklist/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ inputs:
GITHUB_TOKEN:
description: Auth token for New Expensify Github
required: true
CHECKLIST:
description: The checklist to look for, either 'contributor' or 'contributorPlus'
required: true
runs:
using: 'node16'
main: './index.js'
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const core = require('@actions/core');
const github = require('@actions/github');
const _ = require('underscore');
const GitHubUtils = require('../../../libs/GithubUtils');

/* eslint-disable max-len */
Expand Down Expand Up @@ -96,43 +97,44 @@ 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';
const issue = github.context.payload.issue ? github.context.payload.issue.number : github.context.payload.pull_request.number;
const combinedData = [];

function printUncheckedItems(result) {
const checklist = result.split('\n');
function getPullRequestBody() {
return GitHubUtils.octokit.pulls.get({
owner: GitHubUtils.GITHUB_OWNER,
repo: GitHubUtils.APP_REPO,
pull_number: issue,
}).then(({data: pullRequestComment}) => pullRequestComment.body);
}

checklist.forEach((line) => {
// Provide a search string with the first 30 characters to figure out if the checkbox item is in the checklist
const lineSearchString = line.replace('- [ ] ', '').slice(0, 30);
if (line.includes('- [ ]') && (completedContributorChecklist.includes(lineSearchString) || completedContributorPlusChecklist.includes(lineSearchString))) {
console.log(`Unchecked checklist item: ${line}`);
}
});
function getAllReviewComments() {
return GitHubUtils.paginate(GitHubUtils.octokit.pulls.listReviews, {
owner: GitHubUtils.GITHUB_OWNER,
repo: GitHubUtils.APP_REPO,
pull_number: issue,
per_page: 100,
}, response => _.map(response.data, review => review.body));
}

// Get all user text from the pull request, review comments, and pull request comments
GitHubUtils.octokit.pulls.get({
owner: GitHubUtils.GITHUB_OWNER,
repo: GitHubUtils.APP_REPO,
pull_number: issue,
}).then(({data: pullRequestComment}) => {
combinedData.push(pullRequestComment.body);
}).then(() => GitHubUtils.octokit.pulls.listReviews({
owner: GitHubUtils.GITHUB_OWNER,
repo: GitHubUtils.APP_REPO,
pull_number: issue,
})).then(({data: pullRequestReviewComments}) => {
pullRequestReviewComments.forEach(pullRequestReviewComment => combinedData.push(pullRequestReviewComment.body));
})
.then(() => GitHubUtils.octokit.issues.listComments({
function getAllComments() {
return GitHubUtils.paginate(GitHubUtils.octokit.issues.listComments, {
owner: GitHubUtils.GITHUB_OWNER,
repo: GitHubUtils.APP_REPO,
issue_number: issue,
per_page: 100,
}))
.then(({data: pullRequestComments}) => {
pullRequestComments.forEach(pullRequestComment => combinedData.push(pullRequestComment.body));
}, response => _.map(response.data, comment => comment.body));
}

getPullRequestBody()
.then(pullRequestBody => combinedData.push(pullRequestBody))
.then(() => getAllReviewComments())
.then(reviewComments => combinedData.push(...reviewComments))
.then(() => getAllComments())
.then(comments => combinedData.push(...comments))
.then(() => {
let contributorChecklistComplete = false;
let contributorPlusChecklistComplete = false;

Expand All @@ -143,26 +145,24 @@ GitHubUtils.octokit.pulls.get({

if (comment.includes(completedContributorChecklist.replace(whitespace, ''))) {
contributorChecklistComplete = true;
} else if (comment.includes('- [')) {
printUncheckedItems(combinedData[i]);
}

if (comment.includes(completedContributorPlusChecklist.replace(whitespace, ''))) {
contributorPlusChecklistComplete = true;
} else if (comment.includes('- [')) {
printUncheckedItems(combinedData[i]);
}
}

if (!contributorChecklistComplete) {
if (verifyingContributorChecklist && !contributorChecklistComplete) {
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 (!contributorPlusChecklistComplete) {
core.setFailed('Contributor plus checklist is not completely filled out. Please check every box to verify you\'ve thought about the item.');
if (!verifyingContributorChecklist && !contributorPlusChecklistComplete) {
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('All checklists are complete 🎉');
console.log(`${verifyingContributorChecklist ? 'Contributor' : 'Contributor+'} checklist is complete 🎉`);
});
70 changes: 35 additions & 35 deletions .github/actions/javascript/contributorChecklist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module.exports =

const core = __nccwpck_require__(2186);
const github = __nccwpck_require__(5438);
const _ = __nccwpck_require__(3571);
const GitHubUtils = __nccwpck_require__(7999);

/* eslint-disable max-len */
Expand Down Expand Up @@ -106,43 +107,44 @@ 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';
const issue = github.context.payload.issue ? github.context.payload.issue.number : github.context.payload.pull_request.number;
const combinedData = [];

function printUncheckedItems(result) {
const checklist = result.split('\n');
function getPullRequestBody() {
return GitHubUtils.octokit.pulls.get({
owner: GitHubUtils.GITHUB_OWNER,
repo: GitHubUtils.APP_REPO,
pull_number: issue,
}).then(({data: pullRequestComment}) => pullRequestComment.body);
}

checklist.forEach((line) => {
// Provide a search string with the first 30 characters to figure out if the checkbox item is in the checklist
const lineSearchString = line.replace('- [ ] ', '').slice(0, 30);
if (line.includes('- [ ]') && (completedContributorChecklist.includes(lineSearchString) || completedContributorPlusChecklist.includes(lineSearchString))) {
console.log(`Unchecked checklist item: ${line}`);
}
});
function getAllReviewComments() {
return GitHubUtils.paginate(GitHubUtils.octokit.pulls.listReviews, {
owner: GitHubUtils.GITHUB_OWNER,
repo: GitHubUtils.APP_REPO,
pull_number: issue,
per_page: 100,
}, response => _.map(response.data, review => review.body));
}

// Get all user text from the pull request, review comments, and pull request comments
GitHubUtils.octokit.pulls.get({
owner: GitHubUtils.GITHUB_OWNER,
repo: GitHubUtils.APP_REPO,
pull_number: issue,
}).then(({data: pullRequestComment}) => {
combinedData.push(pullRequestComment.body);
}).then(() => GitHubUtils.octokit.pulls.listReviews({
owner: GitHubUtils.GITHUB_OWNER,
repo: GitHubUtils.APP_REPO,
pull_number: issue,
})).then(({data: pullRequestReviewComments}) => {
pullRequestReviewComments.forEach(pullRequestReviewComment => combinedData.push(pullRequestReviewComment.body));
})
.then(() => GitHubUtils.octokit.issues.listComments({
function getAllComments() {
return GitHubUtils.paginate(GitHubUtils.octokit.issues.listComments, {
owner: GitHubUtils.GITHUB_OWNER,
repo: GitHubUtils.APP_REPO,
issue_number: issue,
per_page: 100,
}))
.then(({data: pullRequestComments}) => {
pullRequestComments.forEach(pullRequestComment => combinedData.push(pullRequestComment.body));
}, response => _.map(response.data, comment => comment.body));
}

getPullRequestBody()
.then(pullRequestBody => combinedData.push(pullRequestBody))
.then(() => getAllReviewComments())
.then(reviewComments => combinedData.push(...reviewComments))
.then(() => getAllComments())
.then(comments => combinedData.push(...comments))
.then(() => {
let contributorChecklistComplete = false;
let contributorPlusChecklistComplete = false;

Expand All @@ -153,28 +155,26 @@ GitHubUtils.octokit.pulls.get({

if (comment.includes(completedContributorChecklist.replace(whitespace, ''))) {
contributorChecklistComplete = true;
} else if (comment.includes('- [')) {
printUncheckedItems(combinedData[i]);
}

if (comment.includes(completedContributorPlusChecklist.replace(whitespace, ''))) {
contributorPlusChecklistComplete = true;
} else if (comment.includes('- [')) {
printUncheckedItems(combinedData[i]);
}
}

if (!contributorChecklistComplete) {
if (verifyingContributorChecklist && !contributorChecklistComplete) {
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 (!contributorPlusChecklistComplete) {
core.setFailed('Contributor plus checklist is not completely filled out. Please check every box to verify you\'ve thought about the item.');
if (!verifyingContributorChecklist && !contributorPlusChecklistComplete) {
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('All checklists are complete 🎉');
console.log(`${verifyingContributorChecklist ? 'Contributor' : 'Contributor+'} checklist is complete 🎉`);
});


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,13 @@ if (pullRequestNumber) {
...DEFAULT_PAYLOAD,
state: 'all',
})
.then(({data}) => _.find(data, PR => PR.user.login === user && titleRegex.test(PR.title)).number)
.then(matchingPRNum => GithubUtils.octokit.pulls.get({
...DEFAULT_PAYLOAD,
pull_number: matchingPRNum,
}))
.then(({data}) => {
const matchingPR = _.find(data, PR => PR.user.login === user && titleRegex.test(PR.title));
outputMergeCommitHash(matchingPR);
outputMergeActor(matchingPR);
outputMergeCommitHash(data);
outputMergeActor(data);
});
}
10 changes: 7 additions & 3 deletions .github/actions/javascript/getPullRequestDetails/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,14 @@ if (pullRequestNumber) {
...DEFAULT_PAYLOAD,
state: 'all',
})
.then(({data}) => _.find(data, PR => PR.user.login === user && titleRegex.test(PR.title)).number)
.then(matchingPRNum => GithubUtils.octokit.pulls.get({
...DEFAULT_PAYLOAD,
pull_number: matchingPRNum,
}))
.then(({data}) => {
const matchingPR = _.find(data, PR => PR.user.login === user && titleRegex.test(PR.title));
outputMergeCommitHash(matchingPR);
outputMergeActor(matchingPR);
outputMergeCommitHash(data);
outputMergeActor(data);
});
}

Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/contributorChecklists.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Contributor Checklist

on: pull_request

jobs:
checklist:
runs-on: ubuntu-latest
if: github.actor != 'OSBotify' && (github.event_name == 'pull_request' && contains(github.event.pull_request.body, '- ['))
steps:
- name: contributorChecklist.js
uses: Expensify/App/.github/actions/javascript/contributorChecklist@andrew-checklist-3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CHECKLIST: 'contributor'
14 changes: 14 additions & 0 deletions .github/workflows/contributorPlusChecklists.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Contributor+ Checklist

on: issue_comment

jobs:
checklist:
runs-on: ubuntu-latest
if: github.actor != 'OSBotify' && (contains(github.event.issue.pull_request.url, 'http') && github.event_name == 'issue_comment' && contains(github.event.comment.body, '- ['))
steps:
- name: contributorChecklist.js
uses: Expensify/App/.github/actions/javascript/contributorChecklist@andrew-checklist-3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CHECKLIST: 'contributorPlus'
18 changes: 0 additions & 18 deletions .github/workflows/testChecklists.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ Alternatively, you can also set up debugger using [Flipper](https://fbflipper.co
Our React Native Android app now uses the `Hermes` JS engine which requires your browser for remote debugging. These instructions are specific to Chrome since that's what the Hermes documentation provided.
1. Navigate to `chrome://inspect`
2. Use the `Configure...` button to add the Metro server address (typically `localhost:8081`, check your `Metro` output)
3. You should now see a "Hermes React Native" target with an "inspect" link which can be used to bring up a debugger. If you don't see the "inspect" link, make sure the Metro server is running.
3. You should now see a "Hermes React Native" target with an "inspect" link which can be used to bring up a debugger. If you don't see the "inspect" link, make sure the Metro server is running
4. You can now use the Chrome debug tools. See [React Native Debugging Hermes](https://reactnative.dev/docs/hermes#debugging-hermes-using-google-chromes-devtools)

## Web
Expand Down
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1001019702
versionName "1.1.97-2"
versionCode 1001019707
versionName "1.1.97-7"
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()

if (isNewArchitectureEnabled()) {
Expand Down
5 changes: 5 additions & 0 deletions config/webpack/webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,11 @@ const webpackConfig = ({envFile = '.env', platform = 'web'}) => ({
'process/browser': require.resolve('process/browser'),
},
},
devServer: {
client: {
overlay: false,
},
},
});

module.exports = webpackConfig;
Binary file modified ios/Certificates.p12.gpg
Binary file not shown.
2 changes: 1 addition & 1 deletion ios/NewExpensify/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.1.97.2</string>
<string>1.1.97.7</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationQueriesSchemes</key>
Expand Down
2 changes: 1 addition & 1 deletion ios/NewExpensifyTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.1.97.2</string>
<string>1.1.97.7</string>
</dict>
</plist>
Binary file modified ios/chat_expensify_appstore.mobileprovision.gpg
Binary file not shown.
Loading

0 comments on commit 594ff07

Please sign in to comment.