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

Add details to the automated content update PR #467

Merged
merged 3 commits into from
Jul 11, 2024

Conversation

ryelle
Copy link
Contributor

@ryelle ryelle commented Jul 8, 2024

I was aiming to add screenshots & other context to the content update PRs (e.g., #464), as I've found myself needing to reply with comments describing the changes and/or linking off to relevant issues (when these exist, this is easier 🙂)

This PR is adds a changed-page list & link to screenshots to the automatically-created PR. The screenshots are added as a link to the action's artifacts file, which is a zip file with full-screen screenshots of the changed pages. Changed pages are detected by updates to the pattern files, which are looked up using the manifest.json to get the page slug. The slug is then used to fetch page data from the wp.org REST API, which is how we get the title & permalink.

If there are multiple pages changed, they should all appear in the list, and all screenshots will be in the download.

(Note that this won't work with the 6.6 release page, since the pattern is currently set to the "in progress" pattern #463, it will only show the placeholder pattern.)

Screenshots

Screenshot 2024-07-08 at 5 41 02 PM

ryelle#1

How to test the changes in this Pull Request:

I tested it on my own fork, changing the action to if: github.repository_owner == 'ryelle', & making a change to one of the pattern files. That way, when the automated action runs, it sees the "change" and creates a PR.

You can also test the screenshot command by running yarn screenshot-changes source/wp-content/themes/wporg-main-2022/patterns/about.php (or any other pattern files). Make sure to run yarn first to get the new puppeteer dependency.

@ryelle ryelle added the [Component] Tools Build tools, packages, etc label Jul 8, 2024
@ryelle ryelle self-assigned this Jul 8, 2024
Copy link
Member

@dd32 dd32 left a comment

Choose a reason for hiding this comment

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

This makes sense to me!

It's a shame we can't inline the images, but upon checking, GitHub does not support automated image uploads to PRs. This is due to potential for abuse.
The only way I could see that we could achieve that would be to commit them to a specific git branch (which has no code history, just the images) and inline those instead.

@ryelle
Copy link
Contributor Author

ryelle commented Jul 11, 2024

The only way I could see that we could achieve that would be to commit them to a specific git branch (which has no code history, just the images) and inline those instead.

Yeah, that could work - maybe a future improvement :)

@ryelle ryelle merged commit 24c8527 into trunk Jul 11, 2024
2 checks passed
@ryelle ryelle deleted the try/add-screenshots-to-change-pr branch July 11, 2024 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Component] Tools Build tools, packages, etc
2 participants