-
Notifications
You must be signed in to change notification settings - Fork 3.5k
[No QA][TS migration][g21] Migrate multiple Github utils #38800
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| return promiseDoWhile( | ||
| () => !_.isEmpty(currentStagingDeploys), | ||
| _.throttle( | ||
| () => currentStagingDeploys.length, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| () => 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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! |
Beamanator
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
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