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

Implement previews for GitHub pull requests #1835

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on May 18, 2024

  1. Implement previews for GitHub pull requests

    When a contributor submits a PR, we always perform a build. This takes
    it a step further and uploads that a custom surge.sh domain. It adds a
    sticky comment to link to that preview while also generating some diffs.
    This means reviews easier.
    
    In the implementation an additional preview step is added. This first
    builds the base (target of the PR) as the current. Then it downloads the
    generated preview that was added as an artifact in the original build
    step. Creating a reasonably sized diff was tricky, because there's a
    long Javascript line that includes the mtime, making it indeterministic.
    That line isn't relevant anyway, so it's removed. The diff command also
    ignores the search index.
    
    All of that is placed in the preview, making it readable. A sticky
    comment is added with a summary, making it easy to use. The sticky
    comment is updated for every push, rather than added a comment for every
    push. This keeps the PR conversation usable.
    ekohl committed May 18, 2024
    Configuration menu
    Copy the full SHA
    6b820be View commit details
    Browse the repository at this point in the history