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

Use Firebase Hosting Preview Channels to deploy a web app for every pull request. #119

Merged
merged 10 commits into from
Feb 7, 2022

Conversation

nilsreichardt
Copy link
Member

@nilsreichardt nilsreichardt commented Feb 4, 2022

We are building for every PR a web preview, which will be deployed to Firebase Hosting. The link to the website will posted as comment (like: #119 (comment)).

The previews are helping reviewer and other users to quickly view the changes in a compiled version.

A link to a preview expires after 30 days.


Closes #8

@github-actions
Copy link

github-actions bot commented Feb 4, 2022

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

https://sharezone-test--pr119-web-preview-channels-q1asu2sl.web.app

(expires Mon, 14 Feb 2022 11:33:59 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

@nilsreichardt
Copy link
Member Author

@Jonas-Sander Web previews are not working 👍 You can review now. They are using the sharezone-debug Firebase project. Could this be a problem, when users are trying to log in into their account, but the credentials are not valid for sharezone-debug?

@Jonas-Sander
Copy link
Collaborator

I think we should also add a warning in the future that its a temporary web app and that no personal data should be entered - like #27

@Jonas-Sander
Copy link
Collaborator

Maybe we should also add this to our cli tool sz deploy web-app --stage preview in the future.
We don't have to do it in this PR, we can run with this for now.

@Jonas-Sander
Copy link
Collaborator

Isn't a web app redeployed everytime a change is made? I think we should then choose at the very maximum 3 days.

Or is it 30 days from first deploy? Anyways I would lower it anyways.

@nilsreichardt
Copy link
Member Author

Isn't a web app redeployed everytime a change is made? I think we should then choose at the very maximum 3 days.

Or is it 30 days from first deploy? Anyways I would lower it anyways.

The default is 7 days. Should we pick this or even lower, like 3 days?

@nilsreichardt
Copy link
Member Author

I think we should also add a warning in the future that its a temporary web app and that no personal data should be entered - like #27

Should we do this in this PR?

@Jonas-Sander
Copy link
Collaborator

Isn't a web app redeployed everytime a change is made? I think we should then choose at the very maximum 3 days.

Or is it 30 days from first deploy? Anyways I would lower it anyways.

The default is 7 days. Should we pick this or even lower, like 3 days?

I mean there are two cases:

  • the web app expires x days after the most recent deploy (so a new commit "refreshes" the expiry date)
  • the web app expires x days after the first commit (so new commits don't "refresh" the expiry date)

In the first case I would say three days in the second one maybe seven (could be even more). We could also say in the latter case that we don't deploy for draft PRs so we don't start deploying a web app when it's not necessary so we don't already start the expiry date counter.

I hope I didn't make it too complicated :D

@Jonas-Sander
Copy link
Collaborator

Right now it says

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

https://sharezone-test--pr119-web-preview-channels-q1asu2sl.web.app

(expires Sun, 06 Mar 2022 15:58:37 GMT)

06.03.2022 - what happens to the date if you push a new commit?

@Jonas-Sander
Copy link
Collaborator

I think we should also add a warning in the future that its a temporary web app and that no personal data should be entered - like #27

Should we do this in this PR?

No, in another one I'd say.

@nilsreichardt
Copy link
Member Author

I mean there are two cases:

  • the web app expires x days after the most recent deploy (so a new commit "refreshes" the expiry date)
  • the web app expires x days after the first commit (so new commits don't "refresh" the expiry date)

In the first case I would say three days in the second one maybe seven (could be even more). We could also say in the latter case that we don't deploy for draft PRs so we don't start deploying a web app when it's not necessary so we don't already start the expiry date counter.

I hope I didn't make it too complicated :D

It expires x days after the last commit. I would not pick three days, because this would also require that we review the pull request in these three days, otherwise we are not able to use the preview. Because of this, I would pick 7 days, which gives us a bit more freedom.

@Jonas-Sander
Copy link
Collaborator

It expires x days after the last commit. I would not pick three days, because this would also require that we review the pull request in these three days, otherwise we are not able to use the preview. Because of this, I would pick 7 days, which gives us a bit more freedom.

Yeah, true, let's do 7:)

.github/workflows/main.yml Outdated Show resolved Hide resolved
.github/workflows/main.yml Outdated Show resolved Hide resolved
@nilsreichardt
Copy link
Member Author

@Jonas-Sander Changed it 7d 👍 You can now review again.

@Jonas-Sander
Copy link
Collaborator

I think we can just run flutter pub get inside /app and not run sz pub get (which is probably slower)

Can you fix this?

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.

See comment above

.github/workflows/main.yml Outdated Show resolved Hide resolved
.github/workflows/main.yml Outdated Show resolved Hide resolved
@Jonas-Sander
Copy link
Collaborator

LGTM

@nilsreichardt nilsreichardt merged commit 4740e48 into main Feb 7, 2022
@nilsreichardt nilsreichardt deleted the web-preview-channels branch February 7, 2022 13:59
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.

Deploy on every PR a new Firebase Hosting App (Preview Channels)
2 participants