Skip to content

Commit

Permalink
Merge branch 'main' into fix/36350-unselected-user-becomes-reselected
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardoj committed Apr 16, 2024
2 parents 9df5ea9 + 90412ec commit 9cdce1f
Show file tree
Hide file tree
Showing 1,171 changed files with 129,655 additions and 175,077 deletions.
9 changes: 9 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ module.exports = {
// This path is provide alias for files like `ONYXKEYS` and `CONST`.
'@src': './src',
'@desktop': './desktop',
'@github': './.github',
},
},
],
Expand Down Expand Up @@ -249,6 +250,14 @@ module.exports = {
message: "Please don't declare enums, use union types instead.",
},
],
'no-restricted-properties': [
'error',
{
object: 'Image',
property: 'getSize',
message: 'Usage of Image.getImage is restricted. Please use the `react-native-image-size`.',
},
],
'no-restricted-imports': [
'error',
{
Expand Down
4 changes: 4 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
# Every PR gets a review from an internal Expensify engineer
* @Expensify/pullerbear

# Assign the Design team to review changes to our styles & assets
src/styles/ @Expensify/design @Expensify/pullerbear
assets/ @Expensify/design @Expensify/pullerbear
2 changes: 1 addition & 1 deletion .github/actionlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
self-hosted-runner:
labels:
- ubuntu-latest-xl
- macos-12-xl
- macos-13-large
- macos-13-xlarge
- ubuntu-latest-reassure-tests
44 changes: 22 additions & 22 deletions .github/actions/javascript/authorChecklist/authorChecklist.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/* eslint-disable @typescript-eslint/naming-convention */
import * as core from '@actions/core';
import * as github from '@actions/github';
import escapeRegExp from 'lodash/escapeRegExp';
import CONST from '../../../libs/CONST';
import GithubUtils from '../../../libs/GithubUtils';
import CONST from '@github/libs/CONST';
import GithubUtils from '@github/libs/GithubUtils';
import newComponentCategory from './categories/newComponentCategory';

const pathToAuthorChecklist = `https://raw.githubusercontent.com/${CONST.GITHUB_OWNER}/${CONST.APP_REPO}/main/.github/PULL_REQUEST_TEMPLATE.md`;
Expand All @@ -20,24 +21,24 @@ const CHECKLIST_CATEGORIES = {
*/
async function getChecklistCategoriesForPullRequest(): Promise<Set<string>> {
const checks = new Set<string>();
const changedFiles = await GithubUtils.paginate(GithubUtils.octokit.pulls.listFiles, {
owner: CONST.GITHUB_OWNER,
repo: CONST.APP_REPO,
// eslint-disable-next-line @typescript-eslint/naming-convention
pull_number: prNumber,
// eslint-disable-next-line @typescript-eslint/naming-convention
per_page: 100,
});
const possibleCategories = await Promise.all(
Object.values(CHECKLIST_CATEGORIES).map(async (category) => ({
items: category.items,
doesCategoryApply: await category.detect(changedFiles),
})),
);
for (const category of possibleCategories) {
if (category.doesCategoryApply) {
for (const item of category.items) {
checks.add(item);
if (prNumber !== undefined) {
const changedFiles = await GithubUtils.paginate(GithubUtils.octokit.pulls.listFiles, {
owner: CONST.GITHUB_OWNER,
repo: CONST.APP_REPO,
pull_number: prNumber,
per_page: 100,
});
const possibleCategories = await Promise.all(
Object.values(CHECKLIST_CATEGORIES).map(async (category) => ({
items: category.items,
doesCategoryApply: await category.detect(changedFiles),
})),
);
for (const category of possibleCategories) {
if (category.doesCategoryApply) {
for (const item of category.items) {
checks.add(item);
}
}
}
}
Expand Down Expand Up @@ -126,12 +127,11 @@ async function generateDynamicChecksAndCheckForCompletion() {
const newBody = contentBeforeChecklist + checklistStartsWith + checklist + checklistEndsWith + contentAfterChecklist;

// Update the PR body
if (didChecklistChange) {
if (didChecklistChange && prNumber !== undefined) {
console.log('Checklist changed, updating PR...');
await GithubUtils.octokit.pulls.update({
owner: CONST.GITHUB_OWNER,
repo: CONST.APP_REPO,
// eslint-disable-next-line @typescript-eslint/naming-convention
pull_number: prNumber,
body: newBody,
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import github from '@actions/github';
import * as github from '@actions/github';
import {parse} from '@babel/parser';
import traverse from '@babel/traverse';
import CONST from '../../../../libs/CONST';
import GithubUtils from '../../../../libs/GithubUtils';
import promiseSome from '../../../../libs/promiseSome';
import CONST from '@github/libs/CONST';
import GithubUtils from '@github/libs/GithubUtils';
import promiseSome from '@github/libs/promiseSome';
import type Category from './Category';

type SuperClassType = {superClass: {name?: string; object: {name: string}; property: {name: string}} | null; name: string};
Expand Down Expand Up @@ -81,7 +81,7 @@ async function detectReactComponentInFile(filename: string): Promise<boolean | u
};
try {
const {data} = await GithubUtils.octokit.repos.getContent(params);
const content = 'content' in data ? nodeBase64ToUtf8(data.content || '') : data;
const content = nodeBase64ToUtf8('content' in data ? data?.content ?? '' : '');
return detectReactComponent(content, filename);
} catch (error) {
console.error('An unknown error occurred with the GitHub API: ', error, params);
Expand Down
Loading

0 comments on commit 9cdce1f

Please sign in to comment.