@@ -15252,13 +15252,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
1525215252}) : function(o, v) {
1525315253 o["default"] = v;
1525415254});
15255- var __importStar = (this && this.__importStar) || function (mod) {
15256- if (mod && mod.__esModule) return mod;
15257- var result = {};
15258- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
15259- __setModuleDefault(result, mod);
15260- return result;
15261- };
15255+ var __importStar = (this && this.__importStar) || (function () {
15256+ var ownKeys = function(o) {
15257+ ownKeys = Object.getOwnPropertyNames || function (o) {
15258+ var ar = [];
15259+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
15260+ return ar;
15261+ };
15262+ return ownKeys(o);
15263+ };
15264+ return function (mod) {
15265+ if (mod && mod.__esModule) return mod;
15266+ var result = {};
15267+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
15268+ __setModuleDefault(result, mod);
15269+ return result;
15270+ };
15271+ })();
1526215272var __importDefault = (this && this.__importDefault) || function (mod) {
1526315273 return (mod && mod.__esModule) ? mod : { "default": mod };
1526415274};
@@ -15428,18 +15438,28 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
1542815438}) : function(o, v) {
1542915439 o["default"] = v;
1543015440});
15431- var __importStar = (this && this.__importStar) || function (mod) {
15432- if (mod && mod.__esModule) return mod;
15433- var result = {};
15434- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
15435- __setModuleDefault(result, mod);
15436- return result;
15437- };
15441+ var __importStar = (this && this.__importStar) || (function () {
15442+ var ownKeys = function(o) {
15443+ ownKeys = Object.getOwnPropertyNames || function (o) {
15444+ var ar = [];
15445+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
15446+ return ar;
15447+ };
15448+ return ownKeys(o);
15449+ };
15450+ return function (mod) {
15451+ if (mod && mod.__esModule) return mod;
15452+ var result = {};
15453+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
15454+ __setModuleDefault(result, mod);
15455+ return result;
15456+ };
15457+ })();
1543815458var __importDefault = (this && this.__importDefault) || function (mod) {
1543915459 return (mod && mod.__esModule) ? mod : { "default": mod };
1544015460};
1544115461Object.defineProperty(exports, "__esModule", ({ value: true }));
15442- exports.detectReactComponent = void 0 ;
15462+ exports.detectReactComponent = detectReactComponent ;
1544315463const github = __importStar(__nccwpck_require__(5438));
1544415464const parser_1 = __nccwpck_require__(5026);
1544515465const traverse_1 = __importDefault(__nccwpck_require__(1380));
@@ -15498,7 +15518,6 @@ function detectReactComponent(code, filename) {
1549815518 });
1549915519 return isReactComponent;
1550015520}
15501- exports.detectReactComponent = detectReactComponent;
1550215521function nodeBase64ToUtf8(data) {
1550315522 return Buffer.from(data, 'base64').toString('utf-8');
1550415523}
@@ -15574,6 +15593,21 @@ const CONST = {
1557415593 EVENTS: {
1557515594 ISSUE_COMMENT: 'issue_comment',
1557615595 },
15596+ RUN_EVENT: {
15597+ PULL_REQUEST: 'pull_request',
15598+ PULL_REQUEST_TARGET: 'pull_request_target',
15599+ PUSH: 'push',
15600+ },
15601+ RUN_STATUS: {
15602+ COMPLETED: 'completed',
15603+ IN_PROGRESS: 'in_progress',
15604+ QUEUED: 'queued',
15605+ },
15606+ RUN_STATUS_CONCLUSION: {
15607+ SUCCESS: 'success',
15608+ },
15609+ TEST_WORKFLOW_NAME: 'Jest Unit Tests',
15610+ TEST_WORKFLOW_PATH: '.github/workflows/test.yml',
1557715611 PROPOSAL_KEYWORD: 'Proposal',
1557815612 DATE_FORMAT_STRING: 'yyyy-MM-dd',
1557915613 PULL_REQUEST_REGEX: new RegExp(`${GITHUB_BASE_URL_REGEX.source}/.*/.*/pull/([0-9]+).*`),
@@ -15582,6 +15616,7 @@ const CONST = {
1558215616 POLL_RATE: 10000,
1558315617 APP_REPO_URL: `https://github.com/${GIT_CONST.GITHUB_OWNER}/${GIT_CONST.APP_REPO}`,
1558415618 APP_REPO_GIT_URL: `git@github.com:${GIT_CONST.GITHUB_OWNER}/${GIT_CONST.APP_REPO}.git`,
15619+ MOBILE_EXPENSIFY_URL: `https://github.com/${GIT_CONST.GITHUB_OWNER}/${GIT_CONST.MOBILE_EXPENSIFY_REPO}`,
1558515620 NO_ACTION: 'NO_ACTION',
1558615621 ACTION_EDIT: 'ACTION_EDIT',
1558715622 ACTION_REQUIRED: 'ACTION_REQUIRED',
@@ -15613,13 +15648,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
1561315648}) : function(o, v) {
1561415649 o["default"] = v;
1561515650});
15616- var __importStar = (this && this.__importStar) || function (mod) {
15617- if (mod && mod.__esModule) return mod;
15618- var result = {};
15619- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
15620- __setModuleDefault(result, mod);
15621- return result;
15622- };
15651+ var __importStar = (this && this.__importStar) || (function () {
15652+ var ownKeys = function(o) {
15653+ ownKeys = Object.getOwnPropertyNames || function (o) {
15654+ var ar = [];
15655+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
15656+ return ar;
15657+ };
15658+ return ownKeys(o);
15659+ };
15660+ return function (mod) {
15661+ if (mod && mod.__esModule) return mod;
15662+ var result = {};
15663+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
15664+ __setModuleDefault(result, mod);
15665+ return result;
15666+ };
15667+ })();
1562315668var __importDefault = (this && this.__importDefault) || function (mod) {
1562415669 return (mod && mod.__esModule) ? mod : { "default": mod };
1562515670};
@@ -15749,6 +15794,7 @@ class GithubUtils {
1574915794 number: this.getIssueOrPullRequestNumberFromURL(issue.url),
1575015795 labels: issue.labels,
1575115796 PRList: this.getStagingDeployCashPRList(issue),
15797+ PRListMobileExpensify: this.getStagingDeployCashPRListMobileExpensify(issue),
1575215798 deployBlockers: this.getStagingDeployCashDeployBlockers(issue),
1575315799 internalQAPRList: this.getStagingDeployCashInternalQA(issue),
1575415800 isFirebaseChecked: issue.body ? /-\s\[x]\sI checked \[Firebase Crashlytics]/.test(issue.body) : false,
@@ -15781,6 +15827,19 @@ class GithubUtils {
1578115827 }));
1578215828 return PRList.sort((a, b) => a.number - b.number);
1578315829 }
15830+ static getStagingDeployCashPRListMobileExpensify(issue) {
15831+ let mobileExpensifySection = issue.body?.match(/Mobile-Expensify PRs:\*\*\r?\n((?:-.*\r?\n)+)/) ?? null;
15832+ if (mobileExpensifySection?.length !== 2) {
15833+ return [];
15834+ }
15835+ mobileExpensifySection = mobileExpensifySection[1];
15836+ const mobileExpensifyPRs = [...mobileExpensifySection.matchAll(new RegExp(`- \\[([ x])]\\s(${CONST_1.default.ISSUE_OR_PULL_REQUEST_REGEX.source})`, 'g'))].map((match) => ({
15837+ url: match[2],
15838+ number: Number.parseInt(match[3], 10),
15839+ isVerified: match[1] === 'x',
15840+ }));
15841+ return mobileExpensifyPRs.sort((a, b) => a.number - b.number);
15842+ }
1578415843 /**
1578515844 * Parse DeployBlocker section of the StagingDeployCash issue body.
1578615845 *
@@ -15820,7 +15879,7 @@ class GithubUtils {
1582015879 /**
1582115880 * Generate the issue body and assignees for a StagingDeployCash.
1582215881 */
15823- static generateStagingDeployCashBodyAndAssignees(tag, PRList, verifiedPRList = [], deployBlockers = [], resolvedDeployBlockers = [], resolvedInternalQAPRs = [], isFirebaseChecked = false, isGHStatusChecked = false) {
15882+ static generateStagingDeployCashBodyAndAssignees(tag, PRList, PRListMobileExpensify, verifiedPRList = [], verifiedPRListMobileExpensify = [], deployBlockers = [], resolvedDeployBlockers = [], resolvedInternalQAPRs = [], isFirebaseChecked = false, isGHStatusChecked = false) {
1582415883 return this.fetchAllPullRequests(PRList.map((pr) => this.getPullRequestNumberFromURL(pr)))
1582515884 .then((data) => {
1582615885 const internalQAPRs = Array.isArray(data) ? data.filter((pr) => !(0, isEmptyObject_1.isEmptyObject)(pr.labels.find((item) => item.name === CONST_1.default.LABELS.INTERNAL_QA))) : [];
@@ -15837,12 +15896,18 @@ class GithubUtils {
1583715896 console.log('Found the following Internal QA PRs:', internalQAPRMap);
1583815897 const noQAPRs = Array.isArray(data) ? data.filter((PR) => /\[No\s?QA]/i.test(PR.title)).map((item) => item.html_url) : [];
1583915898 console.log('Found the following NO QA PRs:', noQAPRs);
15840- const verifiedOrNoQAPRs = [...new Set([...verifiedPRList, ...noQAPRs])];
15899+ const verifiedOrNoQAPRs = [...new Set([...verifiedPRList, ...verifiedPRListMobileExpensify, ... noQAPRs])];
1584115900 const sortedPRList = [...new Set((0, arrayDifference_1.default)(PRList, Object.keys(internalQAPRMap)))].sort((a, b) => GithubUtils.getPullRequestNumberFromURL(a) - GithubUtils.getPullRequestNumberFromURL(b));
15901+ const sortedPRListMobileExpensify = [...new Set(PRListMobileExpensify)].sort((a, b) => GithubUtils.getPullRequestNumberFromURL(a) - GithubUtils.getPullRequestNumberFromURL(b));
1584215902 const sortedDeployBlockers = [...new Set(deployBlockers)].sort((a, b) => GithubUtils.getIssueOrPullRequestNumberFromURL(a) - GithubUtils.getIssueOrPullRequestNumberFromURL(b));
1584315903 // Tag version and comparison URL
1584415904 // eslint-disable-next-line max-len
15845- let issueBody = `**Release Version:** \`${tag}\`\r\n**Compare Changes:** https://github.com/${process.env.GITHUB_REPOSITORY}/compare/production...staging\r\n\r\n`;
15905+ let issueBody = `**Release Version:** \`${tag}\`\r\n**Compare Changes:** https://github.com/${process.env.GITHUB_REPOSITORY}/compare/production...staging\r\n`;
15906+ // Add Mobile-Expensify compare link if there are Mobile-Expensify PRs
15907+ if (sortedPRListMobileExpensify.length > 0) {
15908+ issueBody += `**Mobile-Expensify Changes:** https://github.com/${CONST_1.default.GITHUB_OWNER}/${CONST_1.default.MOBILE_EXPENSIFY_REPO}/compare/production...staging\r\n`;
15909+ }
15910+ issueBody += '\r\n';
1584615911 // Warn deployers about potential bugs with the new process
1584715912 issueBody +=
1584815913 '> 💡 **Deployer FYI:** This checklist was generated using a new process. PR list from original method and detail logging can be found in the most recent [deploy workflow](https://github.com/Expensify/App/actions/workflows/deploy.yml) labeled `staging`, in the `createChecklist` action. Please tag @Julesssss with any issues.\r\n\r\n';
@@ -15855,6 +15920,15 @@ class GithubUtils {
1585515920 });
1585615921 issueBody += '\r\n\r\n';
1585715922 }
15923+ // Mobile-Expensify PR list
15924+ if (sortedPRListMobileExpensify.length > 0) {
15925+ issueBody += '**Mobile-Expensify PRs:**\r\n';
15926+ sortedPRListMobileExpensify.forEach((URL) => {
15927+ issueBody += verifiedOrNoQAPRs.includes(URL) ? '- [x]' : '- [ ]';
15928+ issueBody += ` ${URL}\r\n`;
15929+ });
15930+ issueBody += '\r\n\r\n';
15931+ }
1585815932 // Internal QA PR list
1585915933 if (!(0, isEmptyObject_1.isEmptyObject)(internalQAPRMap)) {
1586015934 console.log('Found the following verified Internal QA PRs:', resolvedInternalQAPRs);
@@ -15912,7 +15986,7 @@ class GithubUtils {
1591215986 }
1591315987 return data;
1591415988 })
15915- .then((prList) => prList.filter((pr) => pullRequestNumbers.includes(pr.number)))
15989+ .then((prList) => prList? .filter((pr) => pullRequestNumbers.includes(pr.number)) ?? [] )
1591615990 .catch((err) => console.error('Failed to get PR list', err));
1591715991 }
1591815992 static getPullRequestMergerLogin(pullRequestNumber) {
@@ -15997,8 +16071,8 @@ class GithubUtils {
1599716071 /**
1599816072 * Generate the URL of an New Expensify pull request given the PR number.
1599916073 */
16000- static getPullRequestURLFromNumber(value) {
16001- return `${CONST_1.default.APP_REPO_URL }/pull/${value}`;
16074+ static getPullRequestURLFromNumber(value, repositoryURL ) {
16075+ return `${repositoryURL }/pull/${value}`;
1600216076 }
1600316077 /**
1600416078 * Parse the pull request number from a URL.
@@ -16096,7 +16170,7 @@ class GithubUtils {
1609616170 /**
1609716171 * Get commits between two tags via the GitHub API
1609816172 */
16099- static async getCommitHistoryBetweenTags(fromTag, toTag) {
16173+ static async getCommitHistoryBetweenTags(fromTag, toTag, repositoryName ) {
1610016174 console.log('Getting pull requests merged between the following tags:', fromTag, toTag);
1610116175 core.startGroup('Fetching paginated commits:');
1610216176 try {
@@ -16108,7 +16182,7 @@ class GithubUtils {
1610816182 core.info(`📄 Fetching page ${page} of commits...`);
1610916183 const response = await this.octokit.repos.compareCommits({
1611016184 owner: CONST_1.default.GITHUB_OWNER,
16111- repo: CONST_1.default.APP_REPO ,
16185+ repo: repositoryName ,
1611216186 base: fromTag,
1611316187 head: toTag,
1611416188 per_page: perPage,
@@ -16137,6 +16211,7 @@ class GithubUtils {
1613716211 }
1613816212 core.info(`🎉 Successfully fetched ${allCommits.length} total commits`);
1613916213 core.endGroup();
16214+ console.log('');
1614016215 return allCommits.map((commit) => ({
1614116216 commit: commit.sha,
1614216217 subject: commit.commit.message,
@@ -16145,9 +16220,10 @@ class GithubUtils {
1614516220 }
1614616221 catch (error) {
1614716222 if (error instanceof request_error_1.RequestError && error.status === 404) {
16148- console .error(`❓❓ Failed to get commits with the GitHub API. The base tag ('${fromTag}') or head tag ('${toTag}') likely doesn't exist on the remote repository. If this is the case, create or push them.`);
16223+ core .error(`❓❓ Failed to get commits with the GitHub API. The base tag ('${fromTag}') or head tag ('${toTag}') likely doesn't exist on the remote repository. If this is the case, create or push them.`);
1614916224 }
1615016225 core.endGroup();
16226+ console.log('');
1615116227 throw error;
1615216228 }
1615316229 }
@@ -16181,11 +16257,10 @@ exports["default"] = arrayDifference;
1618116257"use strict";
1618216258
1618316259Object.defineProperty(exports, "__esModule", ({ value: true }));
16184- exports.isEmptyObject = void 0 ;
16260+ exports.isEmptyObject = isEmptyObject ;
1618516261function isEmptyObject(obj) {
1618616262 return Object.keys(obj ?? {}).length === 0;
1618716263}
16188- exports.isEmptyObject = isEmptyObject;
1618916264
1619016265
1619116266/***/ }),
@@ -16196,6 +16271,7 @@ exports.isEmptyObject = isEmptyObject;
1619616271"use strict";
1619716272
1619816273Object.defineProperty(exports, "__esModule", ({ value: true }));
16274+ exports["default"] = promiseSome;
1619916275/**
1620016276 * Like _.some but for promises. It short-circuts after a promise fulfills with a value that passes the test implemented by provided function.
1620116277 * It does not wait for the other promises to complete once it finds one.
@@ -16216,7 +16292,6 @@ function promiseSome(promises, callbackFn) {
1621616292 Promise.allSettled(promises).then(() => reject());
1621716293 });
1621816294}
16219- exports["default"] = promiseSome;
1622016295
1622116296
1622216297/***/ }),
0 commit comments