Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update version to 1.0.89-0 on staging #4938

Merged
merged 38 commits into from
Aug 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
01d5c3d
Refactor the componentDidUpdate for ReportActionCompose
mountiny Aug 20, 2021
edbd04a
#4517 update timezone on user activity
dklymenk Aug 24, 2021
81e979c
add timeout to updateTimezone call on app start
dklymenk Aug 24, 2021
7f948fe
#4517 avoid init check race conditions
dklymenk Aug 24, 2021
b2944dd
revert init timezone check
dklymenk Aug 24, 2021
56dfcf0
Refactor and return early
mountiny Aug 25, 2021
57ec194
Refactor componentDidUpdate in ReportScreen as well and update comments
mountiny Aug 25, 2021
9eb84c0
Remove redundant comment
mountiny Aug 25, 2021
a27e869
Update the comment to give better description and reason for the change
mountiny Aug 25, 2021
c69f4bd
Merge branch 'main' into 4517-update-timezone-automatically
dklymenk Aug 26, 2021
cf56c01
Add string comparison to boolean expressions
roryabraham Aug 30, 2021
6afeb96
Revert regex changes for :ship-it: comment
AndrewGable Aug 30, 2021
dce2f14
Rebuild actions
AndrewGable Aug 30, 2021
a615b74
Fix incorrect boolean check swap
roryabraham Aug 30, 2021
337f59c
Merge pull request #4915 from Expensify/Rory-FixDeployPermissions
roryabraham Aug 30, 2021
838d130
Update version to 1.0.88-4
Aug 30, 2021
56cfda2
Merge pull request #4920 from Expensify/version-BUILD-337f59c9818c28f…
OSBotify Aug 30, 2021
3a40aed
Tie workspace id to reimbursement account setup
Aug 30, 2021
ac44cbf
Clean up comment
Aug 30, 2021
36dc811
Merge pull request #4768 from Expensify/vit-refactorTheReportActionCo…
marcaaron Aug 30, 2021
ec9a319
Merge pull request #4799 from dklymenk/4517-update-timezone-automatic…
tylerkaraszewski Aug 30, 2021
1803120
Merge pull request #4923 from Expensify/amal-bank-account-workspace-id
robertjchen Aug 30, 2021
9aff6e8
Properly JSON-decode outputs
roryabraham Aug 30, 2021
486bdf4
Merge pull request #4927 from Expensify/Rory-FixDeployConditionals
roryabraham Aug 30, 2021
b3e83cb
Update version to 1.0.88-5
Aug 30, 2021
3a56d97
Merge pull request #4930 from Expensify/version-BUILD-486bdf409d544c5…
OSBotify Aug 30, 2021
d83adcf
Merge pull request #4917 from Expensify/andrew-revert-regex
roryabraham Aug 30, 2021
d77d449
Make dummy change in README
roryabraham Aug 30, 2021
3c46b66
Merge pull request #4931 from Expensify/Rory-DummyPR
Luke9389 Aug 30, 2021
79fed90
Update version to 1.0.88-6
Aug 30, 2021
6587e17
Merge pull request #4933 from Expensify/version-BUILD-3c46b66a601ef44…
OSBotify Aug 30, 2021
8750677
Make dummy change
roryabraham Aug 30, 2021
e5c800f
Merge pull request #4934 from Expensify/Rory-DummyPR
thienlnam Aug 30, 2021
e1b32ab
Update version to 1.0.88-7
Aug 30, 2021
af35e50
Merge pull request #4935 from Expensify/version-BUILD-e5c800f48232f39…
OSBotify Aug 30, 2021
acad47d
Update version to 1.0.89-0
Aug 31, 2021
93ee9e5
Merge pull request #4937 from Expensify/version-PATCH-af35e50da629898…
OSBotify Aug 31, 2021
2305c63
Merge branch 'main' into update-staging-from-main
Aug 31, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const run = function () {

console.log('Verifying that the last comment is the :shipit: seal of approval');
const lastComment = comments.data.pop();
const shipItRegex = /:shipit:/g;
const shipItRegex = /^:shipit:/g;
if (_.isNull(shipItRegex.exec(lastComment.body))) {
console.log('The last comment on the issue was not :shipit');
core.setOutput('HAS_DEPLOY_BLOCKERS', true);
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/checkDeployBlockers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const run = function () {

console.log('Verifying that the last comment is the :shipit: seal of approval');
const lastComment = comments.data.pop();
const shipItRegex = /:shipit:/g;
const shipItRegex = /^:shipit:/g;
if (_.isNull(shipItRegex.exec(lastComment.body))) {
console.log('The last comment on the issue was not :shipit');
core.setOutput('HAS_DEPLOY_BLOCKERS', true);
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,42 @@
# [New Expensify](https://new.expensify.com) GitHub Workflows

## Important tip for creating GitHub Workflows
All inputs and outputs to GitHub Actions and any data passed between jobs or workflows is JSON-encoded (AKA, strings). Keep this in mind whenever writing GitHub workflows – you may need to JSON-decode variables to access them accurately. Here's an example of a common way to misuse GitHub Actions data:

```yaml
name: CI
on: pull_request
jobs:
validate:
runs-on: ubuntu-latest
steps:
- id: myTrueAction
uses: Expensify/my-action-outputs-true@main

- id: myFalseAction
uses: Expensify/my-action-outputs-false@main

# This correctly outputs `true`, but it's a string
- run: echo ${{ steps.myTrueAction.outputs.isTrue }}

# This correctly outputs `false`, but it's a string
- run: echo ${{ steps.myFalseAction.outputs.isFalse }}

# This correctly outputs `true`, and it's a boolean
- run: echo ${{ true == true }}

# This correctly outputs `false`, and it's a boolean.
- run: echo ${{ true == false }}

# Watch out! This seems like it should be true, but it's false!
# What we have here is `'false' || true`, and since the first half is a string the expression resolves to 'false'
- run: echo ${{ steps.myFalseAction.outputs.isFalse || github.actor == 'roryabraham' }}
```

We've found that the best way to avoid this pitfall is to always wrap any reference to the output of an action in a call to `fromJSON`. This should force it to resolve to the expected type.

**Note:** Action inputs and outputs aren't the only thing that's JSON-encoded! Any data passed between jobs via a `needs` parameter is also JSON-encoded!

## Security Rules 🔐
1. Do **not** use `pull_request_target` trigger unless an external fork needs access to secrets, or a _write_ `GITHUB_TOKEN`.
1. Do **not ever** write a `pull_request_target` trigger with an explicit PR checkout, e.g. using `actions/checkout@v2`. This is [discussed further here](https://securitylab.github.com/research/github-actions-preventing-pwn-requests)
Expand Down Expand Up @@ -94,3 +131,5 @@ There are several reasons why we created these "imperative workflows" or "subrou
1. It greatly simplifies the handling of race conditions, particularly when used in combination with the [`softprops/turnstyle` action](https://github.com/softprops/turnstyle).
1. It promotes code reuse. A common set of yaml steps defined in a workflow can be extracted into an imperative workflow which can be executed from other workflows in just a few lines.
1. If a workflow is defined to execute in response to the `workflow_dispatch` event, it can be manually started by an authorized actor in the GitHub UI.

#### Dummy change - delete me
6 changes: 3 additions & 3 deletions .github/workflows/cherryPick.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
validateActor:
runs-on: ubuntu-latest
outputs:
IS_DEPLOYER: ${{ steps.isUserDeployer.outputs.isTeamMember || github.actor == 'OSBotify' }}
IS_DEPLOYER: ${{ fromJSON(steps.isUserDeployer.outputs.isTeamMember) || github.actor == 'OSBotify' }}
steps:
- id: isUserDeployer
uses: tspascoal/get-user-teams-membership@baf2e6adf4c3b897bd65a7e3184305c165aec872
Expand All @@ -27,7 +27,7 @@ jobs:
createNewVersion:
needs: validateActor
runs-on: ubuntu-latest
if: ${{ needs.validateActor.outputs.IS_DEPLOYER && github.event.inputs.NEW_VERSION == '' }}
if: ${{ needs.validateActor.outputs.IS_DEPLOYER == 'true' && github.event.inputs.NEW_VERSION == '' }}
outputs:
NEW_VERSION: ${{ steps.getNewVersion.outputs.NEW_VERSION }}
steps:
Expand Down Expand Up @@ -59,7 +59,7 @@ jobs:

cherryPick:
needs: [validateActor, createNewVersion]
if: ${{ always() && needs.validateActor.outputs.IS_DEPLOYER }}
if: ${{ always() && needs.validateActor.outputs.IS_DEPLOYER == 'true' }}
runs-on: ubuntu-latest
steps:
# Version: 2.3.4
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/finishReleaseCycle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
if: contains(github.event.issue.labels.*.name, 'StagingDeployCash')

outputs:
isValid: ${{ steps.validateActor.outputs.isTeamMember && steps.checkDeployBlockers.outputs.HAS_DEPLOY_BLOCKERS == 'false' }}
isValid: ${{ fromJSON(steps.validateActor.outputs.isTeamMember) && !fromJSON(steps.checkDeployBlockers.outputs.HAS_DEPLOY_BLOCKERS) }}

steps:
- name: Validate actor is deployer
Expand All @@ -23,7 +23,7 @@ jobs:
team: mobile-deployers

- name: Reopen and comment on issue
if: ${{ !steps.validateActor.outputs.isTeamMember }}
if: ${{ steps.validateActor.outputs.isTeamMember == 'false' }}
uses: Expensify/App/.github/actions/reopenIssueWithComment@main
with:
GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }}
Expand All @@ -33,15 +33,15 @@ jobs:
Reopening!

- name: Check for any deploy blockers
if: ${{ steps.validateActor.outputs.isTeamMember }}
if: ${{ steps.validateActor.outputs.isTeamMember == 'true' }}
id: checkDeployBlockers
uses: Expensify/App/.github/actions/checkDeployBlockers@main
with:
GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }}
ISSUE_NUMBER: ${{ github.event.issue.number }}

- name: Reopen and comment on issue
if: ${{ steps.validateActor.outputs.isTeamMember && steps.checkDeployBlockers.outputs.HAS_DEPLOY_BLOCKERS == 'true' }}
if: ${{ steps.validateActor.outputs.isTeamMember == 'true' && steps.checkDeployBlockers.outputs.HAS_DEPLOY_BLOCKERS == 'true' }}
uses: Expensify/App/.github/actions/reopenIssueWithComment@main
with:
GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }}
Expand All @@ -54,7 +54,7 @@ jobs:
updateProduction:
runs-on: ubuntu-latest
needs: validate
if: ${{ needs.validate.outputs.isValid }}
if: ${{ needs.validate.outputs.isValid == 'true' }}
steps:
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
with:
Expand All @@ -72,7 +72,7 @@ jobs:
createNewStagingDeployCash:
runs-on: macos-11
needs: validate
if: ${{ needs.validate.outputs.isValid }}
if: ${{ needs.validate.outputs.isValid == 'true' }}
steps:
# Version: 2.3.4
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/platformDeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
android:
name: Build and deploy Android
needs: validateActor
if: ${{ needs.validateActor.outputs.IS_DEPLOYER }}
if: ${{ needs.validateActor.outputs.IS_DEPLOYER == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -92,7 +92,7 @@ jobs:
desktop:
name: Build and deploy Desktop
needs: validateActor
if: ${{ needs.validateActor.outputs.IS_DEPLOYER }}
if: ${{ needs.validateActor.outputs.IS_DEPLOYER == 'true' }}
runs-on: macos-11
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -148,7 +148,7 @@ jobs:
iOS:
name: Build and deploy iOS
needs: validateActor
if: ${{ needs.validateActor.outputs.IS_DEPLOYER }}
if: ${{ needs.validateActor.outputs.IS_DEPLOYER == 'true' }}
runs-on: macos-11
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -232,7 +232,7 @@ jobs:
web:
name: Build and deploy Web
needs: validateActor
if: ${{ needs.validateActor.outputs.IS_DEPLOYER }}
if: ${{ needs.validateActor.outputs.IS_DEPLOYER == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1001008807
versionName "1.0.88-7"
versionCode 1001008900
versionName "1.0.89-0"
}
splits {
abi {
Expand Down
4 changes: 2 additions & 2 deletions ios/NewExpensify/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.88</string>
<string>1.0.89</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand All @@ -30,7 +30,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.0.88.7</string>
<string>1.0.89.0</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationQueriesSchemes</key>
Expand Down
4 changes: 2 additions & 2 deletions ios/NewExpensifyTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.88</string>
<string>1.0.89</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0.88.7</string>
<string>1.0.89.0</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "new.expensify",
"version": "1.0.88-7",
"version": "1.0.89-0",
"author": "Expensify, Inc.",
"homepage": "https://new.expensify.com",
"description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.",
Expand Down
3 changes: 3 additions & 0 deletions src/ONYXKEYS.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,7 @@ export default {

// Stores information about the active reimbursement account being set up
REIMBURSEMENT_ACCOUNT: 'reimbursementAccount',

// Stores Workspace ID that will be tied to reimbursement account during setup
REIMBURSEMENT_ACCOUNT_WORKSPACE_ID: 'reimbursementAccountWorkspaceID',
};
30 changes: 21 additions & 9 deletions src/libs/DateUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,13 @@ import Onyx from 'react-native-onyx';
import ONYXKEYS from '../ONYXKEYS';
import CONST from '../CONST';
import {translate} from './translate';
import * as PersonalDetails from './actions/PersonalDetails';

let timezone;
Onyx.connect({
key: ONYXKEYS.MY_PERSONAL_DETAILS,
callback: (val) => {
timezone = val ? val.timezone : CONST.DEFAULT_TIME_ZONE.selected;

// Make sure that if we have a timezone in object format that we're getting the selected timezone name
// Older timezone formats only include the timezone name, but the newer format also included whether or
// not the timezone was selected automatically
if (_.isObject(timezone)) {
timezone = val.timezone.selected;
}
timezone = val ? val.timezone : CONST.DEFAULT_TIME_ZONE;
},
});

Expand All @@ -37,7 +31,7 @@ Onyx.connect({
*/
function getLocalMomentFromTimestamp(locale, timestamp) {
moment.locale(locale);
return moment.unix(timestamp).tz(timezone);
return moment.unix(timestamp).tz(timezone.selected);
}

/**
Expand Down Expand Up @@ -115,13 +109,31 @@ function startCurrentDateUpdater() {
});
}

/*
* Updates user's timezone, if their timezone is set to automatic and
* is different from current timezone
*/
function updateTimezone() {
const currentTimezone = moment.tz.guess(true);
if (timezone.automatic && timezone.selected !== currentTimezone) {
PersonalDetails.setPersonalDetails({timezone: {...timezone, selected: currentTimezone}});
}
}

/*
* Returns a version of updateTimezone function throttled by 5 minutes
*/
const throttledUpdateTimezone = _.throttle(() => updateTimezone(), 1000 * 60 * 5);

/**
* @namespace DateUtils
*/
const DateUtils = {
timestampToRelative,
timestampToDateTime,
startCurrentDateUpdater,
updateTimezone,
throttledUpdateTimezone,
};

export default DateUtils;
15 changes: 14 additions & 1 deletion src/libs/actions/BankAccounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ Onyx.connect({
},
});

let reimbursementAccountWorkspaceID = null;
Onyx.connect({
key: ONYXKEYS.REIMBURSEMENT_ACCOUNT_WORKSPACE_ID,
callback: (val) => {
reimbursementAccountWorkspaceID = val;
},
});

/**
* Gets the Plaid Link token used to initialize the Plaid SDK
*/
Expand Down Expand Up @@ -409,7 +417,7 @@ function fetchFreePlanVerifiedBankAccount(stepToOpen) {
let currentStep = reimbursementAccountInSetup.currentStep;
const achData = bankAccount ? bankAccount.toACHData() : {};
achData.useOnfido = true;
achData.policyID = '';
achData.policyID = reimbursementAccountWorkspaceID || '';
achData.isInSetup = !bankAccount || bankAccount.isInSetup();
achData.bankAccountInReview = bankAccount && bankAccount.isVerifying();
achData.domainLimit = 0;
Expand Down Expand Up @@ -803,6 +811,10 @@ function hideBankAccountErrors() {
Onyx.merge(ONYXKEYS.REIMBURSEMENT_ACCOUNT, {error: '', existingOwnersList: ''});
}

function setWorkspaceIDForReimbursementAccount(workspaceID) {
Onyx.merge(ONYXKEYS.REIMBURSEMENT_ACCOUNT_WORKSPACE_ID, workspaceID);
}

export {
activateWallet,
addPersonalBankAccount,
Expand All @@ -817,4 +829,5 @@ export {
validateBankAccount,
hideBankAccountErrors,
showBankAccountFormValidationError,
setWorkspaceIDForReimbursementAccount,
};
9 changes: 5 additions & 4 deletions src/pages/home/ReportScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,12 @@ class ReportScreen extends React.Component {
}

componentDidUpdate(prevProps) {
const reportChanged = this.props.route.params.reportID !== prevProps.route.params.reportID;
if (reportChanged) {
this.prepareTransition();
this.storeCurrentlyViewedReport();
if (this.props.route.params.reportID === prevProps.route.params.reportID) {
return;
}

this.prepareTransition();
this.storeCurrentlyViewedReport();
}

componentWillUnmount() {
Expand Down
Loading