Repository navigation
[No QA] Fix checkDeploymentSuccess job in deploy workflow - #49432
roryabraham merged 2 commits into
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 |
mountiny
left a comment
There was a problem hiding this comment.
@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!
| 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.
Why do you add the always here?
There was a problem hiding this comment.
The always() was added to ensure the condition is evaluated even if some platform deployments fail. Without it, these jobs could be skipped
| 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.
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.
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! |
roryabraham
left a comment
There was a problem hiding this comment.
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_DEPLOYEDandIS_AT_LEAST_ONE_PLATFORM_DEPLOYEDas"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_DEPLOYEDandIS_ALL_PLATFORMS_DEPLOYEDwould 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 thecreatePrereleaseandfinalizeReleasejobs 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 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
N/A
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop