Skip to content

Commit

Permalink
Merge branch 'Expensify:main' into tooltip-31894
Browse files Browse the repository at this point in the history
  • Loading branch information
chie2727 authored Jan 2, 2024
2 parents 35d5921 + a34c8cc commit 654bbf0
Show file tree
Hide file tree
Showing 1,385 changed files with 86,243 additions and 56,585 deletions.
12 changes: 12 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ const restrictedImportPaths = [
importNames: ['TouchableOpacity', 'TouchableWithoutFeedback', 'TouchableNativeFeedback', 'TouchableHighlight'],
message: "Please use 'PressableWithFeedback' and/or 'PressableWithoutFeedback' from 'src/components/Pressable' instead.",
},
{
name: 'react-native-safe-area-context',
importNames: ['useSafeAreaInsets', 'SafeAreaConsumer', 'SafeAreaInsetsContext'],
message: "Please use 'useSafeAreaInsets' from 'src/hooks/useSafeAreaInset' and/or 'SafeAreaConsumer' from 'src/components/SafeAreaConsumer' instead.",
},
{
name: 'react',
importNames: ['CSSProperties'],
message: "Please use 'ViewStyle', 'TextStyle', 'ImageStyle' from 'react-native' instead.",
},
];

const restrictedImportPatterns = [
Expand Down Expand Up @@ -165,10 +175,12 @@ module.exports = {
'es/no-optional-chaining': 'off',
'valid-jsdoc': 'off',
'jsdoc/no-types': 'error',
'rulesdir/no-default-props': 'error',
'import/no-extraneous-dependencies': 'off',
'rulesdir/prefer-underscore-method': 'off',
'rulesdir/prefer-import-module-contents': 'off',
'react/require-default-props': 'off',
'react/prop-types': 'off',
'no-restricted-syntax': [
'error',
{
Expand Down
9 changes: 6 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ $ https://github.com/Expensify/App/issues/<issueID(comment)>
Do NOT only link the issue number like this: $ #<issueID>
--->
$
PROPOSAL:
$
PROPOSAL:


### Tests
Expand Down Expand Up @@ -98,11 +98,14 @@ This is a checklist for PR authors. Please make sure to complete all tasks and c
- [ ] The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
- [ ] If a new CSS style is added I verified that:
- [ ] A similar style doesn't already exist
- [ ] The style can't be created with an existing [StyleUtils](https://github.com/Expensify/App/blob/main/src/styles/StyleUtils.js) function (i.e. `StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)`)
- [ ] The style can't be created with an existing [StyleUtils](https://github.com/Expensify/App/blob/main/src/styles/utils/index.ts) function (i.e. `StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)`)
- [ ] If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
- [ ] If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like `Avatar` is modified, I verified that `Avatar` is working as expected in all cases)
- [ ] If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
- [ ] If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
- [ ] If the PR modifies the form input styles:
- [ ] I verified that all the inputs inside a form are aligned with each other.
- [ ] I added `Design` label so the design team can review the changes.
- [ ] If a new page is added, I verified it's using the `ScrollView` component to make it scrollable when more elements are added to the page.
- [ ] If the `main` branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the `Test` steps.

Expand Down
25 changes: 0 additions & 25 deletions .github/actions/composite/configureAwsCredentials/action.yml

This file was deleted.

5 changes: 5 additions & 0 deletions .github/actions/composite/setupGitForOSBotifyApp/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ runs:
if: runner.debug == '1'
run: echo "GIT_TRACE=true" >> "$GITHUB_ENV"

- name: Sync clock
shell: bash
run: sudo sntp -sS time.windows.com
if: runner.os == 'macOS'

- name: Generate a token
id: generateToken
uses: actions/create-github-app-token@9d97a4282b2c51a2f4f0465b9326399f53c890d4
Expand Down
14 changes: 14 additions & 0 deletions .github/actions/javascript/authorChecklist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,20 @@ class GithubUtils {
return this.internalOctokit.rest;
}

/**
* Get the graphql instance from internal octokit.
* @readonly
* @static
* @memberof GithubUtils
*/
static get graphql() {
if (this.internalOctokit) {
return this.internalOctokit.graphql;
}
this.initOctokit();
return this.internalOctokit.graphql;
}

/**
* Either give an existing instance of Octokit paginate or create a new one
*
Expand Down
14 changes: 14 additions & 0 deletions .github/actions/javascript/awaitStagingDeploys/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,20 @@ class GithubUtils {
return this.internalOctokit.rest;
}

/**
* Get the graphql instance from internal octokit.
* @readonly
* @static
* @memberof GithubUtils
*/
static get graphql() {
if (this.internalOctokit) {
return this.internalOctokit.graphql;
}
this.initOctokit();
return this.internalOctokit.graphql;
}

/**
* Either give an existing instance of Octokit paginate or create a new one
*
Expand Down
14 changes: 14 additions & 0 deletions .github/actions/javascript/checkDeployBlockers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,20 @@ class GithubUtils {
return this.internalOctokit.rest;
}

/**
* Get the graphql instance from internal octokit.
* @readonly
* @static
* @memberof GithubUtils
*/
static get graphql() {
if (this.internalOctokit) {
return this.internalOctokit.graphql;
}
this.initOctokit();
return this.internalOctokit.graphql;
}

/**
* Either give an existing instance of Octokit paginate or create a new one
*
Expand Down
14 changes: 14 additions & 0 deletions .github/actions/javascript/createOrUpdateStagingDeploy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,20 @@ class GithubUtils {
return this.internalOctokit.rest;
}

/**
* Get the graphql instance from internal octokit.
* @readonly
* @static
* @memberof GithubUtils
*/
static get graphql() {
if (this.internalOctokit) {
return this.internalOctokit.graphql;
}
this.initOctokit();
return this.internalOctokit.graphql;
}

/**
* Either give an existing instance of Octokit paginate or create a new one
*
Expand Down
14 changes: 14 additions & 0 deletions .github/actions/javascript/getDeployPullRequestList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,20 @@ class GithubUtils {
return this.internalOctokit.rest;
}

/**
* Get the graphql instance from internal octokit.
* @readonly
* @static
* @memberof GithubUtils
*/
static get graphql() {
if (this.internalOctokit) {
return this.internalOctokit.graphql;
}
this.initOctokit();
return this.internalOctokit.graphql;
}

/**
* Either give an existing instance of Octokit paginate or create a new one
*
Expand Down
14 changes: 14 additions & 0 deletions .github/actions/javascript/getPullRequestDetails/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,20 @@ class GithubUtils {
return this.internalOctokit.rest;
}

/**
* Get the graphql instance from internal octokit.
* @readonly
* @static
* @memberof GithubUtils
*/
static get graphql() {
if (this.internalOctokit) {
return this.internalOctokit.graphql;
}
this.initOctokit();
return this.internalOctokit.graphql;
}

/**
* Either give an existing instance of Octokit paginate or create a new one
*
Expand Down
14 changes: 14 additions & 0 deletions .github/actions/javascript/getReleaseBody/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,20 @@ class GithubUtils {
return this.internalOctokit.rest;
}

/**
* Get the graphql instance from internal octokit.
* @readonly
* @static
* @memberof GithubUtils
*/
static get graphql() {
if (this.internalOctokit) {
return this.internalOctokit.graphql;
}
this.initOctokit();
return this.internalOctokit.graphql;
}

/**
* Either give an existing instance of Octokit paginate or create a new one
*
Expand Down
14 changes: 14 additions & 0 deletions .github/actions/javascript/isStagingDeployLocked/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,20 @@ class GithubUtils {
return this.internalOctokit.rest;
}

/**
* Get the graphql instance from internal octokit.
* @readonly
* @static
* @memberof GithubUtils
*/
static get graphql() {
if (this.internalOctokit) {
return this.internalOctokit.graphql;
}
this.initOctokit();
return this.internalOctokit.graphql;
}

/**
* Either give an existing instance of Octokit paginate or create a new one
*
Expand Down
14 changes: 14 additions & 0 deletions .github/actions/javascript/markPullRequestsAsDeployed/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,20 @@ class GithubUtils {
return this.internalOctokit.rest;
}

/**
* Get the graphql instance from internal octokit.
* @readonly
* @static
* @memberof GithubUtils
*/
static get graphql() {
if (this.internalOctokit) {
return this.internalOctokit.graphql;
}
this.initOctokit();
return this.internalOctokit.graphql;
}

/**
* Either give an existing instance of Octokit paginate or create a new one
*
Expand Down
67 changes: 56 additions & 11 deletions .github/actions/javascript/postTestBuildComment/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
/***/ 2052:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {

const _ = __nccwpck_require__(5067);
const core = __nccwpck_require__(2186);
const {context} = __nccwpck_require__(5438);
const CONST = __nccwpck_require__(4097);
const GithubUtils = __nccwpck_require__(7999);

/**
Expand Down Expand Up @@ -42,7 +44,12 @@ function getTestBuildMessage() {
| ${androidQRCode} | ${iOSQRCode} |
| Desktop :computer: | Web :spider_web: |
| ${desktopLink} | ${webLink} |
| ${desktopQRCode} | ${webQRCode} |`;
| ${desktopQRCode} | ${webQRCode} |

---

:eyes: [View the workflow run that generated this build](https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}) :eyes:
`;

return message;
}
Expand All @@ -54,20 +61,44 @@ function getTestBuildMessage() {
* @param {String} message
* @returns {Promise<void>}
*/
function commentPR(PR, message) {
async function commentPR(PR, message) {
console.log(`Posting test build comment on #${PR}`);
return GithubUtils.createComment(context.repo.repo, PR, message)
.then(() => console.log(`Comment created on #${PR} successfully 🎉`))
.catch((err) => {
console.log(`Unable to write comment on #${PR} 😞`);
core.setFailed(err.message);
});
try {
await GithubUtils.createComment(context.repo.repo, PR, message);
console.log(`Comment created on #${PR} successfully 🎉`);
} catch (err) {
console.log(`Unable to write comment on #${PR} 😞`);
core.setFailed(err.message);
}
}

const run = function () {
async function run() {
const PR_NUMBER = core.getInput('PR_NUMBER', {required: true});
return commentPR(PR_NUMBER, getTestBuildMessage()).then(() => Promise.resolve());
};
const comments = await GithubUtils.paginate(
GithubUtils.octokit.issues.listComments,
{
owner: CONST.GITHUB_OWNER,
repo: CONST.APP_REPO,
issue_number: PR_NUMBER,
per_page: 100,
},
(response) => response.data,
);
const testBuildComment = _.find(comments, (comment) => comment.body.startsWith(':test_tube::test_tube: Use the links below to test this adhoc build'));
if (testBuildComment) {
console.log('Found previous build comment, hiding it', testBuildComment);
await GithubUtils.graphql(`
mutation {
minimizeComment(input: {classifier: OUTDATED, subjectId: "${testBuildComment.node_id}"}) {
minimizedComment {
minimizedReason
}
}
}
`);
}
await commentPR(PR_NUMBER, getTestBuildMessage());
}

if (require.main === require.cache[eval('__filename')]) {
run();
Expand Down Expand Up @@ -173,6 +204,20 @@ class GithubUtils {
return this.internalOctokit.rest;
}

/**
* Get the graphql instance from internal octokit.
* @readonly
* @static
* @memberof GithubUtils
*/
static get graphql() {
if (this.internalOctokit) {
return this.internalOctokit.graphql;
}
this.initOctokit();
return this.internalOctokit.graphql;
}

/**
* Either give an existing instance of Octokit paginate or create a new one
*
Expand Down
Loading

0 comments on commit 654bbf0

Please sign in to comment.