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 #9

Closed
wants to merge 1 commit into from

Conversation

ekohl
Copy link
Owner

@ekohl ekohl commented May 18, 2024

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.

@ekohl ekohl force-pushed the generate-pr-preview branch 6 times, most recently from 371f156 to 91166df Compare May 18, 2024 12:41
Copy link

github-actions bot commented May 18, 2024

The PR preview for 6b820be is available at ekohl-tutorial-preview-pr-9.surge.sh

No diff compared to the current website

@ekohl ekohl force-pushed the generate-pr-preview branch 3 times, most recently from 76ea944 to 86f4b10 Compare May 18, 2024 15:26
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
Copy link
Owner Author

ekohl commented May 18, 2024

This was for testing. Proper PR is in DjangoGirls#1835.

@ekohl ekohl closed this May 18, 2024
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.

1 participant