Skip to content

Add README section about Compose preview comment#647

Open
takahirom wants to merge 3 commits intomainfrom
add-readme-compose-preview-comment
Open

Add README section about Compose preview comment#647
takahirom wants to merge 3 commits intomainfrom
add-readme-compose-preview-comment

Conversation

@takahirom
Copy link
Member

Issue

  • close #ISSUE_NUMBER

Overview (Required)

  • Add Jetpack Compose preview in GitHub comments section to README 📸

Links

Screenshot

Before After

@takahirom
Copy link
Member Author

@eneim @sobaya-0141 Could you look over this PR?

@github-actions github-actions bot temporarily deployed to deploygate-distribution September 21, 2022 11:48 Inactive
Co-authored-by: Nam Nguyen <1776230+eneim@users.noreply.github.com>
Comment on lines +281 to +286
For the DroidKaigi app, we have addressed several issues in addition to the existing Paparazzi + Showkase approach.

* Committing Preview images to the GitHub repository increases the GitHub repository size.
* When uploading preview images to the cloud, the images may not be viewable depending on their permissions.

In the DroidKaigi app, you can use GitHub Actions to save a golden snapshot of the main branch using GitHub Actions Artifacts, create a companion branch for the pull request, upload the preview image there, and commit the image to GitHub. Comment the URL of the image.
Copy link
Contributor

@eneim eneim Sep 21, 2022

Choose a reason for hiding this comment

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

If I understand correctly, you want to mention what we have tried to adding the images to the PR comments? If so, how about the following change:


There are different options we have considered to add the delta images to the pull-request comments, but each of them has some challenges:

  • Committing images to the main branch: this option increases the GitHub repository size unnecessarily. Once we resolve the preview issue, the delta images are no longer needed. // Review note: my understanding is that you want to explain why we don't want to store the delta screenshots in the repository permanently. So it should be about the main branch. But this is just my guess, please feel free to express your intent about this part.
  • Uploading images to the cloud: the snapshot may contains sensitive information that we should not upload them elsewhere. And also, the cost to maintain an additional image storage is not trivial. // Reviewer note: I think the images may not be viewable depending on their permissions is not a strong reason, because most of the cloud allows granular access control. But again, this change is just my guess from your texts, so feel free to change it your way.

In the DroidKaigi app, we use GitHub Actions to handle this effectively:

  • The golden snapshots are stored on the main branch using GitHub Actions Artifacts.
  • For the pull-request, we use GitHub Actions to create a companion branch and upload the delta images there. The image URLs are used to comment on the pull-request's branch.
  • Once the preview issues are resolved, we can delete the companion branch. (Currently this step is not automated).

Just a comment from my understanding, it may not reflect what you have in mind correctly, so feel free to discard it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Let me take a look at this 👀

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.

2 participants