-
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] Fix checkDeploymentSuccess job in deploy workflow #49432
[No QA] Fix checkDeploymentSuccess job in deploy workflow #49432
Conversation
@allgandalf Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
C+ review is not needed here |
PR ready for review |
Can someone please dismiss my review request |
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.
@rayane-djouah thanks for the PR, can you please update the PR body with detailed explanation of the root cause and hence your changes/ why they should fix this? It is not clear to me how the issue is addressed. Thank you!
@@ -540,7 +546,7 @@ jobs: | |||
|
|||
finalizeRelease: | |||
runs-on: ubuntu-latest | |||
if: ${{ github.ref == 'refs/heads/production' && fromJSON(needs.checkDeploymentSuccess.outputs.IS_AT_LEAST_ONE_PLATFORM_DEPLOYED) }} | |||
if: ${{ always() && github.ref == 'refs/heads/production' && fromJSON(needs.checkDeploymentSuccess.outputs.IS_AT_LEAST_ONE_PLATFORM_DEPLOYED) }} |
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.
Why do you add the always here?
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 always()
was added to ensure the condition is evaluated even if some platform deployments fail. Without it, these jobs could be skipped
if [ "${{ needs.android.result }}" == "success" ] && \ | ||
[ "${{ needs.iOS.result }}" == "success" ] && \ | ||
[ "${{ needs.desktop.result }}" == "success" ] && \ | ||
[ "${{ needs.web.result }}" == "success" ]; then | ||
isAllPlatformsDeployed="true" | ||
fi | ||
echo "IS_AT_LEAST_ONE_PLATFORM_DEPLOYED=\"$isAtLeastOnePlatformDeployed\"" >> "$GITHUB_OUTPUT" | ||
echo "IS_ALL_PLATFORMS_DEPLOYED=\"$isAllPlatformsDeployed\"" >> "$GITHUB_OUTPUT" | ||
echo "IS_ALL_PLATFORMS_DEPLOYED=$isAllPlatformsDeployed" >> "$GITHUB_OUTPUT" |
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.
So this seems to be the main difference here; otherwise, splitting this up into two steps does not seem like much of a logical change, right?
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.
Yes, the main change is removing the quotes to set the values as booleans, avoiding the truthy string issue. Splitting into two steps is just for clarity.
@mountiny - I've added a detailed explanation of the root cause and the changes made in the PR body. Please take a look. Thank you! |
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.
Thanks for this @rayane-djouah! I didn't realize that always()
is necessary if any upstream job failed. createPrerelease
is only directly dependent on prep
and checkDeploymentSuccess
, and both of those passed. The issue is that checkDeploymentSuccess
was dependent on android
, which failed. Without always()
, it won't run because any transitively dependent job failed.
Confirmed this with local testing. Running this workflow with act
, the third job does not run:
on: push
jobs:
firstJobFails:
runs-on: ubuntu-latest
steps:
- run: exit 1
secondJobAlways:
runs-on: ubuntu-latest
needs: firstJobFails
if: always()
steps:
- run: echo "Second job"
thirdJobTransitive:
runs-on: ubuntu-latest
needs: secondJobAlways
steps:
- run: echo "Third job"
But if you make the first job succeed, or add if: always()
on the third job, then all jobs run.
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. |
…ne-platform-fails [No QA] Fix checkDeploymentSuccess job in deploy workflow (cherry picked from commit ff5e1cf) (CP triggered by roryabraham)
🚀 Cherry-picked to staging by https://github.com/roryabraham in version: 9.0.38-3 🚀
|
🚀 Deployed to production by https://github.com/grgia in version: 9.0.38-4 🚀
|
Details
We were defining
IS_ALL_PLATFORMS_DEPLOYED
andIS_AT_LEAST_ONE_PLATFORM_DEPLOYED
as"true"
or"false"
strings. This causedfromJSON(needs.checkDeploymentSuccess.outputs.IS_ALL_PLATFORMS_DEPLOYED)
andfromJSON(needs.checkDeploymentSuccess.outputs.IS_AT_LEAST_ONE_PLATFORM_DEPLOYED)
to always evaluate astrue
, since any non-empty string is considered truthy. As a result, even if a platform failed, bothIS_AT_LEAST_ONE_PLATFORM_DEPLOYED
andIS_ALL_PLATFORMS_DEPLOYED
would betrue
.App/.github/workflows/deploy.yml
Lines 480 to 481 in 37bf6b2
App/.github/workflows/deploy.yml
Lines 592 to 595 in 37bf6b2
This PR ensures that both variables are properly set as booleans.
Additionally, this PR adds
always()
to thecreatePrerelease
andfinalizeRelease
jobs conditions, similar to what was done for other jobs. This guarantees that these conditions are always evaluated, ensuring the jobs are not skipped if any platform deploy job fails.Fixed Issues
$ #49430
PROPOSAL: N/A
Tests
N/A
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
N/A
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop