Skip to content

Commit

Permalink
Merge branch 'main' of github.com:kubabutkiewicz/expensify-app into t…
Browse files Browse the repository at this point in the history
…s-migration/G18
  • Loading branch information
kubabutkiewicz committed Apr 3, 2024
2 parents 3338c04 + 94b9b33 commit 2d2512d
Show file tree
Hide file tree
Showing 44 changed files with 24,280 additions and 30,176 deletions.
2,912 changes: 1,457 additions & 1,455 deletions .github/actions/javascript/authorChecklist/index.js

Large diffs are not rendered by default.

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';

Check failure on line 3 in .github/actions/javascript/awaitStagingDeploys/awaitStagingDeploys.ts

View workflow job for this annotation

GitHub Actions / typecheck

Module '"/home/runner/work/App/App/.github/libs/ActionUtils"' has no default export.
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(

Check failure on line 62 in .github/actions/javascript/awaitStagingDeploys/awaitStagingDeploys.ts

View workflow job for this annotation

GitHub Actions / typecheck

Argument of type 'DebouncedFunc<() => Promise<void>>' is not assignable to parameter of type '() => Promise<void>'.
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

0 comments on commit 2d2512d

Please sign in to comment.