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

Enable picking between concrexit servers #459

Merged
merged 6 commits into from
Sep 6, 2023

Conversation

DeD1rk
Copy link
Member

@DeD1rk DeD1rk commented Sep 2, 2023

Closes #457.

Summary

This adds a button on the LoginScreen to pick an environment (production, staging or local) from options that depend on variables provided at build-time. That is, in development, only staging will be possible (and default). In CI builds, production will be added and defaulted to. And if you set --dart-define=LOCAL_THALIA_OAUTH_APP_ID=XXX --dart-define=LOCAL_THALIA_OAUTH_APP_SECRET=XXX, a local environment is also available (not picked by default), using http://127.0.0.1:8000.

I also got rid of a hack we used, removing the navigator around the LoginScreen.

TODO:

  • Handle it if closed ApiRepository is somehow still used.
  • Get the other urls from config dynamically.

How to test

Steps to test the changes you made:

  1. Make a production build
  2. Sign in to production
  3. Sign out
  4. Sign in to staging
  5. If you like, also try a build with local settings

@JAicewizard
Copy link
Contributor

Although I like the idea, I also think this will be a horrible experience if the API changes. Doing this adds a responsibility to concrexit to postpone API changes to last-minute, or at least together with a reaxit release. (Or have stricter API versioning, where any removal would constitute a new API version)

@DeD1rk
Copy link
Member Author

DeD1rk commented Sep 4, 2023

a horrible experience if the API changes

That's true, but also already true with a single hardcoded server. Normal users don't have the possibility to log in elsewhere anyway

@DeD1rk DeD1rk marked this pull request as ready for review September 5, 2023 17:53
@DeD1rk
Copy link
Member Author

DeD1rk commented Sep 5, 2023

Tried the iOS testflight on staging and production, worked like a charm

@JAicewizard
Copy link
Contributor

I will test this evening as well, looks good to test otherwise

@JAicewizard
Copy link
Contributor

I can open links in the app! that is very nice I will look into opening staging links in the release app as well

@JAicewizard
Copy link
Contributor

I tested with deeplinks, they still work on both staging and release. I opened an issue about a cool idea that you can easily switch accounts. Its probably a cool side-project, but has no usage besides us testing things without logging out and back in

@JAicewizard JAicewizard merged commit c75fe0c into master Sep 6, 2023
@JAicewizard JAicewizard deleted the select-staging-environment branch September 6, 2023 20:46
Scarletto pushed a commit that referenced this pull request Oct 25, 2023
commit 9dbbf7f
Author: Jaap Aarts <JAicewizard@users.noreply.github.com>
Date:   Tue Oct 10 20:38:43 2023 +0200

    Update deps (#467)

commit d6ef9db
Author: stefanvi <60365750+stefanvi@users.noreply.github.com>
Date:   Wed Sep 27 21:50:50 2023 +0200

    Add themeable adaptive icons for android (#466)

commit 1225a8b
Author: Jaap Aarts <JAicewizard@users.noreply.github.com>
Date:   Thu Sep 21 00:06:28 2023 +0200

    Add a class for collapsing menu actions (#433)

    Co-authored-by: Dirk Doesburg <dirk.doesburg@gmail.com>

commit c75fe0c
Author: Dirk Doesburg <dirk.doesburg@gmail.com>
Date:   Wed Sep 6 22:46:57 2023 +0200

    Enable picking between concrexit servers (#459)

commit 57778cf
Author: Jaap Aarts <JAicewizard@users.noreply.github.com>
Date:   Sat Sep 2 15:21:46 2023 +0200

    Fix calendar not adding a day for today if there are no later events (#453)

commit 4c72d76
Author: Dirk Doesburg <dirk.doesburg@gmail.com>
Date:   Fri Sep 1 18:55:27 2023 +0200

    Fix tests, oops

commit aa95ff0
Author: Dirk Doesburg <dirk.doesburg@gmail.com>
Date:   Fri Sep 1 18:16:42 2023 +0200

    Drop Photo hidden and set default for rotation

    Closes #437.

commit 37bcb1a
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Fri Sep 1 13:10:50 2023 +0200

    Bump activesupport from 6.1.7.3 to 6.1.7.6 (#456)

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit ef25aed
Author: Jaap Aarts <JAicewizard@users.noreply.github.com>
Date:   Wed Aug 23 16:20:15 2023 +0200

    Fix fab button style (#448)

    Co-authored-by: Dirk Doesburg <dirk.doesburg@gmail.com>

commit b81f215
Author: Jaap Aarts <JAicewizard@users.noreply.github.com>
Date:   Thu Aug 17 12:21:33 2023 +0200

    Bump flutter and dart + version (#446)

commit c8d6149
Author: Jaap Aarts <JAicewizard@users.noreply.github.com>
Date:   Wed Jul 5 21:21:24 2023 +0200

    Bump app version number (#449)

commit 9748e5c
Author: Dirk Doesburg <dirk.doesburg@gmail.com>
Date:   Wed Jun 21 19:59:17 2023 +0200

    Remove unused fields on FullProfile

commit ac16eae
Author: JeeVee11 <88948013+JeeVee11@users.noreply.github.com>
Date:   Sun Jun 18 16:31:07 2023 +0000

    Fix registration loading in event screen (#439)
Scarletto pushed a commit that referenced this pull request Oct 25, 2023
commit 9dbbf7f
Author: Jaap Aarts <JAicewizard@users.noreply.github.com>
Date:   Tue Oct 10 20:38:43 2023 +0200

    Update deps (#467)

commit d6ef9db
Author: stefanvi <60365750+stefanvi@users.noreply.github.com>
Date:   Wed Sep 27 21:50:50 2023 +0200

    Add themeable adaptive icons for android (#466)

commit 1225a8b
Author: Jaap Aarts <JAicewizard@users.noreply.github.com>
Date:   Thu Sep 21 00:06:28 2023 +0200

    Add a class for collapsing menu actions (#433)

    Co-authored-by: Dirk Doesburg <dirk.doesburg@gmail.com>

commit c75fe0c
Author: Dirk Doesburg <dirk.doesburg@gmail.com>
Date:   Wed Sep 6 22:46:57 2023 +0200

    Enable picking between concrexit servers (#459)

commit 57778cf
Author: Jaap Aarts <JAicewizard@users.noreply.github.com>
Date:   Sat Sep 2 15:21:46 2023 +0200

    Fix calendar not adding a day for today if there are no later events (#453)

commit 4c72d76
Author: Dirk Doesburg <dirk.doesburg@gmail.com>
Date:   Fri Sep 1 18:55:27 2023 +0200

    Fix tests, oops

commit aa95ff0
Author: Dirk Doesburg <dirk.doesburg@gmail.com>
Date:   Fri Sep 1 18:16:42 2023 +0200

    Drop Photo hidden and set default for rotation

    Closes #437.

commit 37bcb1a
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Fri Sep 1 13:10:50 2023 +0200

    Bump activesupport from 6.1.7.3 to 6.1.7.6 (#456)

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit ef25aed
Author: Jaap Aarts <JAicewizard@users.noreply.github.com>
Date:   Wed Aug 23 16:20:15 2023 +0200

    Fix fab button style (#448)

    Co-authored-by: Dirk Doesburg <dirk.doesburg@gmail.com>

commit b81f215
Author: Jaap Aarts <JAicewizard@users.noreply.github.com>
Date:   Thu Aug 17 12:21:33 2023 +0200

    Bump flutter and dart + version (#446)

commit c8d6149
Author: Jaap Aarts <JAicewizard@users.noreply.github.com>
Date:   Wed Jul 5 21:21:24 2023 +0200

    Bump app version number (#449)

commit 9748e5c
Author: Dirk Doesburg <dirk.doesburg@gmail.com>
Date:   Wed Jun 21 19:59:17 2023 +0200

    Remove unused fields on FullProfile

commit ac16eae
Author: JeeVee11 <88948013+JeeVee11@users.noreply.github.com>
Date:   Sun Jun 18 16:31:07 2023 +0000

    Fix registration loading in event screen (#439)
JAicewizard pushed a commit that referenced this pull request Nov 8, 2023
commit 9dbbf7f
Author: Jaap Aarts <JAicewizard@users.noreply.github.com>
Date:   Tue Oct 10 20:38:43 2023 +0200

    Update deps (#467)

commit d6ef9db
Author: stefanvi <60365750+stefanvi@users.noreply.github.com>
Date:   Wed Sep 27 21:50:50 2023 +0200

    Add themeable adaptive icons for android (#466)

commit 1225a8b
Author: Jaap Aarts <JAicewizard@users.noreply.github.com>
Date:   Thu Sep 21 00:06:28 2023 +0200

    Add a class for collapsing menu actions (#433)

    Co-authored-by: Dirk Doesburg <dirk.doesburg@gmail.com>

commit c75fe0c
Author: Dirk Doesburg <dirk.doesburg@gmail.com>
Date:   Wed Sep 6 22:46:57 2023 +0200

    Enable picking between concrexit servers (#459)

commit 57778cf
Author: Jaap Aarts <JAicewizard@users.noreply.github.com>
Date:   Sat Sep 2 15:21:46 2023 +0200

    Fix calendar not adding a day for today if there are no later events (#453)

commit 4c72d76
Author: Dirk Doesburg <dirk.doesburg@gmail.com>
Date:   Fri Sep 1 18:55:27 2023 +0200

    Fix tests, oops

commit aa95ff0
Author: Dirk Doesburg <dirk.doesburg@gmail.com>
Date:   Fri Sep 1 18:16:42 2023 +0200

    Drop Photo hidden and set default for rotation

    Closes #437.

commit 37bcb1a
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Fri Sep 1 13:10:50 2023 +0200

    Bump activesupport from 6.1.7.3 to 6.1.7.6 (#456)

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit ef25aed
Author: Jaap Aarts <JAicewizard@users.noreply.github.com>
Date:   Wed Aug 23 16:20:15 2023 +0200

    Fix fab button style (#448)

    Co-authored-by: Dirk Doesburg <dirk.doesburg@gmail.com>

commit b81f215
Author: Jaap Aarts <JAicewizard@users.noreply.github.com>
Date:   Thu Aug 17 12:21:33 2023 +0200

    Bump flutter and dart + version (#446)

commit c8d6149
Author: Jaap Aarts <JAicewizard@users.noreply.github.com>
Date:   Wed Jul 5 21:21:24 2023 +0200

    Bump app version number (#449)

commit 9748e5c
Author: Dirk Doesburg <dirk.doesburg@gmail.com>
Date:   Wed Jun 21 19:59:17 2023 +0200

    Remove unused fields on FullProfile

commit ac16eae
Author: JeeVee11 <88948013+JeeVee11@users.noreply.github.com>
Date:   Sun Jun 18 16:31:07 2023 +0000

    Fix registration loading in event screen (#439)
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.

Option to sign in to staging
2 participants