-
Notifications
You must be signed in to change notification settings - Fork 3k
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] Improve workflow failure notifier #41124
[No QA] Improve workflow failure notifier #41124
Conversation
…revious workflow run and jobs
if (previousRun.actor.login === 'OSBotify') { | ||
return allRuns.data.workflow_runs.find(run => run.run_number === run_number - 2); | ||
} |
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 don't think this will work if multiple runs are from OSBotify
. Can we just filter out any runs with actor.login === 'OSBotify'
first before getting the last one? Do we also need to filter out cancelled runs?
const existingIssue = issues.data.find(issue => issue.title.includes(jobName)); | ||
if (!existingIssue) { | ||
const previousJob = previousRunJobs.jobs.find(job => job.name === jobName); | ||
previousJobSucceeded = previousJob.conclusion === 'success'; |
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.
previousJobSucceeded = previousJob.conclusion === 'success'; | |
previousJobSucceeded = previousJob?.conclusion === 'success'; |
I guess it's possible that previousJob
could return false for some reason.
if (!existingIssue) { | ||
const previousJob = previousRunJobs.jobs.find(job => job.name === jobName); | ||
previousJobSucceeded = previousJob.conclusion === 'success'; | ||
if (previousJobSucceeded) { |
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 (previousJobSucceeded) { | |
if (previousJob?.conclusion === 'success') { |
I don't think there's much benefit to having previousJobSucceeded
since we don't use it anywhere else.
}); | ||
const run = allRuns.data.workflow_runs.find(run => run.id === runId); | ||
const run_number = run.run_number; | ||
const previousRun = allRuns.data.workflow_runs.find(run => run.run_number === run_number - 1); |
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 guess run_number
is always consecutive? I wonder if it's safer to use findIndex
to get the current run and then select the previous run using the index?
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.
Looking good! Just a few comments to address.
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
Comments addressed in aa13921 |
}); | ||
const filteredRuns = allRuns.data.workflow_runs.filter(run => run.actor.login !== 'OSBotify' && run.status !== 'cancelled'); | ||
const currentIndex = filteredRuns.findIndex(run => run.id === runId); | ||
const previousRun = filteredRuns[currentIndex + 1]; |
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.
The array is sorted by most recent first:
https://api.github.com/repos/Expensify/App/actions/workflows/preDeploy.yml/runs
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.
Code LGTM and tests well!
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! Thank you! 🚀
✋ 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 staging by https://github.com/blimpich in version: 1.4.69-0 🚀
|
🚀 Deployed to production by https://github.com/Beamanator in version: 1.4.69-2 🚀
|
Details
Fixed Issues
$ #40612
PROPOSAL: N/A
https://expensify.slack.com/archives/C01GTK53T8Q/p1713557143833969?thread_ts=1713554811.796439&cid=C01GTK53T8Q
Tests
Test on a sample repo: https://github.com/rayane-djouah/testworkflow
Offline tests
N/A
QA Steps
N/A
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
Screen.Recording.2024-04-28.at.4.22.10.PM.mov
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop