@@ -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 = {
@@ -15560,6 +15560,13 @@ const CONST = {
1556015560 HELP_WANTED: 'Help Wanted',
1556115561 CP_STAGING: 'CP Staging',
1556215562 },
15563+ STATE: {
15564+ OPEN: 'open',
15565+ },
15566+ COMMENT: {
15567+ TYPE_BOT: 'Bot',
15568+ NAME_GITHUB_ACTIONS: 'github-actions',
15569+ },
1556315570 ACTIONS: {
1556415571 CREATED: 'created',
1556515572 EDITED: 'edited',
@@ -15578,6 +15585,7 @@ const CONST = {
1557815585 NO_ACTION: 'NO_ACTION',
1557915586 ACTION_EDIT: 'ACTION_EDIT',
1558015587 ACTION_REQUIRED: 'ACTION_REQUIRED',
15588+ ACTION_HIDE_DUPLICATE: 'ACTION_HIDE_DUPLICATE',
1558115589};
1558215590exports["default"] = CONST;
1558315591
@@ -15622,9 +15630,9 @@ const utils_1 = __nccwpck_require__(3030);
1562215630const plugin_paginate_rest_1 = __nccwpck_require__(4193);
1562315631const plugin_throttling_1 = __nccwpck_require__(9968);
1562415632const request_error_1 = __nccwpck_require__(537);
15625- const EmptyObject_1 = __nccwpck_require__(8227);
15626- const arrayDifference_1 = __importDefault(__nccwpck_require__(7034));
15633+ const arrayDifference_1 = __importDefault(__nccwpck_require__(7532));
1562715634const CONST_1 = __importDefault(__nccwpck_require__(9873));
15635+ const isEmptyObject_1 = __nccwpck_require__(6497);
1562815636class GithubUtils {
1562915637 static internalOctokit;
1563015638 /**
@@ -15815,7 +15823,7 @@ class GithubUtils {
1581515823 static generateStagingDeployCashBodyAndAssignees(tag, PRList, verifiedPRList = [], deployBlockers = [], resolvedDeployBlockers = [], resolvedInternalQAPRs = [], isFirebaseChecked = false, isGHStatusChecked = false) {
1581615824 return this.fetchAllPullRequests(PRList.map((pr) => this.getPullRequestNumberFromURL(pr)))
1581715825 .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))) : [];
15826+ const internalQAPRs = Array.isArray(data) ? data.filter((pr) => !(0, isEmptyObject_1 .isEmptyObject)(pr.labels.find((item) => item.name === CONST_1.default.LABELS.INTERNAL_QA))) : [];
1581915827 return Promise.all(internalQAPRs.map((pr) => this.getPullRequestMergerLogin(pr.number).then((mergerLogin) => ({ url: pr.html_url, mergerLogin })))).then((results) => {
1582015828 // The format of this map is following:
1582115829 // {
@@ -15845,7 +15853,7 @@ class GithubUtils {
1584515853 issueBody += '\r\n\r\n';
1584615854 }
1584715855 // Internal QA PR list
15848- if (!(0, EmptyObject_1 .isEmptyObject)(internalQAPRMap)) {
15856+ if (!(0, isEmptyObject_1 .isEmptyObject)(internalQAPRMap)) {
1584915857 console.log('Found the following verified Internal QA PRs:', resolvedInternalQAPRs);
1585015858 issueBody += '**Internal QA:**\r\n';
1585115859 Object.keys(internalQAPRMap).forEach((URL) => {
@@ -15938,6 +15946,14 @@ class GithubUtils {
1593815946 per_page: 100,
1593915947 }, (response) => response.data.map((comment) => comment.body));
1594015948 }
15949+ static getAllCommentDetails(issueNumber) {
15950+ return this.paginate(this.octokit.issues.listComments, {
15951+ owner: CONST_1.default.GITHUB_OWNER,
15952+ repo: CONST_1.default.APP_REPO,
15953+ issue_number: issueNumber,
15954+ per_page: 100,
15955+ }, (response) => response.data);
15956+ }
1594115957 /**
1594215958 * Create comment on pull request
1594315959 */
@@ -16045,6 +16061,24 @@ class GithubUtils {
1604516061 })
1604616062 .then((response) => response.url);
1604716063 }
16064+ /**
16065+ * Get the contents of a file from the API at a given ref as a string.
16066+ */
16067+ static async getFileContents(path, ref = 'main') {
16068+ const { data } = await this.octokit.repos.getContent({
16069+ owner: CONST_1.default.GITHUB_OWNER,
16070+ repo: CONST_1.default.APP_REPO,
16071+ path,
16072+ ref,
16073+ });
16074+ if (Array.isArray(data)) {
16075+ throw new Error(`Provided path ${path} refers to a directory, not a file`);
16076+ }
16077+ if (!('content' in data)) {
16078+ throw new Error(`Provided path ${path} is invalid`);
16079+ }
16080+ return Buffer.from(data.content, 'base64').toString('utf8');
16081+ }
1604816082 /**
1604916083 * Get commits between two tags via the GitHub API
1605016084 */
@@ -16109,38 +16143,25 @@ exports["default"] = GithubUtils;
1610916143
1611016144/***/ }),
1611116145
16112- /***/ 8534 :
16146+ /***/ 7532 :
1611316147/***/ ((__unused_webpack_module, exports) => {
1611416148
1611516149"use strict";
1611616150
1611716151Object.defineProperty(exports, "__esModule", ({ value: true }));
1611816152/**
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.
16153+ * This function is an equivalent of _.difference, it takes two arrays and returns the difference between them.
16154+ * It returns an array of items that are in the first array but not in the second array.
1612216155 */
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- });
16156+ function arrayDifference(array1, array2) {
16157+ return [array1, array2].reduce((a, b) => a.filter((c) => !b.includes(c)));
1613716158}
16138- exports["default"] = promiseSome ;
16159+ exports["default"] = arrayDifference ;
1613916160
1614016161
1614116162/***/ }),
1614216163
16143- /***/ 8227 :
16164+ /***/ 6497 :
1614416165/***/ ((__unused_webpack_module, exports) => {
1614516166
1614616167"use strict";
@@ -16155,20 +16176,33 @@ exports.isEmptyObject = isEmptyObject;
1615516176
1615616177/***/ }),
1615716178
16158- /***/ 7034 :
16179+ /***/ 8534 :
1615916180/***/ ((__unused_webpack_module, exports) => {
1616016181
1616116182"use strict";
1616216183
1616316184Object.defineProperty(exports, "__esModule", ({ value: true }));
1616416185/**
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.
16186+ * Like _.some but for promises. It short-circuts after a promise fulfills with a value that passes the test implemented by provided function.
16187+ * It does not wait for the other promises to complete once it finds one.
16188+ * If no promise passes the provided test, it rejects.
1616716189 */
16168- function arrayDifference(array1, array2) {
16169- return [array1, array2].reduce((a, b) => a.filter((c) => !b.includes(c)));
16190+ function promiseSome(promises, callbackFn) {
16191+ return new Promise((resolve, reject) => {
16192+ for (const p of promises) {
16193+ Promise.resolve(p)
16194+ .then((res) => {
16195+ if (!callbackFn(res)) {
16196+ return;
16197+ }
16198+ resolve(true);
16199+ })
16200+ .catch(() => { });
16201+ }
16202+ Promise.allSettled(promises).then(() => reject());
16203+ });
1617016204}
16171- exports["default"] = arrayDifference ;
16205+ exports["default"] = promiseSome ;
1617216206
1617316207
1617416208/***/ }),
0 commit comments