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

Show before-and-after sample images in GitHub workflow #956

Merged
merged 17 commits into from
Jan 1, 2024

Conversation

ZeLonewolf
Copy link
Member

@ZeLonewolf ZeLonewolf commented Oct 8, 2023

Fixes #958

This PR add before and after image samples to the "PR Preview" GitHub check tab. It only shows locations where there is a change in rendering. The sample locations are defined in tests/sample_locations.json. The before and after images are generated in userland, uploaded to s3, while a markdown file with the change is pushed over the the privileged CI runner.

I had to change the GitHub action to run the before and after builds in separate folders so they wouldn't stomp on each other. I also use the PR branch's render test list and apply it to both the main and PR branch. This ensures that we have apples to apples comparisons. For this reason, the comparison and clipping scripts are also run out of PR branch code.

I also tweaked some of the sample location sizes and added a dense area of NYC and a recently located 7-way concurrency because Americana :)

I've also made a change the Historic US-66 to demonstrate the change in the checks tab, however, I will remove that change prior to merging this PR.

Below is what it looks like in the checks tab, and you can click down in the checks to view it. There are links to the location in the current demo map as well as the PR preview map.

image

If we think it's useful, a future PR could also generate an image diff to show the pixel differences, perhaps using pixelmatch.

@ZeLonewolf ZeLonewolf marked this pull request as ready for review October 17, 2023 03:56
@ZeLonewolf ZeLonewolf marked this pull request as draft October 23, 2023 21:29
@ZeLonewolf ZeLonewolf marked this pull request as ready for review October 24, 2023 00:43
src/js/shield_defs.js Outdated Show resolved Hide resolved
@claysmalley
Copy link
Member

Looks like the PR preview isn't pulling in the web font. The Interstate 40 shield has the wrong width.

@ZeLonewolf ZeLonewolf marked this pull request as draft October 26, 2023 03:08
scripts/generate_samples.ts Outdated Show resolved Hide resolved
["HIST"],
["XYZA"],
Copy link
Member Author

Choose a reason for hiding this comment

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

This change will be reverted prior to merging. I changed it in order to demonstrate what a before-and-after sample would look like in the build actions.

"name": "athens_ga_7_way_concurrency",
"viewport": {
"width": 400,
"height": 400
Copy link
Member Author

Choose a reason for hiding this comment

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

I added this because it's a good sample location for multiple-concurrency shields and shield coloration.

@ZeLonewolf ZeLonewolf marked this pull request as ready for review December 14, 2023 04:25
@ZeLonewolf ZeLonewolf requested review from jleedev and 1ec5 December 14, 2023 04:25
@ZeLonewolf ZeLonewolf requested a review from akadouri December 14, 2023 04:25
@akadouri
Copy link
Collaborator

akadouri commented Dec 16, 2023

Is the PR Preview supposed to have a preview of all the sample locations?

Things look good to me, cool feature.

@ZeLonewolf
Copy link
Member Author

The preview is intended to only show sample locations for places where the PR changes the rendering from what's in the main branch.

@ZeLonewolf
Copy link
Member Author

Thanks @akadouri for your review, are you good with merging this PR?

@ZeLonewolf ZeLonewolf merged commit 5aa8e8d into main Jan 1, 2024
6 checks passed
@ZeLonewolf ZeLonewolf deleted the zlw-sample-diff branch January 1, 2024 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generate side-by-side sample clips of PR changes
4 participants