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

Auto-post a Playground preview link on every PR #60795

Open
adamziel opened this issue Apr 16, 2024 · 7 comments · May be fixed by #64947
Open

Auto-post a Playground preview link on every PR #60795

adamziel opened this issue Apr 16, 2024 · 7 comments · May be fixed by #64947
Labels
Developer Experience Ideas about improving block and theme developer experience [Type] Enhancement A suggestion for improvement.

Comments

@adamziel
Copy link
Contributor

adamziel commented Apr 16, 2024

Similarly to wordpress-develop, the Gutenberg repo could have a preview link automatically posted at every PR.

See: How to add Pull Request previews to your repository?

Here's a GitHub action from another repo for inspiration:

https://github.com/adamziel/blueprints/blob/778ba6fad9e07cec6fa3d0803cbf589bdd5ea8b1/.github/workflows/preview-comment.yml

The Gutenberg PR previewer lives at https://playground.wordpress.net/gutenberg.html

Also, @dmsnell had this great idea:

💡 if a Gutenberg PR contains Depends on WordPress/wordpress-develop#5379 then the Playground comment includes a link drawing in both the Gutenberg and Core PRs

Implementing Dennis's idea would also require adjusting gutenberg.html

CC @ockham @jsnajdr @ellatrix – anyone interested in adding this integration?

@adamziel adamziel added [Type] Enhancement A suggestion for improvement. Developer Experience Ideas about improving block and theme developer experience labels Apr 16, 2024
@adamziel adamziel changed the title Auto-post a preview link on every PR Auto-post a Playground preview link on every PR Apr 16, 2024
@talldan
Copy link
Contributor

talldan commented Apr 17, 2024

I think this duplicates #60433.

I love the idea, but at the same time there are a lot of bot comments on PRs right now which creates a lot of notification noise, and it'd be great if they could be consolidated. Perhaps some of these workflows can be combined into a single comment where only portions of the comment are updated.

@adamziel
Copy link
Contributor Author

Aha! Or it could update the PR description and add the button/link at the bottom to save some vertical space :)

@talldan
Copy link
Contributor

talldan commented Apr 18, 2024

I was thinking that you may not even need a bot if there were a way to include the PR number as a templated part of the pull request template -
https://github.com/WordPress/gutenberg/blob/trunk/.github/PULL_REQUEST_TEMPLATE.md.

(granted that the PR may not always be ready to preview, but maybe that would be an acceptable trade-off)

Unfortunately I don't think it's possible having had a quick look through the docs - https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/about-issue-and-pull-request-templates.

@adamziel
Copy link
Contributor Author

Ooh that would have saved so much effort, too bad GitHub doesn't support that indeed!

@adamziel
Copy link
Contributor Author

adamziel commented Aug 2, 2024

@vcanales created a reusable GitHub action here: https://github.com/vcanales/action-wp-playground-pr-preview/ 🎉 I'm filing a few issues to make it configurable enough to reuse everywhere.

@carstingaxion
Copy link
Contributor

Because I did a similar workflow for the GatherPress plugin, @paaljoachim motivated me on slack to do the same for Gutenberg. And I’m willing to do so.

The action by @vcanales, mentioned by @adamziel, seems to be relevant and easy for a theme, but not a plugin.

Anything I need to know?

I’m starting working on this now.

@carstingaxion carstingaxion linked a pull request Aug 30, 2024 that will close this issue
@carstingaxion
Copy link
Contributor

I opened a PR, which was kinda fun as it got much smaller than expected, because Gutenberg has so many of the necessary parts already on board.

I didn't need to worry about a suitable plugin-proxy.php, there was need for an additional build step and the whole built plugin got uploaded as GitHub artifact already. Cool!

So the only thing missing was a script that comments an updated link to a Playground. And that is what I did in #64947 .

Please have a look, everybody and add your appreciated feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Developer Experience Ideas about improving block and theme developer experience [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants