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

Query GitHub API instead of Google Play Store to determine beta #13698

Merged
merged 1 commit into from
Dec 19, 2022

Conversation

AndrewGable
Copy link
Contributor

@AndrewGable AndrewGable commented Dec 19, 2022

Details

On Android we were relying on scraping the Google Play Store to determine whether we were on a Beta version or not. This led to issues as seen in the linked issue, in addition we don't have any guarantee this data will come in the format we expect in the future. This changes to query GitHub's API using a format we can rely on (JSON) to get the latest release.

Fixed Issues

$ #11132
https://expensify.slack.com/archives/C01GTK53T8Q/p1671463601976569

Tests

Android only tests

  1. Download the latest beta from Google Play Store
  2. Verify you see the staging badge on the login page
  3. Download the latest production version from Google Play Store
  4. Verify you see no badge on the login page (No staging or dev)

Offline tests

N/A

QA Steps

Android only tests

  1. Download the latest beta from Google Play Store
  2. Verify you see the staging badge on the login page
  3. Download the latest production version from Google Play Store
  4. Verify you see no badge on the login page (No staging or dev)

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android / native
    • Android / Chrome
    • iOS / native
    • iOS / Safari
    • MacOS / Chrome / Safari
    • MacOS / Desktop
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is correct English and approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • I have checked off every checkbox in the PR author checklist, including those that don't apply to this PR.

Screenshots/Videos

Web Screenshot 2022-12-19 at 12 24 25 PM
Mobile Web - Chrome Screenshot 2022-12-19 at 12 27 16 PM
Mobile Web - Safari Screenshot 2022-12-19 at 12 31 31 PM
Desktop Screenshot 2022-12-19 at 12 24 25 PM
iOS Screenshot 2022-12-19 at 12 31 07 PM
Android Screenshot 2022-12-19 at 12 20 37 PM Screenshot 2022-12-19 at 12 23 46 PM

@AndrewGable AndrewGable marked this pull request as ready for review December 19, 2022 19:35
@AndrewGable AndrewGable requested a review from a team as a code owner December 19, 2022 19:35
@AndrewGable AndrewGable self-assigned this Dec 19, 2022
@melvin-bot melvin-bot bot requested review from stitesExpensify and thesahindia and removed request for a team December 19, 2022 19:35
@melvin-bot
Copy link

melvin-bot bot commented Dec 19, 2022

@thesahindia @stitesExpensify One of you needs to 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]

Copy link
Contributor

@mountiny mountiny left a comment

Choose a reason for hiding this comment

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

@mountiny
Copy link
Contributor

mountiny commented Dec 19, 2022

Reviewer Checklist

Checking this off, this is related to how we get release numbers so we cannot test this well locally.

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified tests pass on all platforms & I tested again on:
    • Android / native
    • Android / Chrome
    • iOS / native
    • iOS / Safari
    • MacOS / Chrome / Safari
    • MacOS / Desktop
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is correct English and approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Web
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android

Copy link
Contributor

@stitesExpensify stitesExpensify left a comment

Choose a reason for hiding this comment

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

Code LGTM. Why did we have to update that package though? Just want to make sure it wasn't a mistake 😄

@mountiny mountiny added InternalQA This pull request required internal QA and removed InternalQA This pull request required internal QA labels Dec 19, 2022
@mountiny mountiny requested review from stitesExpensify and removed request for thesahindia December 19, 2022 19:45
@mountiny
Copy link
Contributor

@thesahindia Sorry for the ping, no need to QA here

@AndrewGable
Copy link
Contributor Author

I moved the semver package from the devDependencies to dependencies since we now use it in the source. I can undo the update, but it seemed harmless since it was already using 7.3.7.

Copy link
Contributor

@srikarparsi srikarparsi left a comment

Choose a reason for hiding this comment

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

lgtm!

@srikarparsi srikarparsi merged commit 26db207 into main Dec 19, 2022
@srikarparsi srikarparsi deleted the andrew-play-store-beta branch December 19, 2022 20:00
@OSBotify
Copy link
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@github-actions
Copy link
Contributor

Performance Comparison Report 📊

Significant Changes To Duration

There are no entries

Meaningless Changes To Duration

Show entries
Name Duration
TTI 824.953 ms → 850.903 ms (+25.950 ms, +3.1%)
runJsBundle 196.250 ms → 209.156 ms (+12.906 ms, +6.6%)
nativeLaunch 9.467 ms → 9.903 ms (+0.437 ms, +4.6%)
regularAppStart 0.017 ms → 0.015 ms (-0.002 ms, -11.7%)
Show details
Name Duration
TTI Baseline
Mean: 824.953 ms
Stdev: 30.957 ms (3.8%)
Runs: 758.7224039998837 774.661618999904 779.6424559999723 792.6184449999128 797.8351660000626 798.3247670000419 798.7774960000534 803.759727000026 803.9677410000004 806.7726769999135 811.479427000042 812.889116999926 813.6634879999328 816.3827819998842 816.8986039999872 820.4868570000399 829.5175669998862 830.0026100000832 832.5879559998866 833.2934030001052 844.8526930001099 850.2985920000356 853.3022930000443 857.6316470000893 857.9659649999812 859.4887329998892 868.5722779999487 870.2718040000182 872.5104100001045 881.415548000019

Current
Mean: 850.903 ms
Stdev: 36.114 ms (4.2%)
Runs: 791.6529290000908 797.9455150000285 801.5884449998848 808.3477280000225 812.9363080000039 816.230835000053 819.4594370000996 823.4332999999169 825.8768649999984 827.4038859999273 827.9565900000744 829.9534110000823 838.0891789998859 839.9684619999025 844.3770979999099 844.3931579999626 845.5176629999187 854.8748860000633 857.6895840000361 860.3454919999931 862.6914900001138 870.3008870000485 872.2691440000199 881.7596380000468 884.2982640000992 884.509742999915 888.1187209999189 913.6383579999674 914.3502330000047 918.1994610000402 919.8270159999374
runJsBundle Baseline
Mean: 196.250 ms
Stdev: 20.497 ms (10.4%)
Runs: 163 164 171 171 175 178 180 181 183 184 184 186 187 187 189 189 194 195 199 201 203 204 204 205 210 211 222 226 228 229 238 239

Current
Mean: 209.156 ms
Stdev: 29.560 ms (14.1%)
Runs: 168 170 171 172 178 178 184 185 185 189 190 192 192 194 202 205 209 211 212 214 215 218 223 227 227 237 246 247 251 259 265 277
nativeLaunch Baseline
Mean: 9.467 ms
Stdev: 1.500 ms (15.8%)
Runs: 7 8 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 10 10 10 10 10 10 11 11 11 12 12 12 13

Current
Mean: 9.903 ms
Stdev: 1.510 ms (15.3%)
Runs: 7 8 8 8 8 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 11 11 11 11 11 11 12 13 13 13
regularAppStart Baseline
Mean: 0.017 ms
Stdev: 0.001 ms (8.5%)
Runs: 0.015217999927699566 0.015339999925345182 0.015544000081717968 0.01566500007174909 0.015746999997645617 0.015868999995291233 0.015909999841824174 0.015910000074654818 0.01595000014640391 0.01599099999293685 0.01603199983946979 0.016072999918833375 0.01607300015166402 0.01615400006994605 0.01619499991647899 0.01631700014695525 0.016398000065237284 0.016478999983519316 0.01656099990941584 0.016641999827697873 0.016804999904707074 0.01692699990235269 0.01737500005401671 0.01778100011870265 0.018066999968141317 0.01835199980996549 0.018758000107482076 0.01887999987229705 0.01912399986758828 0.019450000021606684 0.020183000015094876 0.0206709997728467

Current
Mean: 0.015 ms
Stdev: 0.001 ms (5.1%)
Runs: 0.013467999873682857 0.013467999873682857 0.01395700010471046 0.014160000020638108 0.01432300009764731 0.01432300009764731 0.01436399994418025 0.014404000015929341 0.014444999862462282 0.01448600017465651 0.014527000021189451 0.014648999786004424 0.014851999934762716 0.014851999934762716 0.015014000004157424 0.015055999858304858 0.015137000009417534 0.015177000081166625 0.015217999927699566 0.015217999927699566 0.01525900000706315 0.01525900000706315 0.015422000084072351 0.015503000002354383 0.015544000081717968 0.015828999923542142 0.01615400006994605 0.01619499991647899 0.016316999914124608 0.0165200000628829

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by @srikarparsi in version: 1.2.42-0 🚀

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

@yuwenmemon
Copy link
Contributor

Hmmm... @chiragsalian @mountiny @stitesExpensify @srikarparsi @AndrewGable Would steps 3 and 4 here be Production QA?

@AndrewGable
Copy link
Contributor Author

Yes, agree we will need to wait for this code to be on production to test 3 & 4.

@yuwenmemon
Copy link
Contributor

Great - @chiragsalian @mountiny @stitesExpensify @srikarparsi @AndrewGable - please remember to do that when this PR hits production 🙇‍♂️

Gonna check this off the QA checklist ✅

@OSBotify
Copy link
Contributor

🚀 Deployed to production by @yuwenmemon in version: 1.2.42-2 🚀

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

@mountiny
Copy link
Contributor

mountiny commented Dec 29, 2022

@AndrewGable Have you been able to test this one in Production, as mentioned above?

@AndrewGable
Copy link
Contributor Author

Yes, it works 🎉

Staging is 1.2.46-0
Production is 1.2.45-0
Older production is 1.2.44-0

1.2.46-0 1.2.45-0 1.2.44-0
Screenshot 2022-12-30 at 9 51 34 AM Screenshot 2022-12-30 at 9 50 27 AM Screenshot 2022-12-30 at 9 52 38 AM

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.

7 participants