Skip to content

Commit

Permalink
Merge branch 'main' of github.com:Expensify/App into aldo_fix-empty-l…
Browse files Browse the repository at this point in the history
…ines
  • Loading branch information
aldo-expensify committed Jul 6, 2022
2 parents de3301c + 32e67da commit 65fe23e
Show file tree
Hide file tree
Showing 221 changed files with 6,482 additions and 4,452 deletions.
17 changes: 0 additions & 17 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,19 +1,2 @@
# Every PR gets a review from an internal Expensify engineer
* @Expensify/pullerbear

# Performance sensitive and problem areas
src/pages/home/report/ReportActionsView.js @marcaaron
src/libs/OptionsListUtils.js @marcaaron
src/libs/Network.js @marcaaron
src/libs/actions/Report.js @marcaaron
src/pages/LogInWithShortLivedTokenPage.js @marcaaron
src/pages/home/ReportScreen.js @marcaaron
src/components/InvertedFlatList @marcaaron
src/components/OptionsList @marcaaron
src/components/OptionsSelector.js @marcaaron
src/libs/Navigation/CustomActions.js @marcaaron
src/libs/Navigation/Navigation.js @marcaaron
src/libs/Navigation/NavigationRoot.js @marcaaron
src/libs/NetworkConnection.js @marcaaron
src/libs/actions/NetworkRequestQueue.js @marcaaron
src/libs/actions/ReportActions.js @marcaaron
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/Accessibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Accessibility issue template
about: A template to follow when creating a new issue for accessibility failures
---

If you haven’t already, check out our [contributing guidelines](https://github.com/Expensify/ReactNativeChat/blob/main/CONTRIBUTING.md) for onboarding and email contributors@expensify.com to request to join our Slack channel!
If you haven’t already, check out our [contributing guidelines](https://github.com/Expensify/ReactNativeChat/blob/main/docs/CONTRIBUTING.md) for onboarding and email contributors@expensify.com to request to join our Slack channel!
___

## Action Performed:
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/Performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: "[Performance] "
labels: Engineering, Daily
---

If you haven’t already, check out our [contributing guidelines](https://github.com/Expensify/ReactNativeChat/blob/main/CONTRIBUTING.md) for onboarding and email contributors@expensify.com to request to join our Slack channel!
If you haven’t already, check out our [contributing guidelines](https://github.com/Expensify/ReactNativeChat/blob/main/docs/CONTRIBUTING.md) for onboarding and email contributors@expensify.com to request to join our Slack channel!
___

## What performance issue do we need to solve?
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/Standard.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ about: A standard template to follow when creating a new issue in this repositor
labels: AutoAssignerTriage, Daily
---

If you haven’t already, check out our [contributing guidelines](https://github.com/Expensify/ReactNativeChat/blob/main/CONTRIBUTING.md) for onboarding and email contributors@expensify.com to request to join our Slack channel!
If you haven’t already, check out our [contributing guidelines](https://github.com/Expensify/ReactNativeChat/blob/main/docs/CONTRIBUTING.md) for onboarding and email contributors@expensify.com to request to join our Slack channel!
___

## Action Performed:
Expand Down
16 changes: 8 additions & 8 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ This is a checklist for PR authors & reviewers. Please make sure to complete all
- [ ] I added steps for Staging and/or Production testing in the `QA steps` section
- [ ] I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
- [ ] 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)
- [ ] I included screenshots or videos for tests on [all platforms](https://github.com/Expensify/App/blob/main/CONTRIBUTING.md#make-sure-you-can-test-on-all-platforms)
- [ ] I included screenshots or videos for tests on [all platforms](https://github.com/Expensify/App/blob/main/docs/CONTRIBUTING.md#make-sure-you-can-test-on-all-platforms)
- [ ] I ran the tests on **all platforms** & verified they passed on:
- [ ] iOS / native
- [ ] Android / native
Expand All @@ -51,16 +51,16 @@ This is a checklist for PR authors & reviewers. Please make sure to complete all
- [ ] 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)
- [ ] I followed proper code patterns (see [Reviewing the code](https://github.com/Expensify/App/blob/main/PR_REVIEW_GUIDELINES.md#reviewing-the-code))
- [ ] I followed proper code patterns (see [Reviewing the code](https://github.com/Expensify/App/blob/main/docs/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
- [ ] 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.
- [ ] I verified any copy / text shown in the product was added in all `src/languages/*` files
- [ ] 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.
- [ ] 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.
- [ ] I verified the JSDocs style guidelines (in [`STYLE.md`](https://github.com/Expensify/App/blob/main/STYLE.md#jsdocs)) were followed
- [ ] I verified the JSDocs style guidelines (in [`STYLE.md`](https://github.com/Expensify/App/blob/main/docs/STYLE.md#jsdocs)) were followed
- [ ] If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
- [ ] I followed the guidelines as stated in the [Review Guidelines](https://github.com/Expensify/App/blob/main/PR_REVIEW_GUIDELINES.md)
- [ ] I followed the guidelines as stated in the [Review Guidelines](https://github.com/Expensify/App/blob/main/docs/PR_REVIEW_GUIDELINES.md)
- [ ] 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)
- [ ] I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
- [ ] 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
Expand Down Expand Up @@ -91,7 +91,7 @@ This is a checklist for PR authors & reviewers. Please make sure to complete all
- [ ] I verified the steps for Staging and/or Production testing are in the `QA steps` section
- [ ] 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)
- [ ] 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)
- [ ] I checked that screenshots or videos are included for tests on [all platforms](https://github.com/Expensify/App/blob/main/CONTRIBUTING.md#make-sure-you-can-test-on-all-platforms)
- [ ] I checked that screenshots or videos are included for tests on [all platforms](https://github.com/Expensify/App/blob/main/docs/CONTRIBUTING.md#make-sure-you-can-test-on-all-platforms)
- [ ] I verified tests pass on **all platforms** & I tested again on:
- [ ] iOS / native
- [ ] Android / native
Expand All @@ -100,16 +100,16 @@ This is a checklist for PR authors & reviewers. Please make sure to complete all
- [ ] 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)
- [ ] I verified proper code patterns were followed (see [Reviewing the code](https://github.com/Expensify/App/blob/main/PR_REVIEW_GUIDELINES.md#reviewing-the-code))
- [ ] I verified proper code patterns were followed (see [Reviewing the code](https://github.com/Expensify/App/blob/main/docs/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
- [ ] 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.
- [ ] I verified any copy / text shown in the product was added in all `src/languages/*` files
- [ ] 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.
- [ ] 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.
- [ ] I verified the JSDocs style guidelines (in [`STYLE.md`](https://github.com/Expensify/App/blob/main/STYLE.md#jsdocs)) were followed
- [ ] I verified the JSDocs style guidelines (in [`STYLE.md`](https://github.com/Expensify/App/blob/main/docs/STYLE.md#jsdocs)) were followed
- [ ] If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
- [ ] I verified that this PR follows the guidelines as stated in the [Review Guidelines](https://github.com/Expensify/App/blob/main/PR_REVIEW_GUIDELINES.md)
- [ ] I verified that this PR follows the guidelines as stated in the [Review Guidelines](https://github.com/Expensify/App/blob/main/docs/PR_REVIEW_GUIDELINES.md)
- [ ] I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
- [ ] 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
- [ ] If a new component is created I verified that:
Expand Down
28 changes: 28 additions & 0 deletions .github/actions/composite/announceFailedWorkflowInSlack/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: 'Announce failed workflow in Slack'
description: 'Post failed workflow in Slack #announce channel'

inputs:
SLACK_WEBHOOK:
description: 'URL of the slack webhook'
required: true

runs:
using: composite
steps:
- uses: 8398a7/action-slack@v3
name: Job failed Slack notification
with:
status: custom
fields: workflow, repo
custom_payload: |
{
channel: '#announce',
attachments: [{
color: "#DB4545",
pretext: `<!subteam^S4TJJ3PSL>`,
text: `💥 ${process.env.AS_REPO} failed on ${process.env.AS_WORKFLOW} workflow 💥`,
}]
}
env:
GITHUB_TOKEN: ${{ github.token }}
SLACK_WEBHOOK_URL: ${{ inputs.SLACK_WEBHOOK }}
26 changes: 26 additions & 0 deletions .github/actions/composite/setupGitForOSBotify/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: 'Setup Git for OSBotify'
description: 'Setup Git for OSBotify'

inputs:
GPG_PASSPHRASE:
description: 'Passphrase used to decrypt GPG key'
required: true

runs:
using: composite
steps:
- name: Decrypt OSBotify GPG key
run: cd .github/workflows && gpg --quiet --batch --yes --decrypt --passphrase=${{ inputs.GPG_PASSPHRASE }} --output OSBotify-private-key.asc OSBotify-private-key.asc.gpg
shell: bash

- name: Import OSBotify GPG Key
shell: bash
run: cd .github/workflows && gpg --import OSBotify-private-key.asc

- name: Set up git for OSBotify
shell: bash
run: |
git config user.signingkey 367811D53E34168C
git config commit.gpgsign true
git config user.name OSBotify
git config user.email infra+osbotify@expensify.com
132 changes: 132 additions & 0 deletions .github/actions/composite/updateProtectedBranch/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
name: Update Protected Branch
description: Create, approve, and merge a pull request against a protected branch

inputs:
TARGET_BRANCH:
description: The target branch to update. This becomes the base branch of the pull request.
required: true
SOURCE_BRANCH:
description: If updating main, you must also provide a head branch to update main with.
required: false
default: ''
OS_BOTIFY_TOKEN:
description: GitHub token for OSBotify
required: true
GPG_PASSPHRASE:
description: Passphrase used to decrypt GPG key for OSBotify
required: true

runs:
using: composite
steps:
- name: Validate target branch
if: ${{ !contains(fromJSON('["main", "staging", "production"]'), inputs.TARGET_BRANCH) }}
shell: bash
run: |
echo "Target branch must be one of ['main', 'staging', 'production]"
exit 1
# If updating main, SOURCE_BRANCH must not be empty
- name: Validate source branch
if: inputs.TARGET_BRANCH == 'main' && inputs.SOURCE_BRANCH == ''
shell: bash
run: |
echo "Cannot update main branch without specifying a source branch"
exit 1
# If updating staging, the source branch will always be main
# If updating production, the source branch will always be staging
- name: Set source branch
shell: bash
run: |
if [[ ${{ inputs.TARGET_BRANCH }} == 'staging' ]]; then
echo "SOURCE_BRANCH=main" >> "$GITHUB_ENV"
elif [[ ${{ inputs.TARGET_BRANCH }} == 'production' ]]; then
echo "SOURCE_BRANCH=staging" >> "$GITHUB_ENV"
else
echo "SOURCE_BRANCH=${{ inputs.SOURCE_BRANCH }}" >> "$GITHUB_ENV"
fi
- uses: Expensify/App/.github/actions/composite/setupGitForOSBotify@main
with:
GPG_PASSPHRASE: ${{ inputs.GPG_PASSPHRASE }}

- name: Checkout source branch
shell: bash
run: git checkout ${{ env.SOURCE_BRANCH }}

- name: Set New Version
shell: bash
run: echo "NEW_VERSION=$(npm run print-version --silent)" >> "$GITHUB_ENV"

- name: Create temporary branch to resolve conflicts
if: ${{ contains(fromJSON('["staging", "production"]'), inputs.TARGET_BRANCH) }}
shell: bash
run: |
git checkout ${{ inputs.TARGET_BRANCH }}
BRANCH_NAME=update-${{ inputs.TARGET_BRANCH }}-from-${{ env.SOURCE_BRANCH }}
git checkout -b "$BRANCH_NAME"
git merge -Xtheirs ${{ env.SOURCE_BRANCH }}
git push --set-upstream origin "$BRANCH_NAME"
- name: Create Pull Request
id: createPullRequest
shell: bash
run: |
gh pr create \
--title "Update version to ${{ env.NEW_VERSION }} on ${{ inputs.TARGET_BRANCH }}" \
--body "Update version to ${{ env.NEW_VERSION }}" \
--label "automerge" \
--base ${{ inputs.TARGET_BRANCH }}
sleep 5
echo "::set-output name=PR_NUMBER::$(gh pr view --json 'number' --jq '.number')"
env:
GITHUB_TOKEN: ${{ inputs.OS_BOTIFY_TOKEN }}

- name: Check changed files
if: ${{ inputs.TARGET_BRANCH == 'main' }}
id: changedFiles
# Version: 3.3.0
uses: umani/changed-files@1d252c611c64289d35243fc37ece7323ea5e93e1
with:
repo-token: ${{ github.token }}
pr-number: ${{ steps.createPullRequest.outputs.PR_NUMBER }}

- name: Validate changed files
if: ${{ inputs.TARGET_BRANCH == 'main' && (steps.changedFiles.outputs.files_updated != 'android/app/build.gradle ios/NewExpensify/Info.plist ios/NewExpensifyTests/Info.plist package-lock.json package.json' || steps.changedFiles.outputs.files_created != '' || steps.changedFiles.outputs.files_deleted != '') }}
shell: bash
run: exit 1

- name: Auto-approve the PR
shell: bash
run: gh pr review --approve
env:
GITHUB_TOKEN: ${{ github.token }}

- name: Check if pull request is mergeable
id: isPullRequestMergeable
uses: Expensify/App/.github/actions/javascript/isPullRequestMergeable@main
with:
GITHUB_TOKEN: ${{ github.token }}
PULL_REQUEST_NUMBER: ${{ steps.createPullRequest.outputs.PR_NUMBER }}

- name: Leave comment if PR is not mergeable
if: ${{ !fromJSON(steps.isPullRequestMergeable.outputs.IS_MERGEABLE) }}
shell: bash
run: |
gh pr comment --body \
":bell: @Expensify/mobile-deployers :bell: - The Update Protected Branch workflow has failed because this PR was not mergable.
If you are the deployer this week, please resolve the error and merge this PR to continue the deploy process."
env:
GITHUB_TOKEN: ${{ inputs.OS_BOTIFY_TOKEN }}

- name: Fail workflow if PR is not mergeable
if: ${{ steps.isPullRequestMergeable.outputs.IS_MERGEABLE == 'false' }}
shell: bash
run: exit 1

- name: Auto-merge the PR
shell: bash
run: gh pr merge ${{ steps.createPullRequest.outputs.PR_NUMBER }} --merge --delete-branch
env:
GITHUB_TOKEN: ${{ inputs.OS_BOTIFY_TOKEN }}
60 changes: 0 additions & 60 deletions .github/actions/isPullRequestMergeable/isPullRequestMergeable.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const _ = require('underscore');
const ActionUtils = require('../../libs/ActionUtils');
const GitHubUtils = require('../../libs/GithubUtils');
const {promiseDoWhile} = require('../../libs/promiseWhile');
const ActionUtils = require('../../../libs/ActionUtils');
const GitHubUtils = require('../../../libs/GithubUtils');
const {promiseDoWhile} = require('../../../libs/promiseWhile');

function run() {
const tag = ActionUtils.getStringInput('TAG', {required: false});
Expand Down
Loading

0 comments on commit 65fe23e

Please sign in to comment.