Skip to content

Commit

Permalink
Merge branch 'main' into kidroca/feature/new-desktop-config
Browse files Browse the repository at this point in the history
  • Loading branch information
kidroca committed Feb 25, 2022
2 parents e1b0861 + d586981 commit e6df824
Show file tree
Hide file tree
Showing 109 changed files with 1,774 additions and 828 deletions.
13 changes: 7 additions & 6 deletions .github/ISSUE_TEMPLATE/Standard.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Describe what actually happened
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

## Platform:
<!---
<!---
Remove any platforms that aren't affected by this issue
--->
Where is this issue occurring?
Expand All @@ -31,13 +31,14 @@ Where is this issue occurring?
- Desktop App
- Mobile Web

**Version Number:**
**Reproducible in staging?:**
**Reproducible in production?:**
**Version Number:**
**Reproducible in staging?:**
**Reproducible in production?:**
**Email or phone of affected tester (no customers):**
**Logs:** https://stackoverflow.com/c/expensify/questions/4856
**Notes/Photos/Videos:** Any additional supporting documentation
**Expensify/Expensify Issue URL:**
**Issue reported by:**
**Expensify/Expensify Issue URL:**
**Issue reported by:**
**Slack conversation:**

[View all open jobs on GitHub](https://github.com/Expensify/App/issues?q=is%3Aopen+is%3Aissue+label%3A%22Help+Wanted%22)
36 changes: 36 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,42 @@ For example:

- [ ] Verify that no errors appear in the JS console

### PR Review Checklist
<!--
This is a checklist for PR authors & reviewers. Please make sure to complete all tasks and check them off once you do, or else Expensify has the right not to merge your PR!
-->
#### Contributor (PR Author) Checklist
- [ ] I made sure to pull `main` before submitting my PR for review
- [ ] I linked the correct issue in the `### Fixed Issues` section above
- [ ] I wrote clear testing steps that cover the changes made in this PR
- [ ] I clearly indicated the environment tests should be run in (Staging vs Production)
- [ ] I wrote testing steps that cover success & fail scenarios (if applicable)
- [ ] I ran the tests & they passed on **all platforms**
- [ ] I included screenshots or videos for tests on [all platforms](https://github.com/Expensify/App/blob/main/CONTRIBUTING.md#make-sure-you-can-test-on-all-platforms)
- [ ] I verified there are no console errors related to changes in this PR
- [ ] I followed proper code patterns (see [Reviewing the code](../PR_REVIEW_GUIDELINES.md#reviewing-the-code))
- [ ] I added comments when the code was not self explanatory
- [ ] I put all copy / text shown in the product in all `src/languages/*` files (if applicable)
- [ ] I followed proper naming convention for platform-specific files (if applicable)
- [ ] I followed style guidelines (in [`Styling.md`](../STYLING.md)) for all style edits I made
- [ ] I followed the guidelines as stated in the [Review Guidelines](../PR_REVIEW_GUIDELINES.md)

#### PR Reviewer Checklist
- [ ] I verified the Author pulled `main` before submitting the PR
- [ ] I verified the correct issue is linked in the `### Fixed Issues` section above
- [ ] I verified testing steps are clear and they cover the changes made in this PR
- [ ] I verified the testing environment is mentioned in the test steps
- [ ] I verified testing steps cover success & fail scenarios (if applicable)
- [ ] I verified tests pass on **all platforms** & I tested again on all platforms
- [ ] I checked that screenshots or videos are included for tests on [all platforms](https://github.com/Expensify/App/blob/main/CONTRIBUTING.md#make-sure-you-can-test-on-all-platforms)
- [ ] I verified there are no console errors related to changes in this PR
- [ ] I verified proper code patterns were followed (see [Reviewing the code](../PR_REVIEW_GUIDELINES.md#reviewing-the-code))
- [ ] I verified comments were added when the code was not self explanatory
- [ ] I verified any copy / text shown in the product was added in all `src/languages/*` files (if applicable)
- [ ] I verified proper naming convention for platform-specific files was followed (if applicable)
- [ ] I verified [style guidelines](../STYLING.md) were followed
- [ ] I verified that this PR follows the guidelines as stated in the [Review Guidelines](../PR_REVIEW_GUIDELINES.md)

### QA Steps
<!---
Add a numbered list of manual tests that can be performed by our QA engineers on the staging environment to validate that your changes work on all platforms, and that there are no regressions present.
Expand Down
3 changes: 3 additions & 0 deletions .github/actions/awaitStagingDeploys/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ inputs:
GITHUB_TOKEN:
description: Auth token for New Expensify Github
required: true
TAG:
description: If provided, this action will only wait for a deploy matching this tag.
required: false
runs:
using: 'node12'
main: './index.js'
18 changes: 12 additions & 6 deletions .github/actions/awaitStagingDeploys/awaitStagingDeploys.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
const _ = require('underscore');
const ActionUtils = require('../../libs/ActionUtils');
const GitHubUtils = require('../../libs/GithubUtils');
const {promiseDoWhile} = require('../../libs/promiseWhile');

function run() {
const tag = ActionUtils.getStringInput('TAG', {required: false});
let currentStagingDeploys = [];
return promiseDoWhile(
() => !_.isEmpty(currentStagingDeploys),
Expand All @@ -14,20 +16,24 @@ function run() {
repo: GitHubUtils.APP_REPO,
workflow_id: 'platformDeploy.yml',
event: 'push',
branch: tag,
}),

// These have the potential to become active deploys, so we need to wait for them to finish as well
// These have the potential to become active deploys, so we need to wait for them to finish as well (unless we're looking for a specific tag)
// In this context, we'll refer to unresolved preDeploy workflow runs as staging deploys as well
GitHubUtils.octokit.actions.listWorkflowRuns({
!tag && GitHubUtils.octokit.actions.listWorkflowRuns({
owner: GitHubUtils.GITHUB_OWNER,
repo: GitHubUtils.APP_REPO,
workflow_id: 'preDeploy.yml',
}),
])
.then(responses => [
...responses[0].data.workflow_runs,
...responses[1].data.workflow_runs,
])
.then((responses) => {
const workflowRuns = responses[0].data.workflow_runs;
if (!tag) {
workflowRuns.push(...responses[1].data.workflow_runs);
}
return workflowRuns;
})
.then(workflowRuns => currentStagingDeploys = _.filter(workflowRuns, workflowRun => workflowRun.status !== 'completed'))
.then(() => console.log(
_.isEmpty(currentStagingDeploys)
Expand Down
64 changes: 58 additions & 6 deletions .github/actions/awaitStagingDeploys/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ module.exports =
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {

const _ = __nccwpck_require__(3571);
const ActionUtils = __nccwpck_require__(970);
const GitHubUtils = __nccwpck_require__(7999);
const {promiseDoWhile} = __nccwpck_require__(4502);

function run() {
const tag = ActionUtils.getStringInput('TAG', {required: false});
let currentStagingDeploys = [];
return promiseDoWhile(
() => !_.isEmpty(currentStagingDeploys),
Expand All @@ -24,20 +26,24 @@ function run() {
repo: GitHubUtils.APP_REPO,
workflow_id: 'platformDeploy.yml',
event: 'push',
branch: tag,
}),

// These have the potential to become active deploys, so we need to wait for them to finish as well
// These have the potential to become active deploys, so we need to wait for them to finish as well (unless we're looking for a specific tag)
// In this context, we'll refer to unresolved preDeploy workflow runs as staging deploys as well
GitHubUtils.octokit.actions.listWorkflowRuns({
!tag && GitHubUtils.octokit.actions.listWorkflowRuns({
owner: GitHubUtils.GITHUB_OWNER,
repo: GitHubUtils.APP_REPO,
workflow_id: 'preDeploy.yml',
}),
])
.then(responses => [
...responses[0].data.workflow_runs,
...responses[1].data.workflow_runs,
])
.then((responses) => {
const workflowRuns = responses[0].data.workflow_runs;
if (!tag) {
workflowRuns.push(...responses[1].data.workflow_runs);
}
return workflowRuns;
})
.then(workflowRuns => currentStagingDeploys = _.filter(workflowRuns, workflowRun => workflowRun.status !== 'completed'))
.then(() => console.log(
_.isEmpty(currentStagingDeploys)
Expand All @@ -58,6 +64,52 @@ if (require.main === require.cache[eval('__filename')]) {
module.exports = run;


/***/ }),

/***/ 970:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {

const core = __nccwpck_require__(2186);

/**
* Safely parse a JSON input to a GitHub Action.
*
* @param {String} name - The name of the input.
* @param {Object} options - Options to pass to core.getInput
* @param {*} [defaultValue] - A default value to provide for the input.
* Not required if the {required: true} option is given in the second arg to this function.
* @returns {any}
*/
function getJSONInput(name, options, defaultValue = undefined) {
const input = core.getInput(name, options);
if (input) {
return JSON.parse(input);
}
return defaultValue;
}

/**
* Safely access a string input to a GitHub Action, or fall back on a default if the string is empty.
*
* @param {String} name
* @param {Object} options
* @param {*} [defaultValue]
* @returns {string|undefined}
*/
function getStringInput(name, options, defaultValue = undefined) {
const input = core.getInput(name, options);
if (!input) {
return defaultValue;
}
return input;
}

module.exports = {
getJSONInput,
getStringInput,
};


/***/ }),

/***/ 7999:
Expand Down
17 changes: 17 additions & 0 deletions .github/actions/getDeployPullRequestList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,25 @@ function getJSONInput(name, options, defaultValue = undefined) {
return defaultValue;
}

/**
* Safely access a string input to a GitHub Action, or fall back on a default if the string is empty.
*
* @param {String} name
* @param {Object} options
* @param {*} [defaultValue]
* @returns {string|undefined}
*/
function getStringInput(name, options, defaultValue = undefined) {
const input = core.getInput(name, options);
if (!input) {
return defaultValue;
}
return input;
}

module.exports = {
getJSONInput,
getStringInput,
};


Expand Down
17 changes: 17 additions & 0 deletions .github/actions/getPullRequestDetails/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,25 @@ function getJSONInput(name, options, defaultValue = undefined) {
return defaultValue;
}

/**
* Safely access a string input to a GitHub Action, or fall back on a default if the string is empty.
*
* @param {String} name
* @param {Object} options
* @param {*} [defaultValue]
* @returns {string|undefined}
*/
function getStringInput(name, options, defaultValue = undefined) {
const input = core.getInput(name, options);
if (!input) {
return defaultValue;
}
return input;
}

module.exports = {
getJSONInput,
getStringInput,
};


Expand Down
17 changes: 17 additions & 0 deletions .github/actions/getReleaseBody/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,25 @@ function getJSONInput(name, options, defaultValue = undefined) {
return defaultValue;
}

/**
* Safely access a string input to a GitHub Action, or fall back on a default if the string is empty.
*
* @param {String} name
* @param {Object} options
* @param {*} [defaultValue]
* @returns {string|undefined}
*/
function getStringInput(name, options, defaultValue = undefined) {
const input = core.getInput(name, options);
if (!input) {
return defaultValue;
}
return input;
}

module.exports = {
getJSONInput,
getStringInput,
};


Expand Down
17 changes: 17 additions & 0 deletions .github/actions/markPullRequestsAsDeployed/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,25 @@ function getJSONInput(name, options, defaultValue = undefined) {
return defaultValue;
}

/**
* Safely access a string input to a GitHub Action, or fall back on a default if the string is empty.
*
* @param {String} name
* @param {Object} options
* @param {*} [defaultValue]
* @returns {string|undefined}
*/
function getStringInput(name, options, defaultValue = undefined) {
const input = core.getInput(name, options);
if (!input) {
return defaultValue;
}
return input;
}

module.exports = {
getJSONInput,
getStringInput,
};


Expand Down
17 changes: 17 additions & 0 deletions .github/actions/triggerWorkflowAndWait/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,25 @@ function getJSONInput(name, options, defaultValue = undefined) {
return defaultValue;
}

/**
* Safely access a string input to a GitHub Action, or fall back on a default if the string is empty.
*
* @param {String} name
* @param {Object} options
* @param {*} [defaultValue]
* @returns {string|undefined}
*/
function getStringInput(name, options, defaultValue = undefined) {
const input = core.getInput(name, options);
if (!input) {
return defaultValue;
}
return input;
}

module.exports = {
getJSONInput,
getStringInput,
};


Expand Down
17 changes: 17 additions & 0 deletions .github/libs/ActionUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,23 @@ function getJSONInput(name, options, defaultValue = undefined) {
return defaultValue;
}

/**
* Safely access a string input to a GitHub Action, or fall back on a default if the string is empty.
*
* @param {String} name
* @param {Object} options
* @param {*} [defaultValue]
* @returns {string|undefined}
*/
function getStringInput(name, options, defaultValue = undefined) {
const input = core.getInput(name, options);
if (!input) {
return defaultValue;
}
return input;
}

module.exports = {
getJSONInput,
getStringInput,
};
Loading

0 comments on commit e6df824

Please sign in to comment.