Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into fix/47021
Browse files Browse the repository at this point in the history
Merge main into fix/47021
  • Loading branch information
Shahidullah-Muffakir committed Sep 5, 2024
2 parents 49dfe7f + 156b8b0 commit 9e09789
Show file tree
Hide file tree
Showing 846 changed files with 48,138 additions and 26,987 deletions.
5 changes: 2 additions & 3 deletions .github/actions/composite/buildAndroidE2EAPK/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,13 @@ runs:
- uses: Expensify/App/.github/actions/composite/setupNode@main

- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: "oracle"
java-version: "17"

- uses: ruby/setup-ruby@v1.187.0
- uses: ruby/setup-ruby@v1.190.0
with:
ruby-version: "2.7"
bundler-cache: true

- uses: gradle/gradle-build-action@3fbe033aaae657f011f88f29be9e65ed26bd29ef
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14543,6 +14543,7 @@ function getCommitHistoryAsJSON(fromTag, toTag) {
});
spawnedProcess.on('close', (code) => {
if (code !== 0) {
console.log('code: ', code);
return reject(new Error(`${stderr}`));
}
resolve(stdout);
Expand Down Expand Up @@ -15369,9 +15370,9 @@ module.exports = require("zlib");
/***/ 3286:
/***/ ((module) => {

function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
"default": e
};
}
module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11881,6 +11881,7 @@ function getCommitHistoryAsJSON(fromTag, toTag) {
});
spawnedProcess.on('close', (code) => {
if (code !== 0) {
console.log('code: ', code);
return reject(new Error(`${stderr}`));
}
resolve(stdout);
Expand Down
1 change: 1 addition & 0 deletions .github/actions/javascript/getPreviousVersion/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2959,6 +2959,7 @@ function getCommitHistoryAsJSON(fromTag, toTag) {
});
spawnedProcess.on('close', (code) => {
if (code !== 0) {
console.log('code: ', code);
return reject(new Error(`${stderr}`));
}
resolve(stdout);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as core from '@actions/core';
import type {CompareResult, PerformanceEntry} from '@callstack/reassure-compare/src/types';
import type {CompareResult, MeasureEntry} from '@callstack/reassure-compare';
import fs from 'fs';

const run = (): boolean => {
Expand All @@ -16,8 +16,8 @@ const run = (): boolean => {

for (let i = 0; i < regressionOutput.countChanged.length; i++) {
const measurement = regressionOutput.countChanged[i];
const baseline: PerformanceEntry = measurement.baseline;
const current: PerformanceEntry = measurement.current;
const baseline: MeasureEntry = measurement.baseline;
const current: MeasureEntry = measurement.current;

console.log(`Processing measurement ${i + 1}: ${measurement.name}`);

Expand Down
1 change: 1 addition & 0 deletions .github/libs/GitUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ function getCommitHistoryAsJSON(fromTag: string, toTag: string): Promise<CommitT
});
spawnedProcess.on('close', (code) => {
if (code !== 0) {
console.log('code: ', code);
return reject(new Error(`${stderr}`));
}

Expand Down
31 changes: 4 additions & 27 deletions .github/scripts/createHelpRedirects.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,32 +27,6 @@ function checkCloudflareResult {
declare -a ITEMS_TO_ADD

while read -r line; do
# Split each line of the file into a source and destination so we can sanity check
# and compare against the current list.
read -r -a LINE_PARTS < <(echo "$line" | tr ',' ' ')
SOURCE_URL=${LINE_PARTS[0]}
DEST_URL=${LINE_PARTS[1]}

# Make sure the format of the line is as execpted.
if [[ "${#LINE_PARTS[@]}" -gt 2 ]]; then
error "Found a line with more than one comma: $line"
exit 1
fi

# Basic sanity checking to make sure that the source and destination are in expected
# subdomains.
if ! [[ $SOURCE_URL =~ ^https://(community|help)\.expensify\.com ]]; then
error "Found source URL that is not a communityDot or helpDot URL: $SOURCE_URL"
exit 1
fi

if ! [[ $DEST_URL =~ ^https://(help|use)\.expensify\.com ]]; then
error "Found destination URL that is not a helpDot or useDot URL: $DEST_URL"
exit 1
fi

info "Source: $SOURCE_URL and destination: $DEST_URL appear to be formatted correctly."

ITEMS_TO_ADD+=("$line")

# This line skips the first line in the csv because the first line is a header row.
Expand Down Expand Up @@ -83,6 +57,9 @@ done | jq -n '. |= [inputs]')

info "Adding redirects for $PUT_JSON"

# Dump $PUT_JSON into a file otherwise the curl request below will fail with too many arguments
echo "$PUT_JSON" > redirects.json

# We use PUT here instead of POST so that we replace the entire list in place. This has many benefits:
# 1. We don't have to check if items are already in the list, allowing this script to run faster
# 2. We can support deleting redirects this way by simply removing them from the list
Expand All @@ -93,7 +70,7 @@ info "Adding redirects for $PUT_JSON"
PUT_RESULT=$(curl -s --request PUT --url "https://api.cloudflare.com/client/v4/accounts/$ZONE_ID/rules/lists/$LIST_ID/items" \
--header 'Content-Type: application/json' \
--header "Authorization: Bearer $CLOUDFLARE_LIST_TOKEN" \
--data "$PUT_JSON")
--data-binary @redirects.json)

checkCloudflareResult "$PUT_RESULT"
OPERATION_ID=$(echo "$PUT_RESULT" | jq -r .result.operation_id)
Expand Down
15 changes: 15 additions & 0 deletions .github/scripts/removeInvalidJson.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env ruby
require 'json'

# List of JSON strings
json_strings = ARGV

# Parse each JSON string and remove any that couldn't be parsed
valid_jsons = json_strings.select do |json_string|
begin
JSON.parse(json_string)
true
rescue JSON::ParserError
false
end
end
4 changes: 3 additions & 1 deletion .github/scripts/verifyPodfile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,11 @@ if ! read_lines_into_array PODSPEC_PATHS < <(npx react-native config | jq --raw-
cleanupAndExit 1
fi

PODSPECS=$(./.github/scripts/printPodspec.rb "${PODSPEC_PATHS[@]}")

# Format a list of Pods based on the output of the config command
if ! FORMATTED_PODS=$( \
jq --raw-output --slurp 'map((.name + " (" + .version + ")")) | .[]' <<< "$(./.github/scripts/printPodspec.rb "${PODSPEC_PATHS[@]}")" \
jq --raw-output --slurp 'map((.name + " (" + .version + ")")) | .[]' <<< "$(./.github/scripts/removeInvalidJson.rb "${PODSPECS}")" \
); then
error "Error: could not parse podspecs at paths parsed from react-native config"
cleanupAndExit 1
Expand Down
48 changes: 48 additions & 0 deletions .github/scripts/verifyRedirect.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
# HelpDot - Verifies that redirects.csv does not have any duplicates
# Duplicate sourceURLs break redirection on cloudflare pages

source scripts/shellUtils.sh

declare -r REDIRECTS_FILE="docs/redirects.csv"
declare -a ITEMS_TO_ADD

declare -r RED='\033[0;31m'
declare -r GREEN='\033[0;32m'
Expand All @@ -22,5 +25,50 @@ if [[ DETECT_CYCLE_EXIT_CODE -eq 1 ]]; then
exit 1
fi

while read -r line; do
# Split each line of the file into a source and destination so we can sanity check
# and compare against the current list.
read -r -a LINE_PARTS < <(echo "$line" | tr ',' ' ')
SOURCE_URL=${LINE_PARTS[0]}
DEST_URL=${LINE_PARTS[1]}

# Make sure that the source and destination are not identical
if [[ "$SOURCE_URL" == "$DEST_URL" ]]; then
error "Source and destination URLs are identical: $SOURCE_URL"
exit 1
fi

# Make sure the format of the line is as expected.
if [[ "${#LINE_PARTS[@]}" -gt 2 ]]; then
error "Found a line with more than one comma: $line"
exit 1
fi

# Basic sanity checking to make sure that the source and destination are in expected
# subdomains.
if ! [[ $SOURCE_URL =~ ^https://(community|help)\.expensify\.com ]] || [[ $SOURCE_URL =~ \# ]]; then
error "Found source URL that is not a communityDot or helpDot URL, or contains a '#': $SOURCE_URL"
exit 1
fi

if ! [[ $DEST_URL =~ ^https://(help|use|integrations)\.expensify\.com|^https://www\.expensify\.org ]]; then
error "Found destination URL that is not a supported URL: $DEST_URL"
exit 1
fi

info "Source: $SOURCE_URL and destination: $DEST_URL appear to be formatted correctly."

ITEMS_TO_ADD+=("$line")

# This line skips the first line in the csv because the first line is a header row.
done <<< "$(tail +2 $REDIRECTS_FILE)"

# Sanity check that we should actually be running this and we aren't about to delete
# every single redirect.
if [[ "${#ITEMS_TO_ADD[@]}" -lt 1 ]]; then
error "No items found to add, why are we running?"
exit 1
fi

echo -e "${GREEN}The redirects.csv is valid!${NC}"
exit 0
5 changes: 4 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ jobs:
run: echo "PRODUCTION_VERSION=$(npm run print-version --silent)" >> "$GITHUB_ENV"

- name: 🚀 Edit the release to be no longer a prerelease to deploy production 🚀
run: gh release edit ${{ env.PRODUCTION_VERSION }} --prerelease=false --latest
run: |
LATEST_RELEASE="$(gh release list --exclude-pre-releases --json tagName,isLatest --jq '.[] | select(.isLatest) | .tagName')"
gh api --method POST /repos/Expensify/App/releases/generate-notes -f "tag_name=${{ env.PRODUCTION_VERSION }}" -f "previous_tag_name=$LATEST_RELEASE" >> releaseNotes.md
gh release edit ${{ env.PRODUCTION_VERSION }} --prerelease=false --latest --notes-file releaseNotes.md
env:
GITHUB_TOKEN: ${{ steps.setupGitForOSBotify.outputs.OS_BOTIFY_API_TOKEN }}

Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/platformDeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,14 @@ jobs:
uses: ./.github/actions/composite/setupNode

- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'oracle'
java-version: '17'

- name: Setup Ruby
uses: ruby/setup-ruby@v1.187.0
uses: ruby/setup-ruby@v1.190.0
with:
ruby-version: '2.7'
bundler-cache: true

- name: Decrypt keystore
Expand Down Expand Up @@ -172,7 +171,7 @@ jobs:
needs: validateActor
if: ${{ fromJSON(needs.validateActor.outputs.IS_DEPLOYER) }}
env:
DEVELOPER_DIR: /Applications/Xcode_15.0.1.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_15.2.0.app/Contents/Developer
runs-on: macos-13-xlarge
steps:
- name: Checkout
Expand All @@ -186,9 +185,8 @@ jobs:
uses: ./.github/actions/composite/setupNode

- name: Setup Ruby
uses: ruby/setup-ruby@v1.187.0
uses: ruby/setup-ruby@v1.190.0
with:
ruby-version: '2.7'
bundler-cache: true

- name: Cache Pod dependencies
Expand Down
16 changes: 5 additions & 11 deletions .github/workflows/testBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,14 @@ jobs:
uses: ./.github/actions/composite/setupNode

- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'oracle'
java-version: '17'

- name: Setup Ruby
uses: ruby/setup-ruby@v1.187.0
uses: ruby/setup-ruby@v1.190.0
with:
ruby-version: '2.7'
bundler-cache: true

- name: Decrypt keystore
Expand Down Expand Up @@ -136,7 +135,7 @@ jobs:
if: ${{ fromJSON(needs.validateActor.outputs.READY_TO_BUILD) }}
env:
PULL_REQUEST_NUMBER: ${{ github.event.number || github.event.inputs.PULL_REQUEST_NUMBER }}
DEVELOPER_DIR: /Applications/Xcode_15.0.1.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_15.2.0.app/Contents/Developer
runs-on: macos-13-xlarge
steps:
- name: Checkout
Expand All @@ -158,12 +157,11 @@ jobs:
uses: ./.github/actions/composite/setupNode

- name: Setup XCode
run: sudo xcode-select -switch /Applications/Xcode_15.0.1.app
run: sudo xcode-select -switch /Applications/Xcode_15.2.0.app

- name: Setup Ruby
uses: ruby/setup-ruby@v1.187.0
uses: ruby/setup-ruby@v1.190.0
with:
ruby-version: '2.7'
bundler-cache: true

- name: Cache Pod dependencies
Expand Down Expand Up @@ -298,10 +296,6 @@ jobs:
- name: Build web for testing
run: npm run build-adhoc

- name: Build docs
run: npm run storybook-build
continue-on-error: true

- 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"

Expand Down
18 changes: 16 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ DerivedData
*.p12
*.mobileprovision
ios-fastlane-json-key.json
ios/.xcode.env.local
**/.xcode.env.local

# Android/IntelliJ
#
Expand Down Expand Up @@ -78,7 +78,7 @@ android/app/android-fastlane-json-key.json
*.jsbundle

# Ruby / CocoaPods
/ios/Pods/
**/Pods/
/vendor/bundle/

# Local DEV config
Expand Down Expand Up @@ -127,5 +127,19 @@ config/webpack/*.pem
dist/
web-build/

# Yarn
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# Storage location for downloaded app source maps (see scripts/symbolicate-profile.ts)
.sourcemaps/

# Jeykll
docs/.bundle

# Output of react compiler healthcheck dev script
react-compiler-output.txt
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.3.4
5 changes: 1 addition & 4 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {LocaleContextProvider} from '@src/components/LocaleContextProvider';
import OnyxProvider from '@src/components/OnyxProvider';
import {EnvironmentProvider} from '@src/components/withEnvironment';
import {KeyboardStateProvider} from '@src/components/withKeyboardState';
import {WindowDimensionsProvider} from '@src/components/withWindowDimensions';
import ONYXKEYS from '@src/ONYXKEYS';
import './fonts.css';

Expand All @@ -22,9 +21,7 @@ Onyx.init({

const decorators = [
(Story: React.ElementType) => (
<ComposeProviders
components={[OnyxProvider, LocaleContextProvider, HTMLEngineProvider, SafeAreaProvider, PortalProvider, EnvironmentProvider, KeyboardStateProvider, WindowDimensionsProvider]}
>
<ComposeProviders components={[OnyxProvider, LocaleContextProvider, HTMLEngineProvider, SafeAreaProvider, PortalProvider, EnvironmentProvider, KeyboardStateProvider]}>
<Story />
</ComposeProviders>
),
Expand Down
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
source "https://rubygems.org"

# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby ">= 2.6.10"
ruby ">= 3.3.4"

gem "cocoapods", "= 1.15.2"
gem "activesupport", ">= 6.1.7.3", "< 7.1.0"
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
gem "fastlane", "~> 2", ">= 2.222.0"
gem "xcpretty", "~> 0"

Expand Down
Loading

0 comments on commit 9e09789

Please sign in to comment.