Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
55b9f2e
[TS migration][g21] Migrate multiple github utils files
ruben-rebelo Mar 22, 2024
4c1e770
Merge branch 'main' of github.com:kubabutkiewicz/expensify-app into g…
kubabutkiewicz Mar 27, 2024
cb175ae
fix: wip
kubabutkiewicz Mar 27, 2024
4b7e411
fix: wip
kubabutkiewicz Mar 27, 2024
5719f9f
Merge branch 'main' of github.com:kubabutkiewicz/expensify-app into g…
kubabutkiewicz Mar 27, 2024
0a3a188
fix: typecheck
kubabutkiewicz Mar 28, 2024
76bcd9a
Merge branch 'main' of github.com:ruben-rebelo/App into group21
kubabutkiewicz Mar 28, 2024
c36db27
fix: run gh-actions-build
kubabutkiewicz Mar 28, 2024
2819878
fix: run gh-actions-build
kubabutkiewicz Mar 28, 2024
da71a7f
Merge branch 'main' of github.com:ruben-rebelo/App into group21
kubabutkiewicz Mar 28, 2024
b924938
fix: run gh-actions-build
kubabutkiewicz Mar 28, 2024
5c89a97
fix: github actions test
kubabutkiewicz Mar 28, 2024
1f85166
fix: run gh-actions-build
kubabutkiewicz Mar 28, 2024
37306f5
fix: import of core gh actions
kubabutkiewicz Mar 28, 2024
884ae54
fix: import of github from @actions/github
kubabutkiewicz Mar 28, 2024
bdfc612
Merge branch 'main' of github.com:ruben-rebelo/App into group21
kubabutkiewicz Mar 29, 2024
f606405
fix: run gh-actions-build
kubabutkiewicz Mar 29, 2024
d3ea94a
fix: resolve comments
kubabutkiewicz Mar 29, 2024
ccf4749
fix: workflow tests
kubabutkiewicz Mar 29, 2024
8325ec9
Merge branch 'main' of github.com:ruben-rebelo/App into group21
kubabutkiewicz Mar 29, 2024
b9de026
fix: run gh-actions-build
kubabutkiewicz Mar 29, 2024
027ac4b
Merge branch 'main' of github.com:ruben-rebelo/App into group21
kubabutkiewicz Apr 2, 2024
d0de973
Merge branch 'main' of github.com:ruben-rebelo/App into group21
kubabutkiewicz Apr 3, 2024
896d39b
fix: resolve comments
kubabutkiewicz Apr 3, 2024
4a0cdf6
fix: run gh-actions-build
kubabutkiewicz Apr 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 30 additions & 28 deletions .github/actions/javascript/authorChecklist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,6 @@
/******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({

/***/ 4097:
/***/ ((module) => {

const CONST = {
GITHUB_OWNER: 'Expensify',
APP_REPO: 'App',
APPLAUSE_BOT: 'applausebot',
OS_BOTIFY: 'OSBotify',
LABELS: {
STAGING_DEPLOY: 'StagingDeployCash',
DEPLOY_BLOCKER: 'DeployBlockerCash',
INTERNAL_QA: 'InternalQA',
},
DATE_FORMAT_STRING: 'yyyy-MM-dd',
};

CONST.APP_REPO_URL = `https://github.com/${CONST.GITHUB_OWNER}/${CONST.APP_REPO}`;
CONST.APP_REPO_GIT_URL = `git@github.com:${CONST.GITHUB_OWNER}/${CONST.APP_REPO}.git`;

module.exports = CONST;


/***/ }),

/***/ 7351:
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {

Expand Down Expand Up @@ -16617,7 +16593,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
const core = __importStar(__nccwpck_require__(2186));
const github = __importStar(__nccwpck_require__(5438));
const escapeRegExp_1 = __importDefault(__nccwpck_require__(8415));
const CONST_1 = __importDefault(__nccwpck_require__(4097));
const CONST_1 = __importDefault(__nccwpck_require__(9873));
const GithubUtils_1 = __importDefault(__nccwpck_require__(9296));
const newComponentCategory_1 = __importDefault(__nccwpck_require__(9032));
const pathToAuthorChecklist = `https://raw.githubusercontent.com/${CONST_1.default.GITHUB_OWNER}/${CONST_1.default.APP_REPO}/main/.github/PULL_REQUEST_TEMPLATE.md`;
Expand Down Expand Up @@ -16770,7 +16746,7 @@ exports.detectReactComponent = void 0;
const github_1 = __importDefault(__nccwpck_require__(5438));
const parser_1 = __nccwpck_require__(5026);
const traverse_1 = __importDefault(__nccwpck_require__(1380));
const CONST_1 = __importDefault(__nccwpck_require__(4097));
const CONST_1 = __importDefault(__nccwpck_require__(9873));
const GithubUtils_1 = __importDefault(__nccwpck_require__(9296));
const promiseSome_1 = __importDefault(__nccwpck_require__(8534));
const items = [
Expand Down Expand Up @@ -16862,6 +16838,33 @@ const newComponentCategory = {
exports["default"] = newComponentCategory;


/***/ }),

/***/ 9873:
/***/ ((__unused_webpack_module, exports) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
const CONST = {
GITHUB_OWNER: 'Expensify',
APP_REPO: 'App',
APPLAUSE_BOT: 'applausebot',
OS_BOTIFY: 'OSBotify',
LABELS: {
STAGING_DEPLOY: 'StagingDeployCash',
DEPLOY_BLOCKER: 'DeployBlockerCash',
INTERNAL_QA: 'InternalQA',
},
DATE_FORMAT_STRING: 'yyyy-MM-dd',
APP_REPO_URL: '',
APP_REPO_GIT_URL: '',
};
CONST.APP_REPO_URL = `https://github.com/${CONST.GITHUB_OWNER}/${CONST.APP_REPO}`;
CONST.APP_REPO_GIT_URL = `git@github.com:${CONST.GITHUB_OWNER}/${CONST.APP_REPO}.git`;
exports["default"] = CONST;


/***/ }),

/***/ 9296:
Expand Down Expand Up @@ -16904,7 +16907,7 @@ const plugin_paginate_rest_1 = __nccwpck_require__(4193);
const plugin_throttling_1 = __nccwpck_require__(9968);
const EmptyObject_1 = __nccwpck_require__(8227);
const arrayDifference_1 = __importDefault(__nccwpck_require__(7034));
const CONST_1 = __importDefault(__nccwpck_require__(4097));
const CONST_1 = __importDefault(__nccwpck_require__(9873));
const GITHUB_BASE_URL_REGEX = new RegExp('https?://(?:github\\.com|api\\.github\\.com)');
const PULL_REQUEST_REGEX = new RegExp(`${GITHUB_BASE_URL_REGEX.source}/.*/.*/pull/([0-9]+).*`);
const ISSUE_REGEX = new RegExp(`${GITHUB_BASE_URL_REGEX.source}/.*/.*/issues/([0-9]+).*`);
Expand Down Expand Up @@ -17250,7 +17253,6 @@ class GithubUtils {
* Generate the URL of an New Expensify pull request given the PR number.
*/
static getPullRequestURLFromNumber(value) {
// @ts-expect-error TODO: Remove this once CONST.js (https://github.com/Expensify/App/issues/25362) is migrated to TypeScript
return `${CONST_1.default.APP_REPO_URL}/pull/${value}`;
}
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
const _ = require('underscore');
const lodashThrottle = require('lodash/throttle');
const CONST = require('../../../libs/CONST');
const ActionUtils = require('../../../libs/ActionUtils');
const GitHubUtils = require('../../../libs/GithubUtils');
const {promiseDoWhile} = require('../../../libs/promiseWhile');
/* eslint-disable @typescript-eslint/naming-convention */
import lodashThrottle from 'lodash/throttle';
import ActionUtils from '@github/libs/ActionUtils';
import CONST from '@github/libs/CONST';
import GitHubUtils, {POLL_RATE} from '@github/libs/GithubUtils';
import {promiseDoWhile} from '@github/libs/promiseWhile';

type CurrentStagingDeploys = Awaited<ReturnType<typeof GitHubUtils.octokit.actions.listWorkflowRuns>>['data']['workflow_runs'];

function run() {
console.info('[awaitStagingDeploys] run()');
Expand All @@ -14,9 +16,9 @@ function run() {
const tag = ActionUtils.getStringInput('TAG', {required: false});
console.info('[awaitStagingDeploys] run() tag', tag);

let currentStagingDeploys = [];
let currentStagingDeploys: CurrentStagingDeploys = [];

console.info('[awaitStagingDeploys] run() _.throttle', _.throttle);
console.info('[awaitStagingDeploys] run() _.throttle', lodashThrottle);

const throttleFunc = () =>
Promise.all([
Expand All @@ -40,28 +42,28 @@ function run() {
])
.then((responses) => {
const workflowRuns = responses[0].data.workflow_runs;
if (!tag) {
if (!tag && typeof responses[1] === 'object') {
workflowRuns.push(...responses[1].data.workflow_runs);
}
return workflowRuns;
})
.then((workflowRuns) => (currentStagingDeploys = _.filter(workflowRuns, (workflowRun) => workflowRun.status !== 'completed')))
.then((workflowRuns) => (currentStagingDeploys = workflowRuns.filter((workflowRun) => workflowRun.status !== 'completed')))
.then(() =>
console.log(
_.isEmpty(currentStagingDeploys)
!currentStagingDeploys.length
? 'No current staging deploys found'
: `Found ${currentStagingDeploys.length} staging deploy${currentStagingDeploys.length > 1 ? 's' : ''} still running...`,
),
);
console.info('[awaitStagingDeploys] run() throttleFunc', throttleFunc);

return promiseDoWhile(
() => !_.isEmpty(currentStagingDeploys),
() => !!currentStagingDeploys.length,
lodashThrottle(
throttleFunc,

// Poll every 60 seconds instead of every 10 seconds
GitHubUtils.POLL_RATE * 6,
POLL_RATE * 6,
),
);
}
Expand All @@ -70,4 +72,4 @@ if (require.main === module) {
run();
}

module.exports = run;
export default run;
Loading