Skip to content

Commit

Permalink
Merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
shubham1206agra committed Mar 7, 2025
2 parents 1a2b757 + c7aa2c1 commit 6d8faae
Show file tree
Hide file tree
Showing 617 changed files with 13,932 additions and 7,187 deletions.
2 changes: 1 addition & 1 deletion .github/actionlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ self-hosted-runner:
- macos-15-large
- macos-15-xlarge
- macos-12
- ubuntu-20.04-v4
- ubuntu-24.04-v4

paths:
'**/*':
Expand Down
12 changes: 12 additions & 0 deletions .github/actions/javascript/postTestBuildComment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,36 @@ inputs:
ANDROID:
description: "Android job result ('success', 'failure', 'cancelled', or 'skipped')"
required: false
ANDROID_HYBRID:
description: "Android Hybrid job result ('success', 'failure', 'cancelled', or 'skipped')"
required: false
DESKTOP:
description: "Desktop job result ('success', 'failure', 'cancelled', or 'skipped')"
required: false
IOS:
description: "iOS job result ('success', 'failure', 'cancelled', or 'skipped')"
required: false
IOS_Hybrid:
description: "iOS Hybrid job result ('success', 'failure', 'cancelled', or 'skipped')"
required: false
WEB:
description: "Web job result ('success', 'failure', 'cancelled', or 'skipped')"
required: false
ANDROID_LINK:
description: "Link for the Android build"
required: false
ANDROID_HYBRID_LINK:
description: "Link for the Android Hybrid build"
required: false
DESKTOP_LINK:
description: "Link for the desktop build"
required: false
IOS_LINK:
description: "Link for the iOS build"
required: false
IOS_HYBRID_LINK:
description: "Link for the iOS Hybrid build"
required: false
WEB_LINK:
description: "Link for the web build"
required: false
Expand Down
13 changes: 9 additions & 4 deletions .github/actions/javascript/postTestBuildComment/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11502,12 +11502,14 @@ const github_1 = __nccwpck_require__(5438);
const CONST_1 = __importDefault(__nccwpck_require__(9873));
const GithubUtils_1 = __importDefault(__nccwpck_require__(9296));
function getTestBuildMessage() {
const inputs = ['ANDROID', 'DESKTOP', 'IOS', 'WEB'];
const inputs = ['ANDROID', 'ANDROID_HYBRID', 'DESKTOP', 'IOS', 'IOS_HYBRID', 'WEB'];
const names = {
[inputs[0]]: 'Android',
[inputs[1]]: 'Desktop',
[inputs[2]]: 'iOS',
[inputs[3]]: 'Web',
[inputs[1]]: 'Android Hybrid',
[inputs[2]]: 'Desktop',
[inputs[3]]: 'iOS',
[inputs[4]]: 'iOS Hybrid',
[inputs[5]]: 'Web',
};
const result = inputs.reduce((acc, platform) => {
const input = core.getInput(platform, { required: false });
Expand All @@ -11531,6 +11533,9 @@ function getTestBuildMessage() {
| ------------- | ------------- |
| ${result.ANDROID.link} | ${result.IOS.link} |
| ${result.ANDROID.qrCode} | ${result.IOS.qrCode} |
| Android Hybrid :robot::arrows_counterclockwise: | iOS Hybrid :apple::arrows_counterclockwise: |
| ${result.ANDROID_HYBRID.link} | ${result.IOS_HYBRID.link} |
| ${result.ANDROID_HYBRID.qrCode} | ${result.IOS_HYBRID.qrCode} |
| Desktop :computer: | Web :spider_web: |
| ${result.DESKTOP.link} | ${result.WEB.link} |
| ${result.DESKTOP.qrCode} | ${result.WEB.qrCode} |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ import CONST from '@github/libs/CONST';
import GithubUtils from '@github/libs/GithubUtils';

function getTestBuildMessage(): string {
const inputs = ['ANDROID', 'DESKTOP', 'IOS', 'WEB'] as const;
const inputs = ['ANDROID', 'ANDROID_HYBRID', 'DESKTOP', 'IOS', 'IOS_HYBRID', 'WEB'] as const;
const names = {
[inputs[0]]: 'Android',
[inputs[1]]: 'Desktop',
[inputs[2]]: 'iOS',
[inputs[3]]: 'Web',
[inputs[1]]: 'Android Hybrid',
[inputs[2]]: 'Desktop',
[inputs[3]]: 'iOS',
[inputs[4]]: 'iOS Hybrid',
[inputs[5]]: 'Web',
};

const result = inputs.reduce((acc, platform) => {
Expand Down Expand Up @@ -40,6 +42,9 @@ function getTestBuildMessage(): string {
| ------------- | ------------- |
| ${result.ANDROID.link} | ${result.IOS.link} |
| ${result.ANDROID.qrCode} | ${result.IOS.qrCode} |
| Android Hybrid :robot::arrows_counterclockwise: | iOS Hybrid :apple::arrows_counterclockwise: |
| ${result.ANDROID_HYBRID.link} | ${result.IOS_HYBRID.link} |
| ${result.ANDROID_HYBRID.qrCode} | ${result.IOS_HYBRID.qrCode} |
| Desktop :computer: | Web :spider_web: |
| ${result.DESKTOP.link} | ${result.WEB.link} |
| ${result.DESKTOP.qrCode} | ${result.WEB.qrCode} |
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/authorChecklist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
# Warning: – when using the pull_request_target event, DO NOT checkout code from an untrusted branch: https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
pull_request_target:
types: [opened, edited, reopened, synchronize]
branches: [main]

jobs:
# Note: PHP specifically looks for the name of this job, "checklist", so if the name of the job is changed,
Expand Down
50 changes: 29 additions & 21 deletions .github/workflows/cherryPick.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,34 +95,42 @@ jobs:
if: fromJSON(steps.cherryPick.outputs.HAS_CONFLICTS)
id: createPullRequest
run: |
gh pr create \
--title "🍒 Cherry pick PR #${{ github.event.inputs.PULL_REQUEST_NUMBER }} to staging 🍒" \
--body \
"🍒 Cherry pick https://github.com/Expensify/App/pull/${{ github.event.inputs.PULL_REQUEST_NUMBER }} to staging 🍒
This PR had conflicts when we tried to cherry-pick it to staging. You'll need to manually perform the cherry-pick, using the following steps:
AUTHOR_CHECKLIST=$(sed -n '/### PR Author Checklist/,$p' .github/PULL_REQUEST_TEMPLATE.md)
PR_DESCRIPTION=$(cat <<EOF
🍒 Cherry pick https://github.com/Expensify/App/pull/56382 to staging 🍒
This PR had conflicts when we tried to cherry-pick it to staging. You'll need to manually perform the cherry-pick, using the following steps:
\`\`\`bash
git fetch
git checkout ${{ github.actor }}-cherry-pick-staging-${{ github.event.inputs.PULL_REQUEST_NUMBER }}-${{ github.run_attempt }}
git cherry-pick -S -x --mainline 1 ${{ steps.getCPMergeCommit.outputs.MERGE_COMMIT_SHA }}
\`\`\`
\`\`\`bash
git fetch
git checkout ${{ github.actor }}-cherry-pick-staging-${{ github.event.inputs.PULL_REQUEST_NUMBER }}-${{ github.run_attempt }}
git cherry-pick -S -x --mainline 1 ${{ steps.getCPMergeCommit.outputs.MERGE_COMMIT_SHA }}
\`\`\`
Then manually resolve conflicts, and commit the change with \`git cherry-pick --continue\`. Lastly, please run:
Then manually resolve conflicts, and commit the change with \`git cherry-pick --continue\`. Lastly, please run:
\`\`\`bash
git commit --amend -m "\$(git log -1 --pretty=%B)" -m "(CP triggered by ${{ github.actor }})"
\`\`\`
\`\`\`bash
git commit --amend -m \"$(git log -1 --pretty=%B)\" -m \"(CP triggered by ${{ github.actor }})\"
\`\`\`
That will help us keep track of who triggered this CP. Once all that's done, push your changes with \`git push origin ${{ github.actor }}-cherry-pick-staging-${{ github.event.inputs.PULL_REQUEST_NUMBER }}-${{ github.run_attempt }}\`, and then open this PR for review.
That will help us keep track of who triggered this CP. Once all that's done, push your changes with \`git push origin ${{ github.actor }}-cherry-pick-staging-${{ github.event.inputs.PULL_REQUEST_NUMBER }}-${{ github.run_attempt }}\`, and then open this PR for review.
Note that you **must** test this PR, and both the author and reviewer checklist should be completed, just as if you were merging the PR to main." \
Note that you **must** test this PR, and both the author and reviewer checklist should be completed, just as if you were merging the PR to main.
_Pro-tip:_ If this PR appears to have conflicts against the _staging_ base, it means that the version on staging has been updated. The easiest thing to do if you see this is to close the PR and re-run the CP.
$AUTHOR_CHECKLIST
EOF
)
# Create PR
gh pr create \
--title "🍒 Cherry pick PR #${{ github.event.inputs.PULL_REQUEST_NUMBER }} to staging 🍒" \
--body "$PR_DESCRIPTION" \
--label "Engineering,Hourly" \
--base "staging"
sleep 5
gh pr comment --body \
"This pull request has merge conflicts and can not be automatically merged. :disappointed:
Please manually resolve the conflicts, push your changes, and then request another reviewer to review and merge.
**Important:** There may be conflicts that GitHub is not able to detect, so please _carefully_ review this pull request before approving."
ORIGINAL_PR_AUTHOR="$(gh pr view ${{ github.event.inputs.PULL_REQUEST_NUMBER }} --json author --jq .author.login)"
gh pr edit --add-assignee "${{ github.actor }},${{ steps.getCPMergeCommit.outputs.MERGE_ACTOR }},$ORIGINAL_PR_AUTHOR"
env:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/cla.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
types: [created]
pull_request_target:
types: [opened, synchronize]
branches: [main]

jobs:
CLA:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ concurrency:
jobs:
lint:
name: ESLint check
if: ${{ github.actor != 'OSBotify' || github.event_name == 'workflow_call' }}
if: ${{ github.event.head_commit.author.name != 'OSBotify' || github.event_name == 'workflow_call' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/postBuildStartedComment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: ${{ inputs.APP_PULL_REQUEST_NUMBER }},
body: `🚧 @${{ github.actor }} has triggered a test hybrid app build. You can view the [workflow run here](${workflowURL}).`
body: `🚧 @${{ github.actor }} has triggered a test app build. You can view the [workflow run here](${workflowURL}).`
});
- name: Add build start comment to OD PR
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reassurePerformanceTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:
perf-tests:
if: ${{ github.actor != 'OSBotify' }}
runs-on: ubuntu-20.04-v4
runs-on: ubuntu-24.04-v4
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sendReassurePerfData.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
perf-tests:
if: ${{ github.actor != 'OSBotify' }}
runs-on: ubuntu-20.04-v4
runs-on: ubuntu-24.04-v4
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ concurrency:

jobs:
jest:
if: ${{ github.actor != 'OSBotify' && github.actor != 'imgbot[bot]' || github.event_name == 'workflow_call' }}
if: ${{ github.event.head_commit.author.name != 'OSBotify' && github.event.head_commit.author.name != 'imgbot[bot]' || github.event_name == 'workflow_call' }}
runs-on: ubuntu-latest
env:
CI: true
Expand Down Expand Up @@ -44,7 +44,7 @@ jobs:
run: NODE_OPTIONS="$NODE_OPTIONS --experimental-vm-modules" npm test -- --silent --shard=${{ fromJSON(matrix.chunk) }}/${{ strategy.job-total }} --max-workers ${{ steps.cpu-cores.outputs.count }}

storybookTests:
if: ${{ github.actor != 'OSBotify' && github.actor != 'imgbot[bot]' || github.event_name == 'workflow_call' }}
if: ${{ github.event.head_commit.author.name != 'OSBotify' && github.event.head_commit.author.name != 'imgbot[bot]' || github.event_name == 'workflow_call' }}
runs-on: ubuntu-latest
name: Storybook tests
steps:
Expand Down
79 changes: 51 additions & 28 deletions .github/workflows/testBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,42 @@ on:
PULL_REQUEST_NUMBER:
description: Pull Request number for correct placement of apps
required: true
pull_request_target:
types: [opened, synchronize, labeled]
branches: ['*ci-test/**']
WEB:
description: Should build web app?
type: boolean
default: true
DESKTOP:
description: Should build desktop app?
type: boolean
default: true
IOS:
description: Should build iOS app?
type: boolean
default: true
IOS_HYBRID:
description: Should build iOS hybrid app?
type: boolean
default: true
ANDROID:
description: Should build android app?
type: boolean
default: true
ANDROID_HYBRID:
description: Should build android hybrid app?
type: boolean
default: true

env:
PULL_REQUEST_NUMBER: ${{ github.event.number || github.event.inputs.PULL_REQUEST_NUMBER }}
# This variable is needed for fastlane to construct correct path
PULL_REQUEST_NUMBER: ${{ github.event.inputs.PULL_REQUEST_NUMBER }}

jobs:
prep:
runs-on: ubuntu-latest
outputs:
REF: ${{ github.event.pull_request.head.sha || steps.getHeadRef.outputs.REF }}
READY_TO_BUILD: ${{ steps.readyToBuild.outputs.READY_TO_BUILD }}
REF: ${{ steps.getHeadRef.outputs.REF }}
steps:
- name: Checkout
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: actions/checkout@v4

- name: Validate that user is an Expensify employee
Expand All @@ -30,21 +50,6 @@ jobs:
REQUIRE_APP_DEPLOYER: false
OS_BOTIFY_TOKEN: ${{ secrets.OS_BOTIFY_COMMIT_TOKEN }}

- name: Check if PR has Ready to Build label
id: readyToBuild
run: |
LABELS=$(gh pr view "${{ env.PULL_REQUEST_NUMBER }}" --repo Expensify/App --json labels --jq '.labels[].name')
if echo "$LABELS" | grep -q 'Ready To Build'; then
echo "::notice::✅ PR ${{ env.PULL_REQUEST_NUMBER }} has 'Ready to Build' label"
echo "READY_TO_BUILD=true" >> "$GITHUB_OUTPUT"
else
echo "::error::❌ PR ${{ env.PULL_REQUEST_NUMBER }} does not have 'Ready to Build' label"
echo "READY_TO_BUILD=false" >> "$GITHUB_OUTPUT"
exit 1
fi
env:
GITHUB_TOKEN: ${{ github.token }}

- name: Check if pull request number is correct
if: ${{ github.event_name == 'workflow_dispatch' }}
id: getHeadRef
Expand All @@ -64,13 +69,14 @@ jobs:

buildAndroid:
name: Build Android app for testing
if: ${{ inputs.ANDROID }}
uses: ./.github/workflows/buildAndroid.yml
needs: [prep]
secrets: inherit
with:
type: adhoc
ref: ${{ needs.prep.outputs.REF }}
pull_request_number: ${{ github.event.number || github.event.inputs.PULL_REQUEST_NUMBER }}
pull_request_number: ${{ github.event.inputs.PULL_REQUEST_NUMBER }}

uploadAndroid:
name: Upload Android app to S3
Expand Down Expand Up @@ -118,6 +124,7 @@ jobs:
iOS:
name: Build and deploy iOS for testing
if: ${{ inputs.IOS }}
needs: [prep]
env:
DEVELOPER_DIR: /Applications/Xcode_16.2.0.app/Contents/Developer
Expand Down Expand Up @@ -206,6 +213,7 @@ jobs:

desktop:
name: Build and deploy Desktop for testing
if: ${{ inputs.DESKTOP }}
needs: [prep]
runs-on: macos-14-large
steps:
Expand Down Expand Up @@ -256,6 +264,7 @@ jobs:

web:
name: Build and deploy Web
if: ${{ inputs.WEB }}
needs: [prep]
runs-on: ubuntu-latest-xl
steps:
Expand Down Expand Up @@ -286,11 +295,21 @@ jobs:
- name: Deploy to S3 for internal testing
run: aws s3 cp --recursive --acl public-read "$GITHUB_WORKSPACE"/dist s3://ad-hoc-expensify-cash/web/"$PULL_REQUEST_NUMBER"

buildHybridApps:
name: Build hybrid adhoc apps
uses: ./.github/workflows/testBuildHybrid.yml
needs: [prep]
secrets: inherit
with:
APP_REF: ${{ needs.prep.outputs.REF }}
IOS_HYBRID: ${{ inputs.IOS_HYBRID }}
ANDROID_HYBRID: ${{ inputs.ANDROID_HYBRID }}

postGithubComment:
runs-on: ubuntu-latest
if: always()
name: Post a GitHub comment with app download links for testing
needs: [prep, uploadAndroid, iOS, desktop, web]
if: ${{ always() && needs.prep.outputs.READY_TO_BUILD == 'true' }}
needs: [prep, uploadAndroid, iOS, desktop, web, buildHybridApps]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -314,13 +333,17 @@ jobs:
- name: Publish links to apps for download
uses: ./.github/actions/javascript/postTestBuildComment
with:
PR_NUMBER: ${{ env.PULL_REQUEST_NUMBER }}
PR_NUMBER: ${{ github.event.inputs.PULL_REQUEST_NUMBER }}
GITHUB_TOKEN: ${{ github.token }}
ANDROID: ${{ needs.uploadAndroid.result }}
ANDROID_HYBRID: ${{ needs.buildHybridApps.result }}
DESKTOP: ${{ needs.desktop.result }}
IOS: ${{ needs.iOS.result }}
IOS_HYBRID: ${{ needs.buildHybridApps.result }}
WEB: ${{ needs.web.result }}
ANDROID_LINK: ${{ needs.uploadAndroid.outputs.S3_APK_PATH }}
DESKTOP_LINK: https://ad-hoc-expensify-cash.s3.amazonaws.com/desktop/${{ env.PULL_REQUEST_NUMBER }}/NewExpensify.dmg
ANDROID_HYBRID_LINK: ${{ needs.buildHybridApps.outputs.ANDROID_LINK }}
DESKTOP_LINK: https://ad-hoc-expensify-cash.s3.amazonaws.com/desktop/${{ github.event.inputs.PULL_REQUEST_NUMBER }}/NewExpensify.dmg
IOS_LINK: ${{ steps.get_ios_path.outputs.ios_path }}
WEB_LINK: https://${{ env.PULL_REQUEST_NUMBER }}.pr-testing.expensify.com
IOS_HYBRID_LINK: ${{ needs.buildHybridApps.outputs.IOS_LINK }}
WEB_LINK: https://${{ github.event.inputs.PULL_REQUEST_NUMBER }}.pr-testing.expensify.com
Loading

0 comments on commit 6d8faae

Please sign in to comment.