[No QA][TS migration][g21] Migrate multiple Github utils#38800
[No QA][TS migration][g21] Migrate multiple Github utils#38800Beamanator merged 25 commits intoExpensify:mainfrom
Conversation
| return promiseDoWhile( | ||
| () => !_.isEmpty(currentStagingDeploys), | ||
| _.throttle( | ||
| () => currentStagingDeploys.length, |
There was a problem hiding this comment.
| () => currentStagingDeploys.length, | |
| () => !!currentStagingDeploys.length, |
Shouldn't be like this?
| import type {EmptyObject} from '@src/types/utils/EmptyObject'; | ||
|
|
||
| async function run() { | ||
| async function run(): Promise<Awaited<ReturnType<typeof GithubUtils.octokit.issues.create>>['data'] | void> { |
There was a problem hiding this comment.
Let's extract Awaited<ReturnType<typeof GithubUtils.octokit.issues.create>>['data'] to a separate type?
| // Parse the data from the previous and current checklists into the format used to generate the checklist | ||
| const previousChecklistData = GithubUtils.getStagingDeployCashData(previousChecklist); | ||
| const currentChecklistData = shouldCreateNewDeployChecklist ? {} : GithubUtils.getStagingDeployCashData(mostRecentChecklist); | ||
| const currentChecklistData: StagingDeployCashData | EmptyObject = shouldCreateNewDeployChecklist ? {} : GithubUtils.getStagingDeployCashData(mostRecentChecklist); |
There was a problem hiding this comment.
| const currentChecklistData: StagingDeployCashData | EmptyObject = shouldCreateNewDeployChecklist ? {} : GithubUtils.getStagingDeployCashData(mostRecentChecklist); | |
| const currentChecklistData: StagingDeployCashData | undefined = shouldCreateNewDeployChecklist ? undefined : GithubUtils.getStagingDeployCashData(mostRecentChecklist); |
Let's remove EmptyObject from our lives 😛
| newVersionTag, | ||
| mergedPRs.map((value) => GithubUtils.getPullRequestURLFromNumber(value)), | ||
| ); | ||
| if (stagingDeployCashBodyAndAssignees !== undefined) { |
There was a problem hiding this comment.
| if (stagingDeployCashBodyAndAssignees !== undefined) { | |
| if (stagingDeployCashBodyAndAssignees) { |
| const indexOfPRInCurrentChecklist = currentChecklistData.PRList.findIndex((pr) => pr.number === prNum); | ||
| const isVerified = indexOfPRInCurrentChecklist >= 0 ? currentChecklistData.PRList[indexOfPRInCurrentChecklist].isVerified : false; |
There was a problem hiding this comment.
| const indexOfPRInCurrentChecklist = currentChecklistData.PRList.findIndex((pr) => pr.number === prNum); | |
| const isVerified = indexOfPRInCurrentChecklist >= 0 ? currentChecklistData.PRList[indexOfPRInCurrentChecklist].isVerified : false; | |
| const indexOfPRInCurrentChecklist = currentChecklistData?.PRList.findIndex((pr) => pr.number === prNum) ?? -1; | |
| const isVerified = indexOfPRInCurrentChecklist >= 0 ? currentChecklistData?.PRList[indexOfPRInCurrentChecklist].isVerified : false; |
| } | ||
| }); | ||
|
|
||
| const didVersionChange = newVersionTag !== currentChecklistData.tag; |
There was a problem hiding this comment.
| const didVersionChange = newVersionTag !== currentChecklistData.tag; | |
| const didVersionChange = newVersionTag !== currentChecklistData?.tag; |
| PRList.filter((pr) => pr.isVerified).map((pr) => pr.url), | ||
| deployBlockers.map((blocker) => blocker.url), | ||
| deployBlockers.filter((blocker) => blocker.isResolved).map((blocker) => blocker.url), | ||
| currentChecklistData.internalQAPRList.filter((pr) => pr.isResolved).map((pr) => pr.url), |
There was a problem hiding this comment.
| currentChecklistData.internalQAPRList.filter((pr) => pr.isResolved).map((pr) => pr.url), | |
| currentChecklistData?.internalQAPRList.filter((pr) => pr.isResolved).map((pr) => pr.url), |
| ); | ||
| checklistBody = issueBody; | ||
| checklistAssignees = issueAssignees; | ||
| if (stagingDeployCashBodyAndAssignees !== undefined) { |
There was a problem hiding this comment.
| if (stagingDeployCashBodyAndAssignees !== undefined) { | |
| if (stagingDeployCashBodyAndAssignees) { |
| const {data: updatedChecklist} = await GithubUtils.octokit.issues.update({ | ||
| ...defaultPayload, | ||
| // eslint-disable-next-line @typescript-eslint/naming-convention | ||
| issue_number: currentChecklistData.number, |
There was a problem hiding this comment.
| issue_number: currentChecklistData.number, | |
| issue_number: currentChecklistData?.number ?? 0, |
.github/actions/javascript/getDeployPullRequestList/getDeployPullRequestList.ts
Outdated
Show resolved
Hide resolved
|
We did not find an internal engineer to review this PR, trying to assign a random engineer to #25376 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
Beamanator
left a comment
There was a problem hiding this comment.
I've got a few questions and a few changes recommended, please 🙏
.github/actions/javascript/awaitStagingDeploys/awaitStagingDeploys.ts
Outdated
Show resolved
Hide resolved
.github/actions/javascript/createOrUpdateStagingDeploy/createOrUpdateStagingDeploy.ts
Show resolved
Hide resolved
.github/actions/javascript/getDeployPullRequestList/getDeployPullRequestList.ts
Outdated
Show resolved
Hide resolved
|
@Beamanator Ready to review again! |
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to production by https://github.com/Julesssss in version: 1.4.60-13 🚀
|
Details
Migrate multiple files related with Github Utils
Fixed Issues
$#25376
$#25377
$#25378
$#25379
$#25380
PROPOSAL:
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
N/a
Android: mWeb Chrome
N/a
iOS: Native
N/a
iOS: mWeb Safari
N/a
MacOS: Chrome / Safari
N/a
MacOS: Desktop
N/a