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

Add Codemagic App Previews (Android & iOS) for Pull Requests #257

Merged
merged 49 commits into from
Sep 28, 2022

Conversation

nilsreichardt
Copy link
Member

@nilsreichardt nilsreichardt commented Jun 5, 2022

Description

We are already using the Deploy to Firebase action to deploy our web to a temporary url, when opening a new pull request.

codemagic_app_preview does the same for iOS and Android. Just scan the QR with your phone, install the app and review the changes 👍

Currently, I'm not able to build a iOS and macOS with one Codemagic workflow. Therefore, we are not building the macOS app at the moment. When I fixed this, I will make a new PR for adding support for macOS 👍

Google Sign In & Dynamic Links are not working at the moment for the Android version, because the dev Firebase project does not contain the SHA1 & SHA256 values of the code signing key (see #289).

@github-actions
Copy link

github-actions bot commented Jun 5, 2022

Visit the preview URL for this PR (updated for commit e6bdb84):

https://sharezone-test--pr257-codemagic-app-previe-fbsx5wxw.web.app

(expires Wed, 05 Oct 2022 23:13:25 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

@nilsreichardt
Copy link
Member Author

nilsreichardt commented Aug 25, 2022

⬇️ Generated builds by Codemagic for commit e6bdb84 ⬇️

Note: Only Sharezone team members are able to install the iOS app.

iOS Android
image
Download link
image
Download link

@nilsreichardt nilsreichardt changed the title WIP: Playing around with Codemagic App Previews Add Codemagic App Previews for Pull Requests Sep 26, 2022
@nilsreichardt nilsreichardt changed the title Add Codemagic App Previews for Pull Requests Add Codemagic App Previews (Android & iOS) for Pull Requests Sep 26, 2022
@nilsreichardt nilsreichardt marked this pull request as ready for review September 26, 2022 09:27
@Jonas-Sander
Copy link
Collaborator

Hey, this is just a quick thought written down, not a review yet.

Since the codemagic.yaml code uses some secretes for signing that are very important - might there be some way for an external "attacker" to read them by forking our repository and proposing a PR with changes inside codemagic.yaml which will send the secrets to the attacker?

So under which conditions does the codemagic.yaml get executed? If an external user were to propose changes do we need to manually approve running the codemagic.yaml? (couldn't the user still do the same pwning-changes after manual approval?)

I read this article today which talks about something similar: https://securitylab.github.com/research/github-actions-preventing-pwn-requests/

codemagic.yaml Outdated
- certificate_credentials
vars:
BUNDLE_ID: de.codingbrain.sharezone.app
flutter: v2.10.5
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can this somehow be read from the fvm config or pubspec,yaml, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Technically, this should be possible, but it would take an overhead of ~1-2 minutes.

What Codemagic does:

  1. Download specified Flutter version
  2. Clone the repository

Therefore, we would need to this:

  1. Codemagic downloads the specified (or the default one) Flutter version
  2. Codemagic clones the repository
  3. We read out the Flutter version specified in the fvm_config.json
  4. Download the Flutter version
  5. Update the environment variables

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hm that kinda sucks. Do we have a document "update the flutter version" or sth where we can for now at least have the places written down where we would need to update the version string?

Copy link
Member Author

Choose a reason for hiding this comment

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

Using FVM seems to be a good option 👍 The overhead is roundabout 1 min

codemagic.yaml Show resolved Hide resolved
@nilsreichardt
Copy link
Member Author

Good point about the security. I tried out to print a secret and it was easily possible. I asked the Codemagic support what you can to do to protect your secrets.

@github-actions github-actions bot added the ci/cd label Sep 28, 2022
@nilsreichardt nilsreichardt marked this pull request as ready for review September 28, 2022 21:10
@nilsreichardt
Copy link
Member Author

@Jonas-Sander I added a few things. Can you re-review? You can simply use the feature "show changes since last review"

Copy link
Collaborator

@Jonas-Sander Jonas-Sander left a comment

Choose a reason for hiding this comment

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

LGTM 🙌

codemagic.yaml Outdated Show resolved Hide resolved
nilsreichardt and others added 2 commits September 29, 2022 00:25
Co-authored-by: Jonas Sander <29028262+Jonas-Sander@users.noreply.github.com>
@nilsreichardt nilsreichardt enabled auto-merge (squash) September 28, 2022 23:09
@nilsreichardt nilsreichardt merged commit a08d1e2 into main Sep 28, 2022
@nilsreichardt nilsreichardt deleted the codemagic-app-preview branch September 28, 2022 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants