Skip to content

Commit 1a84291

Browse files
Merge branch 'main' of github.com:Expensify/App
2 parents ebb51ff + 28778a0 commit 1a84291

File tree

161 files changed

+3542
-2115
lines changed

Some content is hidden

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

161 files changed

+3542
-2115
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module.exports = {
22
extends: ['expensify', 'plugin:storybook/recommended'],
33
parser: 'babel-eslint',
4-
ignorePatterns: ['!.*', 'src/vendor', '.github/actions/**/index.js'],
4+
ignorePatterns: ['!.*', 'src/vendor', '.github/actions/**/index.js', 'desktop/dist/*.js', 'dist/*.js'],
55
env: {
66
jest: true,
77
},

.github/actions/composite/setupNode/action.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ runs:
66
steps:
77
# Version: 3.0.2
88
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
9+
with:
10+
fetch-depth: 0
911

1012
- uses: actions/setup-node@09ba51f18e18a3756fea1f54d09c6745c064491d
1113
with:

.github/actions/javascript/awaitStagingDeploys/index.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ class GithubUtils {
226226
labels: issue.labels,
227227
PRList: this.getStagingDeployCashPRList(issue),
228228
deployBlockers: this.getStagingDeployCashDeployBlockers(issue),
229+
internalQAPRList: this.getStagingDeployCashInternalQA(issue),
229230
isTimingDashboardChecked: /-\s\[x]\sI checked the \[App Timing Dashboard]/.test(issue.body),
230231
isFirebaseChecked: /-\s\[x]\sI checked \[Firebase Crashlytics]/.test(issue.body),
231232
tag,
@@ -260,8 +261,7 @@ class GithubUtils {
260261
isAccessible: match[4] === 'x',
261262
}),
262263
);
263-
const internalQAPRList = this.getStagingDeployCashInternalQA(issue);
264-
return _.sortBy(_.union(PRList, internalQAPRList), 'number');
264+
return _.sortBy(PRList, 'number');
265265
}
266266

267267
/**
@@ -306,7 +306,7 @@ class GithubUtils {
306306
const internalQAPRs = _.map(
307307
[...internalQASection.matchAll(new RegExp(`- \\[([ x])]\\s(${PULL_REQUEST_REGEX.source})`, 'g'))],
308308
match => ({
309-
url: match[2],
309+
url: match[2].split('-')[0].trim(),
310310
number: Number.parseInt(match[3], 10),
311311
isResolved: match[1] === 'x',
312312
isAccessible: false,
@@ -324,6 +324,7 @@ class GithubUtils {
324324
* @param {Array} [accessiblePRList] - The list of PR URLs which have passed the accessability check.
325325
* @param {Array} [deployBlockers] - The list of DeployBlocker URLs.
326326
* @param {Array} [resolvedDeployBlockers] - The list of DeployBlockers URLs which have been resolved.
327+
* @param {Array} [resolvedInternalQAPRs] - The list of Internal QA PR URLs which have been resolved.
327328
* @param {Boolean} [isTimingDashboardChecked]
328329
* @param {Boolean} [isFirebaseChecked]
329330
* @returns {Promise}
@@ -335,6 +336,7 @@ class GithubUtils {
335336
accessiblePRList = [],
336337
deployBlockers = [],
337338
resolvedDeployBlockers = [],
339+
resolvedInternalQAPRs = [],
338340
isTimingDashboardChecked = false,
339341
isFirebaseChecked = false,
340342
) {
@@ -346,6 +348,11 @@ class GithubUtils {
346348
);
347349
console.log('Filtering out the following automated pull requests:', automatedPRs);
348350

351+
// The format of this map is following:
352+
// {
353+
// 'https://github.com/Expensify/App/pull/9641': [ 'PauloGasparSv', 'kidroca' ],
354+
// 'https://github.com/Expensify/App/pull/9642': [ 'mountiny', 'kidroca' ]
355+
// }
349356
const internalQAPRMap = _.reduce(
350357
_.filter(data, pr => !_.isEmpty(_.findWhere(pr.labels, {name: INTERNAL_QA_LABEL}))),
351358
(map, pr) => {
@@ -390,11 +397,13 @@ class GithubUtils {
390397
});
391398
}
392399

400+
// Internal QA PR list
393401
if (!_.isEmpty(internalQAPRMap)) {
402+
console.log('Found the following verified Internal QA PRs:', resolvedInternalQAPRs);
394403
issueBody += '\r\n\r\n\r\n**Internal QA:**';
395404
_.each(internalQAPRMap, (assignees, URL) => {
396405
const assigneeMentions = _.reduce(assignees, (memo, assignee) => `${memo} @${assignee}`, '');
397-
issueBody += `\r\n${_.contains(verifiedOrNoQAPRs, URL) ? '- [x]' : '- [ ]'} `;
406+
issueBody += `\r\n${_.contains(resolvedInternalQAPRs, URL) ? '- [x]' : '- [ ]'} `;
398407
issueBody += `${URL}`;
399408
issueBody += ` -${assigneeMentions}`;
400409
});

.github/actions/javascript/checkDeployBlockers/index.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ class GithubUtils {
196196
labels: issue.labels,
197197
PRList: this.getStagingDeployCashPRList(issue),
198198
deployBlockers: this.getStagingDeployCashDeployBlockers(issue),
199+
internalQAPRList: this.getStagingDeployCashInternalQA(issue),
199200
isTimingDashboardChecked: /-\s\[x]\sI checked the \[App Timing Dashboard]/.test(issue.body),
200201
isFirebaseChecked: /-\s\[x]\sI checked \[Firebase Crashlytics]/.test(issue.body),
201202
tag,
@@ -230,8 +231,7 @@ class GithubUtils {
230231
isAccessible: match[4] === 'x',
231232
}),
232233
);
233-
const internalQAPRList = this.getStagingDeployCashInternalQA(issue);
234-
return _.sortBy(_.union(PRList, internalQAPRList), 'number');
234+
return _.sortBy(PRList, 'number');
235235
}
236236

237237
/**
@@ -276,7 +276,7 @@ class GithubUtils {
276276
const internalQAPRs = _.map(
277277
[...internalQASection.matchAll(new RegExp(`- \\[([ x])]\\s(${PULL_REQUEST_REGEX.source})`, 'g'))],
278278
match => ({
279-
url: match[2],
279+
url: match[2].split('-')[0].trim(),
280280
number: Number.parseInt(match[3], 10),
281281
isResolved: match[1] === 'x',
282282
isAccessible: false,
@@ -294,6 +294,7 @@ class GithubUtils {
294294
* @param {Array} [accessiblePRList] - The list of PR URLs which have passed the accessability check.
295295
* @param {Array} [deployBlockers] - The list of DeployBlocker URLs.
296296
* @param {Array} [resolvedDeployBlockers] - The list of DeployBlockers URLs which have been resolved.
297+
* @param {Array} [resolvedInternalQAPRs] - The list of Internal QA PR URLs which have been resolved.
297298
* @param {Boolean} [isTimingDashboardChecked]
298299
* @param {Boolean} [isFirebaseChecked]
299300
* @returns {Promise}
@@ -305,6 +306,7 @@ class GithubUtils {
305306
accessiblePRList = [],
306307
deployBlockers = [],
307308
resolvedDeployBlockers = [],
309+
resolvedInternalQAPRs = [],
308310
isTimingDashboardChecked = false,
309311
isFirebaseChecked = false,
310312
) {
@@ -316,6 +318,11 @@ class GithubUtils {
316318
);
317319
console.log('Filtering out the following automated pull requests:', automatedPRs);
318320

321+
// The format of this map is following:
322+
// {
323+
// 'https://github.com/Expensify/App/pull/9641': [ 'PauloGasparSv', 'kidroca' ],
324+
// 'https://github.com/Expensify/App/pull/9642': [ 'mountiny', 'kidroca' ]
325+
// }
319326
const internalQAPRMap = _.reduce(
320327
_.filter(data, pr => !_.isEmpty(_.findWhere(pr.labels, {name: INTERNAL_QA_LABEL}))),
321328
(map, pr) => {
@@ -360,11 +367,13 @@ class GithubUtils {
360367
});
361368
}
362369

370+
// Internal QA PR list
363371
if (!_.isEmpty(internalQAPRMap)) {
372+
console.log('Found the following verified Internal QA PRs:', resolvedInternalQAPRs);
364373
issueBody += '\r\n\r\n\r\n**Internal QA:**';
365374
_.each(internalQAPRMap, (assignees, URL) => {
366375
const assigneeMentions = _.reduce(assignees, (memo, assignee) => `${memo} @${assignee}`, '');
367-
issueBody += `\r\n${_.contains(verifiedOrNoQAPRs, URL) ? '- [x]' : '- [ ]'} `;
376+
issueBody += `\r\n${_.contains(resolvedInternalQAPRs, URL) ? '- [x]' : '- [ ]'} `;
368377
issueBody += `${URL}`;
369378
issueBody += ` -${assigneeMentions}`;
370379
});

.github/actions/javascript/createOrUpdateStagingDeploy/createOrUpdateStagingDeploy.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,20 @@ const run = function () {
122122
'number',
123123
);
124124

125+
// Get the internalQA PR list, preserving the previous state of `isResolved`
126+
const internalQAPRList = _.sortBy(
127+
currentStagingDeployCashData.internalQAPRList,
128+
'number',
129+
);
130+
125131
return GithubUtils.generateStagingDeployCashBody(
126132
newTag,
127133
_.pluck(PRList, 'url'),
128134
_.pluck(_.where(PRList, {isVerified: true}), 'url'),
129135
_.pluck(_.where(PRList, {isAccessible: true}), 'url'),
130136
_.pluck(deployBlockers, 'url'),
131137
_.pluck(_.where(deployBlockers, {isResolved: true}), 'url'),
138+
_.pluck(_.where(internalQAPRList, {isResolved: true}), 'url'),
132139
didVersionChange ? false : currentStagingDeployCashData.isTimingDashboardChecked,
133140
didVersionChange ? false : currentStagingDeployCashData.isFirebaseChecked,
134141
);

0 commit comments

Comments
 (0)