Skip to content
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

Properly JSON-decode outputs #4927

Merged
merged 1 commit into from
Aug 30, 2021
Merged

Properly JSON-decode outputs #4927

merged 1 commit into from
Aug 30, 2021

Conversation

roryabraham
Copy link
Contributor

Details

After a fair deal of discussion and experimentation in Public-Test-Repo, I learned that, even after this PR, not all json values were being properly decoded.

Going forward, I think we should establish the explicit use of fromJSON as a best-practice over doing string comparisons as we have in the past. Using fromJSON is a more explicit way of handling this data, and using it demonstrates a better understanding of the problem, and might be easier to remember to look for when writing GH Workflows and reviewing PRs.

Going forward, we should all recognize that any output in a GitHub workflow is a JSON string, and must be treated as such.

Fixed Issues

$ n/a

Tests

Same as #4796

QA Steps

None.

@roryabraham roryabraham self-assigned this Aug 30, 2021
@roryabraham roryabraham requested a review from a team as a code owner August 30, 2021 21:15
@MelvinBot MelvinBot requested review from stitesExpensify and removed request for a team August 30, 2021 21:16
@roryabraham
Copy link
Contributor Author

Because this is part of the effort to resolve a deploy fire, I did not spend any time refactoring existing workflows to follow the new best-practice of relying on fromJSON instead of string comparisons.

@github-actions
Copy link
Contributor

⚠️ ⚠️ Heads up! This pull request has the CP Staging label. ⚠️ ⚠️
Merging it will cause it to be immediately deployed to staging, even if the open StagingDeployCash deploy checklist is locked.

Copy link
Contributor

@Jag96 Jag96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going forward, we should all recognize that any output in a GitHub workflow is a JSON string, and must be treated as such.

I think we should also create a PR (or follow-up issue) to update incorrect usages in other workflows once deploys are fixed, just so we don't have inconsistent usages.

Other than that, I agree with having more strict checks for these and making that the standard.

@roryabraham
Copy link
Contributor Author

roryabraham commented Aug 30, 2021

Yep, I agree we should handle that refactoring in a follow-up. Follow-up issue created for myself here.

@roryabraham
Copy link
Contributor Author

Going to go ahead and merge to speed up the feedback loop and hopefully fix deploys.

@roryabraham roryabraham merged commit 486bdf4 into main Aug 30, 2021
@roryabraham roryabraham deleted the Rory-FixDeployConditionals branch August 30, 2021 22:05
Copy link
Contributor

@AndrewGable AndrewGable left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! 👍

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by @roryabraham in version: 1.0.89-0 🚀

platform result
🤖 android 🤖 skipped 🚫
🖥 desktop 🖥 skipped 🚫
🍎 iOS 🍎 skipped 🚫
🕸 web 🕸 skipped 🚫

@OSBotify
Copy link
Contributor

OSBotify commented Sep 1, 2021

🚀 Deployed to production by @roryabraham in version: 1.0.90-2 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 failure ❌
🕸 web 🕸 success ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants