Skip to content

Commit

Permalink
Merge branch 'main' into ts-migration/ref_types-39116
Browse files Browse the repository at this point in the history
  • Loading branch information
jnowakow committed May 6, 2024
2 parents f26dae7 + bb78140 commit 272db58
Show file tree
Hide file tree
Showing 604 changed files with 18,150 additions and 9,338 deletions.
23 changes: 22 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const restrictedImportPatterns = [

module.exports = {
extends: ['expensify', 'plugin:storybook/recommended', 'plugin:react-native-a11y/basic', 'plugin:@dword-design/import-alias/recommended', 'prettier'],
plugins: ['react-native-a11y'],
plugins: ['react-native-a11y', 'testing-library'],
parser: 'babel-eslint',
ignorePatterns: ['!.*', 'src/vendor', '.github/actions/**/index.js', 'desktop/dist/*.js', 'dist/*.js', 'node_modules/.bin/**', 'node_modules/.cache/**', '.git/**'],
env: {
Expand Down Expand Up @@ -122,13 +122,28 @@ module.exports = {
},
},
],
'rulesdir/avoid-anonymous-functions': 'off',
},
},
// This helps disable the `prefer-alias` rule to be enabled for specific directories
{
files: ['tests/**/*.js', 'tests/**/*.ts', 'tests/**/*.jsx', 'assets/**/*.js', '.storybook/**/*.js'],
rules: {'@dword-design/import-alias/prefer-alias': ['off']},
},
{
files: ['tests/**/*.js', 'tests/**/*.ts', 'tests/**/*.jsx', 'tests/**/*.tsx'],
extends: ['plugin:testing-library/react'],
rules: {
'testing-library/await-async-queries': 'error',
'testing-library/await-async-utils': 'error',
'testing-library/no-debugging-utils': 'error',
'testing-library/no-manual-cleanup': 'error',
'testing-library/no-unnecessary-act': 'error',
'testing-library/prefer-find-by': 'error',
'testing-library/prefer-presence-queries': 'error',
'testing-library/prefer-screen-queries': 'error',
},
},
{
files: ['*.js', '*.jsx'],
settings: {
Expand Down Expand Up @@ -276,5 +291,11 @@ module.exports = {
'no-restricted-syntax': ['error', 'ForInStatement', 'LabeledStatement', 'WithStatement'],
},
},
{
files: ['en.ts', 'es.ts'],
rules: {
'rulesdir/use-periods-for-error-messages': 'error',
},
},
],
};
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {promiseDoWhile} from '@github/libs/promiseWhile';
type CurrentStagingDeploys = Awaited<ReturnType<typeof GitHubUtils.octokit.actions.listWorkflowRuns>>['data']['workflow_runs'];

function run() {
console.info('[awaitStagingDeploys] POLL RATE', CONST.POLL_RATE);
console.info('[awaitStagingDeploys] run()');
console.info('[awaitStagingDeploys] getStringInput', getStringInput);
console.info('[awaitStagingDeploys] GitHubUtils', GitHubUtils);
Expand Down
8 changes: 7 additions & 1 deletion .github/actions/javascript/awaitStagingDeploys/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12131,6 +12131,7 @@ const CONST_1 = __importDefault(__nccwpck_require__(9873));
const GithubUtils_1 = __importDefault(__nccwpck_require__(9296));
const promiseWhile_1 = __nccwpck_require__(9438);
function run() {
console.info('[awaitStagingDeploys] POLL RATE', CONST_1.default.POLL_RATE);
console.info('[awaitStagingDeploys] run()');
console.info('[awaitStagingDeploys] getStringInput', ActionUtils_1.getStringInput);
console.info('[awaitStagingDeploys] GitHubUtils', GithubUtils_1.default);
Expand Down Expand Up @@ -12742,7 +12743,12 @@ function promiseWhile(condition, action) {
resolve();
return;
}
Promise.resolve(actionResult).then(loop).catch(reject);
Promise.resolve(actionResult)
.then(() => {
// Set a timeout to delay the next loop iteration
setTimeout(loop, 1000); // 1000 ms delay
})
.catch(reject);
}
};
loop();
Expand Down
7 changes: 6 additions & 1 deletion .github/libs/promiseWhile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ function promiseWhile(condition: () => boolean, action: (() => Promise<void>) |
return;
}

Promise.resolve(actionResult).then(loop).catch(reject);
Promise.resolve(actionResult)
.then(() => {
// Set a timeout to delay the next loop iteration
setTimeout(loop, 1000); // 1000 ms delay
})
.catch(reject);
}
};
loop();
Expand Down
44 changes: 34 additions & 10 deletions .github/workflows/failureNotifier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,49 @@ jobs:
});
return jobsData.data;
- name: Fetch Previous Workflow Run
id: previous-workflow-run
uses: actions/github-script@v7
with:
script: |
const runId = ${{ github.event.workflow_run.id }};
const allRuns = await github.rest.actions.listWorkflowRuns({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'preDeploy.yml',
});
const filteredRuns = allRuns.data.workflow_runs.filter(run => run.actor.login !== 'OSBotify' && run.status !== 'cancelled');
const currentIndex = filteredRuns.findIndex(run => run.id === runId);
const previousRun = filteredRuns[currentIndex + 1];
return previousRun;
- name: Fetch Previous Workflow Run Jobs
id: previous-workflow-jobs
uses: actions/github-script@v7
with:
script: |
const previousRun = ${{ steps.previous-workflow-run.outputs.result }};
const runId = previousRun.id;
const jobsData = await github.rest.actions.listJobsForWorkflowRun({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: runId,
});
return jobsData.data;
- name: Process Each Failed Job
uses: actions/github-script@v7
with:
script: |
const jobs = ${{ steps.fetch-workflow-jobs.outputs.result }};
const previousRun = ${{ steps.previous-workflow-run.outputs.result }};
const previousRunJobs = ${{ steps.previous-workflow-jobs.outputs.result }};
const headCommit = "${{ github.event.workflow_run.head_commit.id }}";
const prData = await github.rest.repos.listPullRequestsAssociatedWithCommit({
owner: context.repo.owner,
repo: context.repo.repo,
commit_sha: headCommit,
});
const pr = prData.data[0];
const prLink = pr.html_url;
const prAuthor = pr.user.login;
Expand All @@ -50,14 +80,8 @@ jobs:
if (jobs.jobs[i].conclusion == 'failure') {
const jobName = jobs.jobs[i].name;
const jobLink = jobs.jobs[i].html_url;
const issues = await github.rest.issues.listForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
labels: failureLabel,
state: 'open'
});
const existingIssue = issues.data.find(issue => issue.title.includes(jobName));
if (!existingIssue) {
const previousJob = previousRunJobs.jobs.find(job => job.name === jobName);
if (previousJob?.conclusion === 'success') {
const annotations = await github.rest.checks.listAnnotations({
owner: context.repo.owner,
repo: context.repo.repo,
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/platformDeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,11 @@ jobs:
MYAPP_UPLOAD_STORE_PASSWORD: ${{ secrets.MYAPP_UPLOAD_STORE_PASSWORD }}
MYAPP_UPLOAD_KEY_PASSWORD: ${{ secrets.MYAPP_UPLOAD_KEY_PASSWORD }}

# Note: Android production deploys are temporarily disabled until https://github.com/Expensify/App/issues/40108 is resolved
# - name: Run Fastlane production
# if: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }}
# run: bundle exec fastlane android production
# env:
# VERSION: ${{ env.VERSION_CODE }}
- name: Run Fastlane production
if: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }}
run: bundle exec fastlane android production
env:
VERSION: ${{ env.VERSION_CODE }}

- name: Archive Android sourcemaps
uses: actions/upload-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#### Table of Contents
* [Local Development](#local-development)
* [Testing on browsers on simulators and emulators](#testing-on-browsers-on-simulators-and-emulators)
* [Testing on browsers in simulators and emulators](#testing-on-browsers-in-simulators-and-emulators)
* [Running The Tests](#running-the-tests)
* [Debugging](#debugging)
* [App Structure and Conventions](#app-structure-and-conventions)
Expand Down
14 changes: 3 additions & 11 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,12 @@ apply plugin: "com.android.application"
apply plugin: "org.jetbrains.kotlin.android"
apply plugin: "com.facebook.react"
apply plugin: "com.google.firebase.firebase-perf"
apply plugin: "fullstory"
apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"

/**
* This is the configuration block to customize your React Native Android app.
* By default you don't need to apply any configuration, just uncomment the lines you need.
*/

/* Fullstory settings */
fullstory {
org 'o-1WN56P-na1'
enabledVariants 'all'
}

react {
/* Folders */
// The root of your project, i.e. where "package.json" lives. Default is '..'
Expand Down Expand Up @@ -106,8 +98,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1001046500
versionName "1.4.65-0"
versionCode 1001047002
versionName "1.4.70-2"
// Supported language variants must be declared here to avoid from being removed during the compilation.
// This also helps us to not include unnecessary language variants in the APK.
resConfigs "en", "es"
Expand Down Expand Up @@ -170,7 +162,7 @@ android {
signingConfig null
// buildTypes take precedence over productFlavors when it comes to the signing configuration,
// thus we need to manually set the signing config, so that the e2e uses the debug config again.
// In other words, the signingConfig setting above will be ignored when we build the flavor in release mode.
// In other words, the signingConfig setting above will be ignored when we build the flavor in release mode.
productFlavors.all { flavor ->
// All release builds should be signed with the release config ...
flavor.signingConfig signingConfigs.release
Expand Down
6 changes: 1 addition & 5 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,13 @@ buildscript {
repositories {
google()
mavenCentral()
maven {url "https://maven.fullstory.com"}
}
dependencies {
classpath("com.android.tools.build:gradle")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("com.google.gms:google-services:4.3.4")
classpath("com.google.firebase:firebase-crashlytics-gradle:2.7.1")
classpath("com.google.firebase:perf-plugin:1.4.1")
// Fullstory integration
classpath ("com.fullstory:gradle-plugin-local:1.45.1")

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
Expand Down Expand Up @@ -74,7 +70,7 @@ allprojects {
// 'mapbox' is the fixed username for Mapbox's Maven repository.
username = 'mapbox'

// The value for password is read from the 'MAPBOX_DOWNLOADS_TOKEN' gradle property.
// The value for password is read from the 'MAPBOX_DOWNLOADS_TOKEN' gradle property.
// Run "npm run setup-mapbox-sdk" to set this property in «USER_HOME»/.gradle/gradle.properties

// Example gradle.properties entry:
Expand Down
Binary file added assets/animations/Plane.lottie
Binary file not shown.
1 change: 1 addition & 0 deletions assets/images/all.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 10 additions & 1 deletion assets/images/arrow-right.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 10 additions & 1 deletion assets/images/back-left.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Loading

0 comments on commit 272db58

Please sign in to comment.