@@ -15545,8 +15545,8 @@ exports["default"] = newComponentCategory;
1554515545Object.defineProperty(exports, "__esModule", ({ value: true }));
1554615546const GITHUB_BASE_URL_REGEX = new RegExp('https?://(?:github\\.com|api\\.github\\.com)');
1554715547const GIT_CONST = {
15548- GITHUB_OWNER: process.env.GITHUB_REPOSITORY_OWNER,
15549- APP_REPO: process.env.GITHUB_REPOSITORY.split('/').at(1) ?? '',
15548+ GITHUB_OWNER: process.env.GITHUB_REPOSITORY_OWNER ?? 'Expensify' ,
15549+ APP_REPO: ( process.env.GITHUB_REPOSITORY ?? 'Expensify/App') .split('/').at(1) ?? '',
1555015550 MOBILE_EXPENSIFY_REPO: 'Mobile-Expensify',
1555115551};
1555215552const CONST = {
@@ -15622,9 +15622,9 @@ const utils_1 = __nccwpck_require__(3030);
1562215622const plugin_paginate_rest_1 = __nccwpck_require__(4193);
1562315623const plugin_throttling_1 = __nccwpck_require__(9968);
1562415624const request_error_1 = __nccwpck_require__(537);
15625- const EmptyObject_1 = __nccwpck_require__(8227);
15626- const arrayDifference_1 = __importDefault(__nccwpck_require__(7034));
15625+ const arrayDifference_1 = __importDefault(__nccwpck_require__(7532));
1562715626const CONST_1 = __importDefault(__nccwpck_require__(9873));
15627+ const isEmptyObject_1 = __nccwpck_require__(6497);
1562815628class GithubUtils {
1562915629 static internalOctokit;
1563015630 /**
@@ -15815,7 +15815,7 @@ class GithubUtils {
1581515815 static generateStagingDeployCashBodyAndAssignees(tag, PRList, verifiedPRList = [], deployBlockers = [], resolvedDeployBlockers = [], resolvedInternalQAPRs = [], isFirebaseChecked = false, isGHStatusChecked = false) {
1581615816 return this.fetchAllPullRequests(PRList.map((pr) => this.getPullRequestNumberFromURL(pr)))
1581715817 .then((data) => {
15818- const internalQAPRs = Array.isArray(data) ? data.filter((pr) => !(0, EmptyObject_1 .isEmptyObject)(pr.labels.find((item) => item.name === CONST_1.default.LABELS.INTERNAL_QA))) : [];
15818+ const internalQAPRs = Array.isArray(data) ? data.filter((pr) => !(0, isEmptyObject_1 .isEmptyObject)(pr.labels.find((item) => item.name === CONST_1.default.LABELS.INTERNAL_QA))) : [];
1581915819 return Promise.all(internalQAPRs.map((pr) => this.getPullRequestMergerLogin(pr.number).then((mergerLogin) => ({ url: pr.html_url, mergerLogin })))).then((results) => {
1582015820 // The format of this map is following:
1582115821 // {
@@ -15845,7 +15845,7 @@ class GithubUtils {
1584515845 issueBody += '\r\n\r\n';
1584615846 }
1584715847 // Internal QA PR list
15848- if (!(0, EmptyObject_1 .isEmptyObject)(internalQAPRMap)) {
15848+ if (!(0, isEmptyObject_1 .isEmptyObject)(internalQAPRMap)) {
1584915849 console.log('Found the following verified Internal QA PRs:', resolvedInternalQAPRs);
1585015850 issueBody += '**Internal QA:**\r\n';
1585115851 Object.keys(internalQAPRMap).forEach((URL) => {
@@ -16045,6 +16045,24 @@ class GithubUtils {
1604516045 })
1604616046 .then((response) => response.url);
1604716047 }
16048+ /**
16049+ * Get the contents of a file from the API at a given ref as a string.
16050+ */
16051+ static async getFileContents(path, ref = 'main') {
16052+ const { data } = await this.octokit.repos.getContent({
16053+ owner: CONST_1.default.GITHUB_OWNER,
16054+ repo: CONST_1.default.APP_REPO,
16055+ path,
16056+ ref,
16057+ });
16058+ if (Array.isArray(data)) {
16059+ throw new Error(`Provided path ${path} refers to a directory, not a file`);
16060+ }
16061+ if (!('content' in data)) {
16062+ throw new Error(`Provided path ${path} is invalid`);
16063+ }
16064+ return Buffer.from(data.content, 'base64').toString('utf8');
16065+ }
1604816066 /**
1604916067 * Get commits between two tags via the GitHub API
1605016068 */
@@ -16109,38 +16127,25 @@ exports["default"] = GithubUtils;
1610916127
1611016128/***/ }),
1611116129
16112- /***/ 8534 :
16130+ /***/ 7532 :
1611316131/***/ ((__unused_webpack_module, exports) => {
1611416132
1611516133"use strict";
1611616134
1611716135Object.defineProperty(exports, "__esModule", ({ value: true }));
1611816136/**
16119- * Like _.some but for promises. It short-circuts after a promise fulfills with a value that passes the test implemented by provided function.
16120- * It does not wait for the other promises to complete once it finds one.
16121- * If no promise passes the provided test, it rejects.
16137+ * This function is an equivalent of _.difference, it takes two arrays and returns the difference between them.
16138+ * It returns an array of items that are in the first array but not in the second array.
1612216139 */
16123- function promiseSome(promises, callbackFn) {
16124- return new Promise((resolve, reject) => {
16125- for (const p of promises) {
16126- Promise.resolve(p)
16127- .then((res) => {
16128- if (!callbackFn(res)) {
16129- return;
16130- }
16131- resolve(true);
16132- })
16133- .catch(() => { });
16134- }
16135- Promise.allSettled(promises).then(() => reject());
16136- });
16140+ function arrayDifference(array1, array2) {
16141+ return [array1, array2].reduce((a, b) => a.filter((c) => !b.includes(c)));
1613716142}
16138- exports["default"] = promiseSome ;
16143+ exports["default"] = arrayDifference ;
1613916144
1614016145
1614116146/***/ }),
1614216147
16143- /***/ 8227 :
16148+ /***/ 6497 :
1614416149/***/ ((__unused_webpack_module, exports) => {
1614516150
1614616151"use strict";
@@ -16155,20 +16160,33 @@ exports.isEmptyObject = isEmptyObject;
1615516160
1615616161/***/ }),
1615716162
16158- /***/ 7034 :
16163+ /***/ 8534 :
1615916164/***/ ((__unused_webpack_module, exports) => {
1616016165
1616116166"use strict";
1616216167
1616316168Object.defineProperty(exports, "__esModule", ({ value: true }));
1616416169/**
16165- * This function is an equivalent of _.difference, it takes two arrays and returns the difference between them.
16166- * It returns an array of items that are in the first array but not in the second array.
16170+ * Like _.some but for promises. It short-circuts after a promise fulfills with a value that passes the test implemented by provided function.
16171+ * It does not wait for the other promises to complete once it finds one.
16172+ * If no promise passes the provided test, it rejects.
1616716173 */
16168- function arrayDifference(array1, array2) {
16169- return [array1, array2].reduce((a, b) => a.filter((c) => !b.includes(c)));
16174+ function promiseSome(promises, callbackFn) {
16175+ return new Promise((resolve, reject) => {
16176+ for (const p of promises) {
16177+ Promise.resolve(p)
16178+ .then((res) => {
16179+ if (!callbackFn(res)) {
16180+ return;
16181+ }
16182+ resolve(true);
16183+ })
16184+ .catch(() => { });
16185+ }
16186+ Promise.allSettled(promises).then(() => reject());
16187+ });
1617016188}
16171- exports["default"] = arrayDifference ;
16189+ exports["default"] = promiseSome ;
1617216190
1617316191
1617416192/***/ }),
0 commit comments