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

Fix secrets not properly applied in CI build apk #161

Closed
charliemangano opened this issue Nov 9, 2024 · 3 comments · Fixed by #171
Closed

Fix secrets not properly applied in CI build apk #161

charliemangano opened this issue Nov 9, 2024 · 3 comments · Fixed by #171
Assignees
Labels
bug Something isn't working

Comments

@charliemangano
Copy link
Contributor

charliemangano commented Nov 9, 2024

Description:

At the moment, the authentication screens fail when trying to log in or sign up on the build apk. The goal of this task is to look into what's causing this problem and fix it. This bug seems to be entirely unrelated to the syncing problem we noticed during Sprint 4.

Steps to reproduce:

  • push your branch (main in this case) to a build/* branch. This will run the CI that builds our apk.
  • download the apk and install on your device (take care to uninstall any previous versions of the app if you already have it install, and to clean the caches)
  • launch the app and (correctly) fill the fields on either the SignIn or SignUp screen
  • click on submit button ("Sign In" or "Sign Up")

Expected (buggy) behaviour:
A toast should appear explaining that the authentication failed, and you will not navigate to the next screen (create profile or profile).

Done:

  • authentication must be possible thought the build apk, with leniency for the syncing bug
  • code quality should be conform to our standards and consistent with the rest of the app
  • testing: user tests (download the apk on multiple devices and test that it works)
@charliemangano charliemangano self-assigned this Nov 9, 2024
@charliemangano charliemangano changed the title Fix apk auth not working Fix authentication not working with build apk Nov 9, 2024
@charliemangano charliemangano added the bug Something isn't working label Nov 9, 2024
@charliemangano
Copy link
Contributor Author

The logcat show this trace (abridged):

Supabase-Core E : POST request to endpoint /auth/v1/signup failed with exception Unable to resolve host "null": No address associated with hostname
AuthenticationModelSupabase D : register: failed to register the user: HTTP request to https://null/auth/v1/signup (POST) failed with message: Unable to resolve host "null": No address associated with hostname
AuthenticationViewModel D : signUpWithEmail: failed to register user: io.github.jan.supabase.exceptions.HttpRequestException: HTTP request to https://null/auth/v1/signup (POST) failed with message: Unable to resolve host "null": No address associated with hostname

It seems to be a problem with either network connection or Supabase URL not being fetched correctly from BuildConfig

@charliemangano
Copy link
Contributor Author

charliemangano commented Nov 10, 2024

The network connection is alright, I fixed it right after M1. The problem comes form the CI not having access to the necessary API keys and client URLs. Those are stored in local.properties and then piped to BuildConfig during the build.

However, local.properties is a file that should never be pushed to VCS, and therefore is not accessible by the CI pipeline during its build. They are therefore not piped to BuildConfig when the CI builds, but are when building on local, which makes the problem really annoying to detect and to fix :(

Yesterday and today, I've tried adding a plugin to manage secrets but I can't seem to be able to make it work properly.

@charliemangano charliemangano added the help wanted Extra attention is needed label Nov 10, 2024
@charliemangano charliemangano changed the title Fix authentication not working with build apk Fix secrets not properly applied in CI build apk Nov 11, 2024
@charliemangano charliemangano removed the help wanted Extra attention is needed label Nov 11, 2024
@francelu
Copy link
Contributor

Good job find a way to solve this issue !
It's good you commented here your researches and findings :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants