onnela-lab / beiwe-android

Beiwe is a smartphone-based digital phenotyping research platform. This is the Beiwe Android app code. The Beiwe2 app is also available on the Google Play store to use with open source builds of the Beiwe backend.
https://www.beiwe.org/
BSD 3-Clause "New" or "Revised" License
27 stars 16 forks source link

Systematize Android app version release #13

Closed zagorsky closed 6 years ago

zagorsky commented 7 years ago

We would like to simplify and standardize the process of releasing versions of the Beiwe Android app.

Limiting the possible app configurations

We would like to have only two build configurations of the app:

  1. Debug, which would point at the staging server (staging.beiwe.org), and would have the debug interface in the app

  2. Release, which would point at the production server (studies.beiwe.org), and would not have the debug interface in the app.

The advantages of this are that it would make communication clearer about which version of the app we're asked to compile, and it would make it easier for us to compile the app version (we could use a dropdown at compile time instead of editing several hard-coded variables).

The downside is that it wouldn't let people test all the possible configurations: you wouldn't have the app debug interface when testing the app on the production server anymore.

Why haven't we suggested this until now? Compiling was pretty straightforward (and this wasn't really worth the investment) before we added the production server: there were only two versions (debug interface and the production). But adding the staging server has created four possible ways of compiling the app, and that's made communication and compiling more complicated.

Production server would only have release app; staging server would only have debug app version

Along with the changes above, we would like the production server's App Download page (studies.beiwe.org/downloads) to only have release apps (pointing to the production server, and without the debug interface) available for download. We'd also like the staging server's App Download page (staging.beiwe.org/downloads) to only have debug apps (pointing to the staging server, and with the debug interface) available for download.

As part of this, we'd like the staging server's app download link staging.beiwe.org/download (which doesn't require a login) to download the most recent version of the debug app.

The App Download page (/downloads) on both servers would also clearly show which app version is then available for download (at the /download link). Hopefully this would reduce the opacity currently surrounding downloading app versions.

The motivation for this is to make it clearer which version of the app you're downloading, and to avoid confusion about apps downloaded from staging that are pointing at production. The downside of this is that anyone who doesn't have login access to staging.beiwe.org wouldn't be able to see the debug apps download page, although they would still be able to download the most recent debug app version from staging.beiwe.org/download without a login.

We would also like to add version numbers to the APK files as part of a standardized filename format like "beiwe_2.1.apk" or "beiwe_debug_2.1.2.apk". Hopefully we can figure out an automated way of doing this, but if that's too complicated, we can do it with a manual procedure.

Josh note to myself:

One idea for updating the changelog: keep a CHANGELOG.md file in the Android repo, and have the backend pull that single static file. This might be a way to do that: http://stackoverflow.com/a/22314262


We estimate that all the tasks in this GitHub issue will take us about 8 hours.

mariasimoneau commented 7 years ago

Hi Josh -- Thanks for writing this up. It did get confusing since this was our first time with the staging server.

So, effectively, there's no more debug version of the released app which I'm fine with.
And, the "debug" version is more importantly the "beta test" version with debug turned on. By "beta test" I mean it's a new build of the app that we're testing against the staging server. I personally thing beta is a clearer term for this version and it can be understood that the beta version always has debug turned on.

I have one request to add to this. I would like a 3rd version of the app that points to studies.beiwe.org that is our "release candidate". Eli came up with this "release candidate" term last June and I found it very helpful. I never like to release anything without giving it a sanity test. While you may see the release version simply as the debug version pointing at studies.beiwe.org instead of staging.beiwe.org and with the debug features turned off, we've seen that things get overlooked and/or broken in that simple process so I'd like to test it first. I liked having the release candidate on studies.beiwe.org as it resets our frame of mind from testing to production. However, I'm open to other suggestions such as emailing it.

Lastly, why is there development associated with this? This #13 github item says "We estimate that all the tasks in this GitHub issue will take us about 8 hours." aren't we just discussing how to test and release a new .apk version?

Sorry I'm so late getting back to you on this. It took me awhile to get dug out after vacation, etc., etc. Thanks! Maria

zagorsky commented 7 years ago

Hi @mariasimoneau, I'm asking for 8 hours of development time for this issue because I want to automate steps of the Android app-compiling and -deployment process.

Creating the staging and production APKs for version 2.1.4 (which only included one bugfix), posting them, and sending them to you took me over an hour. Every time we create and deploy a new Android app version, about 20 error-prone steps go into it, including editing certain lines of Android code, uploading files to S3 and tweaking their permissions, and deploying code changes to the frontends of the staging and production servers. I'm looking to automate a lot of those steps to reduce our time spent and make errors less likely.

zagorsky commented 7 years ago

@mariasimoneau says via email:

Hi Josh – let me run this by JP and get back to you. Would it add to the complexity/estimate to do a version of this for studies.beiwe.org and a separate for staging.beiwe.org? and then keep the .apks on their respective app download pages?

I don’t really like having the staging.beiwe.org .apk on the production system. I feel that will just lead to un-necessary questions, confusion and/or curiosity with collaborators and patients downloading the app. Thanks, Maria

@mariasimoneau, I think you make a very good point about confusion from downloading the staging APK from the production site. It wouldn't add to the estimate to have different apps available on the different sites; I already wanted to do something along those lines. To simplify the interface:

Do you think it would be OK to only have production apps available from the production site, and only staging apps available from the staging site?

mariasimoneau commented 7 years ago

Yes, I think this would be perfect to only have production apps available from the production site, and only staging apps available from the staging site. For instance, if we want to give the "beta?/release candidate?" 2.1.4 to someone to test against a production study, we have no way to get a version to them right now since the the version on studies.beiwe.org now points to the staging survey.

zagorsky commented 7 years ago

@mariasimoneau OK- sounds good! Let me know what JP says.

mariasimoneau commented 7 years ago

Hi Josh - -Yes, please go ahead with this!

zagorsky commented 7 years ago

OK! We'll start working on this.

zagorsky commented 6 years ago

Accomplished in these commits: