Skip to content

Commit

Permalink
merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
tienifr committed Nov 17, 2023
2 parents d489f94 + 88b1de1 commit 4748cff
Show file tree
Hide file tree
Showing 490 changed files with 2,423 additions and 1,378 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
**/node_modules/*
**/dist/*
.github/actions/**/index.js"
docs/vendor/**
3 changes: 0 additions & 3 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
# Every PR gets a review from an internal Expensify engineer
* @Expensify/pullerbear

# Every PR that touches redirects gets reviewed by ring0
docs/redirects.csv @Expensify/infra
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ runs:
fi
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
if: steps.key_check.outputs.key_exists != 'true'
with:
sparse-checkout: |
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/composite/setupNode/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Set up Node
runs:
using: composite
steps:
- uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: npm
Expand Down
42 changes: 30 additions & 12 deletions .github/actions/javascript/createOrUpdateStagingDeploy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,20 +194,38 @@ const {getPreviousVersion, SEMANTIC_VERSION_LEVELS} = __nccwpck_require__(8007);
*/
function fetchTag(tag) {
const previousPatchVersion = getPreviousVersion(tag, SEMANTIC_VERSION_LEVELS.PATCH);
try {
let command = `git fetch origin tag ${tag} --no-tags`;
let shouldRetry = true;
let needsRepack = false;
while (shouldRetry) {
try {
if (needsRepack) {
// We have seen some scenarios where this fixes the git fetch.
// Why? Who knows... https://github.com/Expensify/App/pull/31459
execSync('git repack -d');
}

// Exclude commits reachable from the previous patch version (i.e: previous checklist),
// so that we don't have to fetch the full history
// Note that this condition would only ever _not_ be true in the 1.0.0-0 edge case
if (previousPatchVersion !== tag) {
command += ` --shallow-exclude=${previousPatchVersion}`;
}
let command = `git fetch origin tag ${tag} --no-tags`;

console.log(`Running command: ${command}`);
execSync(command);
} catch (e) {
console.error(e);
// Exclude commits reachable from the previous patch version (i.e: previous checklist),
// so that we don't have to fetch the full history
// Note that this condition would only ever _not_ be true in the 1.0.0-0 edge case
if (previousPatchVersion !== tag) {
command += ` --shallow-exclude=${previousPatchVersion}`;
}

console.log(`Running command: ${command}`);
execSync(command);
shouldRetry = false;
} catch (e) {
console.error(e);
if (!needsRepack) {
console.log('Attempting to repack and retry...');
needsRepack = true;
} else {
console.error("Repack didn't help, giving up...");
shouldRetry = false;
}
}
}
}

Expand Down
42 changes: 30 additions & 12 deletions .github/actions/javascript/getDeployPullRequestList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,20 +136,38 @@ const {getPreviousVersion, SEMANTIC_VERSION_LEVELS} = __nccwpck_require__(8007);
*/
function fetchTag(tag) {
const previousPatchVersion = getPreviousVersion(tag, SEMANTIC_VERSION_LEVELS.PATCH);
try {
let command = `git fetch origin tag ${tag} --no-tags`;
let shouldRetry = true;
let needsRepack = false;
while (shouldRetry) {
try {
if (needsRepack) {
// We have seen some scenarios where this fixes the git fetch.
// Why? Who knows... https://github.com/Expensify/App/pull/31459
execSync('git repack -d');
}

// Exclude commits reachable from the previous patch version (i.e: previous checklist),
// so that we don't have to fetch the full history
// Note that this condition would only ever _not_ be true in the 1.0.0-0 edge case
if (previousPatchVersion !== tag) {
command += ` --shallow-exclude=${previousPatchVersion}`;
}
let command = `git fetch origin tag ${tag} --no-tags`;

console.log(`Running command: ${command}`);
execSync(command);
} catch (e) {
console.error(e);
// Exclude commits reachable from the previous patch version (i.e: previous checklist),
// so that we don't have to fetch the full history
// Note that this condition would only ever _not_ be true in the 1.0.0-0 edge case
if (previousPatchVersion !== tag) {
command += ` --shallow-exclude=${previousPatchVersion}`;
}

console.log(`Running command: ${command}`);
execSync(command);
shouldRetry = false;
} catch (e) {
console.error(e);
if (!needsRepack) {
console.log('Attempting to repack and retry...');
needsRepack = true;
} else {
console.error("Repack didn't help, giving up...");
shouldRetry = false;
}
}
}
}

Expand Down
44 changes: 31 additions & 13 deletions .github/libs/GitUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,38 @@ const {getPreviousVersion, SEMANTIC_VERSION_LEVELS} = require('../libs/versionUp
*/
function fetchTag(tag) {
const previousPatchVersion = getPreviousVersion(tag, SEMANTIC_VERSION_LEVELS.PATCH);
try {
let command = `git fetch origin tag ${tag} --no-tags`;

// Exclude commits reachable from the previous patch version (i.e: previous checklist),
// so that we don't have to fetch the full history
// Note that this condition would only ever _not_ be true in the 1.0.0-0 edge case
if (previousPatchVersion !== tag) {
command += ` --shallow-exclude=${previousPatchVersion}`;
}
let shouldRetry = true;
let needsRepack = false;
while (shouldRetry) {
try {
if (needsRepack) {
// We have seen some scenarios where this fixes the git fetch.
// Why? Who knows... https://github.com/Expensify/App/pull/31459
execSync('git repack -d');
}

console.log(`Running command: ${command}`);
execSync(command);
} catch (e) {
console.error(e);
let command = `git fetch origin tag ${tag} --no-tags`;

// Exclude commits reachable from the previous patch version (i.e: previous checklist),
// so that we don't have to fetch the full history
// Note that this condition would only ever _not_ be true in the 1.0.0-0 edge case
if (previousPatchVersion !== tag) {
command += ` --shallow-exclude=${previousPatchVersion}`;
}

console.log(`Running command: ${command}`);
execSync(command);
shouldRetry = false;
} catch (e) {
console.error(e);
if (!needsRepack) {
console.log('Attempting to repack and retry...');
needsRepack = true;
} else {
console.error("Repack didn't help, giving up...");
shouldRetry = false;
}
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ Due to the large, ever-growing history of this repo, do not do any full-fetches

```yaml
# Bad
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
# Good
- uses: actions/checkout@v3
- uses: actions/checkout@v4
```

```sh
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cherryPick.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout staging branch
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: staging
token: ${{ secrets.OS_BOTIFY_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/createNewVersion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
GITHUB_TOKEN: ${{ github.token }}

- name: Check out
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: main
# The OS_BOTIFY_COMMIT_TOKEN is a personal access token tied to osbotify
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/production'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
name: Checkout
with:
ref: production
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deployBlocker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/e2ePerformanceTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
outputs:
VERSION: ${{ steps.getMostRecentRelease.outputs.VERSION }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Get most recent release version
id: getMostRecentRelease
Expand Down Expand Up @@ -78,7 +78,7 @@ jobs:
outputs:
DELTA_REF: ${{ steps.getDeltaRef.outputs.DELTA_REF }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Get pull request details
id: getPullRequestDetails
Expand Down Expand Up @@ -154,7 +154,7 @@ jobs:
needs: [buildBaseline, buildDelta]
name: Run E2E tests in AWS device farm
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup Node
uses: Expensify/App/.github/actions/composite/setupNode@main
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/finishReleaseCycle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
isValid: ${{ fromJSON(steps.isDeployer.outputs.IS_DEPLOYER) && !fromJSON(steps.checkDeployBlockers.outputs.HAS_DEPLOY_BLOCKERS) }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: main
token: ${{ secrets.OS_BOTIFY_TOKEN }}
Expand Down Expand Up @@ -77,7 +77,7 @@ jobs:
if: ${{ fromJSON(needs.validate.outputs.isValid) }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: staging
token: ${{ secrets.OS_BOTIFY_TOKEN }}
Expand Down Expand Up @@ -119,7 +119,7 @@ jobs:
needs: [updateProduction, createNewPatchVersion]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: main
token: ${{ secrets.OS_BOTIFY_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Node
uses: Expensify/App/.github/actions/composite/setupNode@main
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lockDeploys.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: macos-12
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: main
token: ${{ secrets.OS_BOTIFY_TOKEN }}
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/platformDeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
needs: validateActor
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Node
uses: Expensify/App/.github/actions/composite/setupNode@main

Expand All @@ -62,7 +62,7 @@ jobs:
runs-on: ubuntu-latest-xl
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Configure MapBox SDK
run: ./scripts/setup-mapbox-sdk.sh ${{ secrets.MAPBOX_SDK_DOWNLOAD_TOKEN }}
Expand Down Expand Up @@ -146,7 +146,7 @@ jobs:
runs-on: macos-12-xl
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Node
uses: Expensify/App/.github/actions/composite/setupNode@main
Expand Down Expand Up @@ -185,7 +185,7 @@ jobs:
runs-on: macos-13-xlarge
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Configure MapBox SDK
run: ./scripts/setup-mapbox-sdk.sh ${{ secrets.MAPBOX_SDK_DOWNLOAD_TOKEN }}
Expand Down Expand Up @@ -297,7 +297,7 @@ jobs:
runs-on: ubuntu-latest-xl
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Node
uses: Expensify/App/.github/actions/composite/setupNode@main
Expand Down Expand Up @@ -367,7 +367,7 @@ jobs:
needs: [android, desktop, iOS, web]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set version
run: echo "VERSION=$(npm run print-version --silent)" >> "$GITHUB_ENV"
Expand Down Expand Up @@ -428,7 +428,7 @@ jobs:
needs: [android, desktop, iOS, web]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Node
uses: Expensify/App/.github/actions/composite/setupNode@main
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/preDeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
GITHUB_TOKEN: ${{ github.token }}

- name: Checkout main
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: main
token: ${{ secrets.OS_BOTIFY_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reassurePerformanceTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup NodeJS
uses: Expensify/App/.github/actions/composite/setupNode@main
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/shellCheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Lint shell scripts with ShellCheck
run: npm run shellcheck
Loading

0 comments on commit 4748cff

Please sign in to comment.