Skip to content

Commit 9307231

Browse files
committed
Merge remote-tracking branch 'origin/main' into jasper-securePrivatePersonalDetails-redo-v2
2 parents 0b44ed7 + c1cc586 commit 9307231

1,435 files changed

Lines changed: 54699 additions & 21450 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.bun-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.3.14

.github/ISSUE_TEMPLATE/Accessibility.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ about: A template to follow when creating a new issue for accessibility failures
44
labels: ["Accessibility", "Weekly"]
55
---
66

7-
If you haven’t already, check out our [contributing guidelines](https://github.com/Expensify/ReactNativeChat/blob/main/contributingGuides/CONTRIBUTING.md) for onboarding and email contributors@expensify.com to request to join our Slack channel!
7+
If you haven’t already, check out our [contributing guidelines](https://github.com/Expensify/ReactNativeChat/blob/main/contributingGuides/CONTRIBUTING.md) for onboarding. To join our Slack channel, fill out [this form](https://forms.gle/Q7hnhUJPnQCK7Fe56).
88
___
99

1010
## Action Performed:

.github/ISSUE_TEMPLATE/Exploratory.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ about: A template to follow when creating a new issue in this repository that wa
44
labels: Monthly, Not a priority
55
---
66

7-
If you haven’t already, check out our [contributing guidelines](https://github.com/Expensify/ReactNativeChat/blob/main/contributingGuides/CONTRIBUTING.md) for onboarding and email contributors@expensify.com to request to join our Slack channel!
7+
If you haven’t already, check out our [contributing guidelines](https://github.com/Expensify/ReactNativeChat/blob/main/contributingGuides/CONTRIBUTING.md) for onboarding. To join our Slack channel, fill out [this form](https://forms.gle/Q7hnhUJPnQCK7Fe56).
88
___
99
**For all Exploratory issues, start the title of the issue with `[Exploratory]`** (and, do **not** add the `External` label.
1010

.github/ISSUE_TEMPLATE/Performance.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ title: "[Performance] "
55
labels: Engineering, Daily
66
---
77

8-
If you haven’t already, check out our [contributing guidelines](https://github.com/Expensify/ReactNativeChat/blob/main/contributingGuides/CONTRIBUTING.md) for onboarding and email contributors@expensify.com to request to join our Slack channel!
8+
If you haven’t already, check out our [contributing guidelines](https://github.com/Expensify/ReactNativeChat/blob/main/contributingGuides/CONTRIBUTING.md) for onboarding. To join our Slack channel, fill out [this form](https://forms.gle/Q7hnhUJPnQCK7Fe56).
99
___
1010

1111
## What performance issue do we need to solve?

.github/ISSUE_TEMPLATE/Standard.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ about: A standard template to follow when creating a new issue in this repositor
44
labels: Bug, Daily
55
---
66

7-
If you haven’t already, check out our [contributing guidelines](https://github.com/Expensify/ReactNativeChat/blob/main/contributingGuides/CONTRIBUTING.md) for onboarding and email contributors@expensify.com to request to join our Slack channel!
7+
If you haven’t already, check out our [contributing guidelines](https://github.com/Expensify/ReactNativeChat/blob/main/contributingGuides/CONTRIBUTING.md) for onboarding. To join our Slack channel, fill out [this form](https://forms.gle/Q7hnhUJPnQCK7Fe56).
88
___
99

1010
**Version Number:**

.github/actions/composite/announceFailedWorkflowInSlack/action.yml

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,17 @@ inputs:
1313
runs:
1414
using: composite
1515
steps:
16-
- uses: 8398a7/action-slack@1750b5085f3ec60384090fb7c52965ef822e869e
16+
- uses: slackapi/slack-github-action@45a88b9581bfab2566dc881e2cd66d334e621e2c # v3.0.3
1717
name: Job failed Slack notification
1818
with:
19-
status: custom
20-
fields: workflow, repo
21-
custom_payload: |
19+
webhook: ${{ inputs.SLACK_WEBHOOK }}
20+
webhook-type: incoming-webhook
21+
payload: |
2222
{
23-
channel: '${{ inputs.CHANNEL }}',
24-
attachments: [{
25-
color: "#DB4545",
26-
pretext: `<!subteam^S4TJJ3PSL>`,
27-
text: `💥 ${process.env.AS_REPO} failed on <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.workflow }}> workflow 💥`,
23+
"channel": "${{ inputs.CHANNEL }}",
24+
"attachments": [{
25+
"color": "#DB4545",
26+
"pretext": "<!subteam^S4TJJ3PSL>",
27+
"text": "💥 ${{ github.repository }} failed on <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.workflow }}> workflow 💥"
2828
}]
2929
}
30-
env:
31-
GITHUB_TOKEN: ${{ github.token }}
32-
SLACK_WEBHOOK_URL: ${{ inputs.SLACK_WEBHOOK }}

.github/actions/composite/isContributorPlus/action.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/actions/javascript/isAuthorizedContributor/action.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ inputs:
44
PR_NUMBER:
55
description: Pull request number
66
required: true
7-
PR_AUTHOR:
8-
description: Pull request author login
7+
ACTOR:
8+
description: Login of the user to authorize (PR author, comment author, etc.)
99
required: true
10-
AUTHOR_ASSOCIATION:
11-
description: "Author's association with the repository (MEMBER, OWNER, CONTRIBUTOR, etc.)"
10+
ACTOR_ASSOCIATION:
11+
description: "Actor's association with the repository (MEMBER, OWNER, CONTRIBUTOR, etc.)"
1212
required: true
1313
GITHUB_TOKEN:
1414
description: Auth token for repository API calls

.github/actions/javascript/isAuthorizedContributor/index.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11587,7 +11587,7 @@ const github = __importStar(__nccwpck_require__(5438));
1158711587
const request_error_1 = __nccwpck_require__(537);
1158811588
const CONST_1 = __importDefault(__nccwpck_require__(9873));
1158911589
const GithubUtils_1 = __importDefault(__nccwpck_require__(9296));
11590-
const AUTHORIZED_ASSOCIATIONS = new Set(['MEMBER', 'OWNER', 'CONTRIBUTOR']);
11590+
const AUTHORIZED_ASSOCIATIONS = new Set(['MEMBER', 'OWNER', 'CONTRIBUTOR', 'COLLABORATOR']);
1159111591
const CONTRIBUTOR_PLUS_TEAM_SLUG = 'contributor-plus';
1159211592
const ISSUE_URL_PATTERN = /https:\/\/github\.com\/(Expensify\/[^/]+)\/issues\/(\d+)/g;
1159311593
function parseExpensifyLink(match) {
@@ -11630,7 +11630,7 @@ async function isContributorPlusMember(username, orgToken) {
1163011630
return false;
1163111631
}
1163211632
}
11633-
async function isAuthorizedViaLinkedIssues(prBody, prAuthor) {
11633+
async function isAuthorizedViaLinkedIssues(prBody, actor) {
1163411634
for (const match of prBody.matchAll(ISSUE_URL_PATTERN)) {
1163511635
const link = parseExpensifyLink(match);
1163611636
if (!link) {
@@ -11644,11 +11644,11 @@ async function isAuthorizedViaLinkedIssues(prBody, prAuthor) {
1164411644
// eslint-disable-next-line @typescript-eslint/naming-convention
1164511645
issue_number: number,
1164611646
});
11647-
if (issue.assignees?.some((assignee) => assignee.login?.toLowerCase() === prAuthor.toLowerCase())) {
11648-
console.log(`${prAuthor} is assigned to ${repoFullName}#${number}. Authorized.`);
11647+
if (issue.assignees?.some((assignee) => assignee.login?.toLowerCase() === actor.toLowerCase())) {
11648+
console.log(`${actor} is assigned to ${repoFullName}#${number}. Authorized.`);
1164911649
return true;
1165011650
}
11651-
console.log(`${prAuthor} is NOT assigned to ${repoFullName}#${number}.`);
11651+
console.log(`${actor} is NOT assigned to ${repoFullName}#${number}.`);
1165211652
}
1165311653
catch (error) {
1165411654
logVerificationError(repoFullName, number, error);
@@ -11659,15 +11659,15 @@ async function isAuthorizedViaLinkedIssues(prBody, prAuthor) {
1165911659
/**
1166011660
* Returns whether a PR author is authorized to contribute per Expensify external contributor rules.
1166111661
*/
11662-
async function isAuthorizedContributor({ prNumber, prAuthor, authorAssociation, repoOwner, repoName, githubToken, orgToken }) {
11663-
if (AUTHORIZED_ASSOCIATIONS.has(authorAssociation)) {
11664-
console.log(`${prAuthor} is ${authorAssociation}. Authorized.`);
11662+
async function isAuthorizedContributor({ prNumber, actor, actorAssociation, repoOwner, repoName, githubToken, orgToken }) {
11663+
if (AUTHORIZED_ASSOCIATIONS.has(actorAssociation)) {
11664+
console.log(`${actor} is ${actorAssociation}. Authorized.`);
1166511665
return true;
1166611666
}
11667-
if (await isContributorPlusMember(prAuthor, orgToken)) {
11667+
if (await isContributorPlusMember(actor, orgToken)) {
1166811668
return true;
1166911669
}
11670-
console.log(`${prAuthor} has association "${authorAssociation}". Checking linked issues...`);
11670+
console.log(`${actor} has association "${actorAssociation}". Checking linked issues...`);
1167111671
GithubUtils_1.default.initOctokitWithToken(githubToken);
1167211672
const { data: pr } = await GithubUtils_1.default.octokit.pulls.get({
1167311673
owner: repoOwner,
@@ -11676,23 +11676,23 @@ async function isAuthorizedContributor({ prNumber, prAuthor, authorAssociation,
1167611676
pull_number: prNumber,
1167711677
});
1167811678
const prBody = pr.body ?? '';
11679-
const isAuthorized = await isAuthorizedViaLinkedIssues(prBody, prAuthor);
11679+
const isAuthorized = await isAuthorizedViaLinkedIssues(prBody, actor);
1168011680
if (!isAuthorized) {
11681-
console.log(`No valid authorization found for ${prAuthor}.`);
11681+
console.log(`No valid authorization found for ${actor}.`);
1168211682
}
1168311683
return isAuthorized;
1168411684
}
1168511685
async function run() {
1168611686
const prNumber = Number.parseInt(core.getInput('PR_NUMBER', { required: true }), 10);
11687-
const prAuthor = core.getInput('PR_AUTHOR', { required: true });
11688-
const authorAssociation = core.getInput('AUTHOR_ASSOCIATION', { required: true });
11687+
const actor = core.getInput('ACTOR', { required: true });
11688+
const actorAssociation = core.getInput('ACTOR_ASSOCIATION', { required: true });
1168911689
const githubToken = core.getInput('GITHUB_TOKEN', { required: true });
1169011690
const orgToken = core.getInput('OS_BOTIFY_TOKEN', { required: true });
1169111691
const { owner, repo } = github.context.repo;
1169211692
const isAuthorized = await isAuthorizedContributor({
1169311693
prNumber,
11694-
prAuthor,
11695-
authorAssociation,
11694+
actor,
11695+
actorAssociation,
1169611696
repoOwner: owner,
1169711697
repoName: repo,
1169811698
githubToken,

.github/actions/javascript/isAuthorizedContributor/isAuthorizedContributor.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ import {RequestError} from '@octokit/request-error';
44
import CONST from '@github/libs/CONST';
55
import GithubUtils from '@github/libs/GithubUtils';
66

7-
const AUTHORIZED_ASSOCIATIONS = new Set(['MEMBER', 'OWNER', 'CONTRIBUTOR']);
7+
const AUTHORIZED_ASSOCIATIONS = new Set(['MEMBER', 'OWNER', 'CONTRIBUTOR', 'COLLABORATOR']);
88
const CONTRIBUTOR_PLUS_TEAM_SLUG = 'contributor-plus';
99

1010
const ISSUE_URL_PATTERN = /https:\/\/github\.com\/(Expensify\/[^/]+)\/issues\/(\d+)/g;
1111

1212
type IsAuthorizedContributorParams = {
1313
prNumber: number;
14-
prAuthor: string;
15-
authorAssociation: string;
14+
actor: string;
15+
actorAssociation: string;
1616
repoOwner: string;
1717
repoName: string;
1818
githubToken: string;
@@ -70,7 +70,7 @@ async function isContributorPlusMember(username: string, orgToken: string): Prom
7070
}
7171
}
7272

73-
async function isAuthorizedViaLinkedIssues(prBody: string, prAuthor: string): Promise<boolean> {
73+
async function isAuthorizedViaLinkedIssues(prBody: string, actor: string): Promise<boolean> {
7474
for (const match of prBody.matchAll(ISSUE_URL_PATTERN)) {
7575
const link = parseExpensifyLink(match);
7676
if (!link) {
@@ -87,12 +87,12 @@ async function isAuthorizedViaLinkedIssues(prBody: string, prAuthor: string): Pr
8787
issue_number: number,
8888
});
8989

90-
if (issue.assignees?.some((assignee) => assignee.login?.toLowerCase() === prAuthor.toLowerCase())) {
91-
console.log(`${prAuthor} is assigned to ${repoFullName}#${number}. Authorized.`);
90+
if (issue.assignees?.some((assignee) => assignee.login?.toLowerCase() === actor.toLowerCase())) {
91+
console.log(`${actor} is assigned to ${repoFullName}#${number}. Authorized.`);
9292
return true;
9393
}
9494

95-
console.log(`${prAuthor} is NOT assigned to ${repoFullName}#${number}.`);
95+
console.log(`${actor} is NOT assigned to ${repoFullName}#${number}.`);
9696
} catch (error: unknown) {
9797
logVerificationError(repoFullName, number, error);
9898
}
@@ -104,17 +104,17 @@ async function isAuthorizedViaLinkedIssues(prBody: string, prAuthor: string): Pr
104104
/**
105105
* Returns whether a PR author is authorized to contribute per Expensify external contributor rules.
106106
*/
107-
async function isAuthorizedContributor({prNumber, prAuthor, authorAssociation, repoOwner, repoName, githubToken, orgToken}: IsAuthorizedContributorParams): Promise<boolean> {
108-
if (AUTHORIZED_ASSOCIATIONS.has(authorAssociation)) {
109-
console.log(`${prAuthor} is ${authorAssociation}. Authorized.`);
107+
async function isAuthorizedContributor({prNumber, actor, actorAssociation, repoOwner, repoName, githubToken, orgToken}: IsAuthorizedContributorParams): Promise<boolean> {
108+
if (AUTHORIZED_ASSOCIATIONS.has(actorAssociation)) {
109+
console.log(`${actor} is ${actorAssociation}. Authorized.`);
110110
return true;
111111
}
112112

113-
if (await isContributorPlusMember(prAuthor, orgToken)) {
113+
if (await isContributorPlusMember(actor, orgToken)) {
114114
return true;
115115
}
116116

117-
console.log(`${prAuthor} has association "${authorAssociation}". Checking linked issues...`);
117+
console.log(`${actor} has association "${actorAssociation}". Checking linked issues...`);
118118

119119
GithubUtils.initOctokitWithToken(githubToken);
120120

@@ -126,28 +126,28 @@ async function isAuthorizedContributor({prNumber, prAuthor, authorAssociation, r
126126
});
127127

128128
const prBody = pr.body ?? '';
129-
const isAuthorized = await isAuthorizedViaLinkedIssues(prBody, prAuthor);
129+
const isAuthorized = await isAuthorizedViaLinkedIssues(prBody, actor);
130130

131131
if (!isAuthorized) {
132-
console.log(`No valid authorization found for ${prAuthor}.`);
132+
console.log(`No valid authorization found for ${actor}.`);
133133
}
134134

135135
return isAuthorized;
136136
}
137137

138138
async function run(): Promise<void> {
139139
const prNumber = Number.parseInt(core.getInput('PR_NUMBER', {required: true}), 10);
140-
const prAuthor = core.getInput('PR_AUTHOR', {required: true});
141-
const authorAssociation = core.getInput('AUTHOR_ASSOCIATION', {required: true});
140+
const actor = core.getInput('ACTOR', {required: true});
141+
const actorAssociation = core.getInput('ACTOR_ASSOCIATION', {required: true});
142142
const githubToken = core.getInput('GITHUB_TOKEN', {required: true});
143143
const orgToken = core.getInput('OS_BOTIFY_TOKEN', {required: true});
144144

145145
const {owner, repo} = github.context.repo;
146146

147147
const isAuthorized = await isAuthorizedContributor({
148148
prNumber,
149-
prAuthor,
150-
authorAssociation,
149+
actor,
150+
actorAssociation,
151151
repoOwner: owner,
152152
repoName: repo,
153153
githubToken,

0 commit comments

Comments
 (0)