-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[No QA][TS migration][g21] Migrate multiple Github utils #38800
Conversation
? '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), | ||
_.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?
|
||
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?
@@ -33,34 +35,34 @@ async function run() { | |||
|
|||
// 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; |
deployBlockers.push({ | ||
...deployBlocker, | ||
isResolved, | ||
}); | ||
} | ||
}); | ||
|
||
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), |
didVersionChange ? false : currentChecklistData.isTimingDashboardChecked, | ||
didVersionChange ? false : currentChecklistData.isFirebaseChecked, | ||
didVersionChange ? false : currentChecklistData.isGHStatusChecked, | ||
); | ||
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) { |
@@ -132,18 +130,19 @@ async function run() { | |||
|
|||
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! |
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! |
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 Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.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