-
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
[HOLD for payment 2022-12-20] [$500] Allow native app releases to take staging env variables into consideration #11561
Comments
Triggered auto assignment to @Christinadobrzyn ( |
I realized we have this Staging badge or dev badge even in the native apps so we must have some way to figure that out and the withEnvironment HOC I am not sure if we can use those in the API toggle but would be worth exploring. |
Triggered auto assignment to @MitchExpensify ( |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @parasharrajat ( |
Triggered auto assignment to @flodnv ( |
No proposals yet |
It looks difficult to me to imagine something while we continue to release the andorid/ios app by relabeling the staging release.
https://github.com/invertase/react-native-firebase/tree/main/packages/remote-config I can try the same. Request you comment @mountiny @parasharrajat |
@smrutiparida We already do that. Please check the code and let us know if you feel something is off. |
@mountiny I think the issue details are not very clear. I don't understand the expected behavior. Can you please improve these? |
My second solution above can help the android code read a version no from a firebase remote config. Based on the version stored in remote, the API_URL can be configured dynamically within in the code. By doing so, the android build can be tested against staging URL for all versions higher than the remote version. It can also be released to PROD by only changing the label. @mountiny is that the expected thing ? |
@parasharrajat @smrutiparida I have added some lines to the issue body. The problem is that the native apps disregard the API endpoint settings, they always send requests to the production API even if the staging API toggle in settings in turned on. I am unfortunately not that familiar with firebase remote config so I am not sure. Is there any way we could use this approach: #11561 (comment) to achieve this natively? |
Thanks for adding that details. It is a lot more clear to me now. Between staging and prod APIs, the only difference is the API URL. IMO, this should be easier to do. Just change the Url based on the setting irrespective of the ENV. |
@mountiny What I have understood so far is, we rename the label of a staging build to release to PROD. This is the reason API_URL present in the ENV values are as PROD_URL as there are no way presently for an iOS/Android android build to read the env values dynamically based on dev/taging/prod post the creation of a build. @parasharrajat Which setting you mean ? |
This is not done yet, original PR has been reverted and the fix is being worked on. |
The PR has been updated and is ready for a review. |
I will take a look. |
@mountiny we're just waiting on a deploy here, right? |
Yeah, PR is merged. |
Yeah this is in staging and I have QAed and it worked at least from what I saw 🎉 |
Noice! ❤️ |
Reassigning the Bug label as I'm heading ooo and this will need a new CM! |
Triggered auto assignment to @kadiealexander ( |
@kadiealexander Coming from this comment we should have a payment off:
|
Thanks @mountiny!!!! Is payment due now? |
I would say yes, this has been PR which was kind of untraditional in terms of the process. The internal PR should already be in production. |
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.2.38-6 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2022-12-20. 🎊 After the hold period, please check if any of the following need payment for this issue, and if so check them off after paying:
As a reminder, here are the bonuses/penalties that should be applied for any External issue:
|
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
|
Thanks @mountiny! New job post is here, I've already sent hire contracts to @parasharrajat and @smrutiparida, please let me know once you've accepted and I'll issue payment. ETA: @mountiny correct me if I'm wrong, but the problem behind this issue doesn't look like it can be added to TestFlight for regression testing? Just confirming before I take action on the checklist above. |
Yeah I dont think think Applause could test the native apps which is the main issue here |
Per the checklist, commented on this PR, it was not really a regression as much as not fully working new feature. We had to internally test for native apps but we did not do that at the time and we only tested web as that was easier. It worked there and assumed ti will work across the platforms I dont think this requires any updates to the checklist. |
Awesome! Everyone is paid, so I'm closing this one out. |
Problem
In this issue #10163, we have implemented a setting toggle which will aim all the API commands to staging or production API (if in Staging App). However, this works only in desktop or web, but not in native mobile apps as the live logs shown.
The reason it does not work is that we always build the App only once for deploy. We just relabel staging release for the production one and so when building the staging App we use the production env variables causing this issue
Actual behaviour
Expected behaviour
Why is it important
This will allow us to test staging changes with staging API at the same time.
Solution
Find a way how we can use the environment variables in native app so we can distinguish between staging and production to send the API requests to desired API endpoints.
The text was updated successfully, but these errors were encountered: