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

Set Percy's target branch to the PR base [v4.x] #4180

Merged
merged 2 commits into from
Sep 12, 2023

Conversation

querkmachine
Copy link
Member

@querkmachine querkmachine commented Sep 5, 2023

Modify GitHub actions config so that Percy runs comparisons against the PR's base branch rather than always using main.

This is particularly needed on the v4 support branch as main has diverged quite significantly, however we still intend to make v4 releases and want visual regression tests to work as expected.

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-4180 September 5, 2023 15:07 Inactive
@colinrotherham
Copy link
Contributor

Looks like it's picking up diffs from some commits we backported

df2c476 for main
d3c249f for support/4.x

Which is good?

@querkmachine
Copy link
Member Author

The Percy changes seem good. The disappearance of margin above the header/footer examples would be consistent with the removal of the main wrapper from the examples. 👍

There's a tiny change on the select component where it appears to have become a couple of pixels narrower between different versions of Edge, but as there's no change in Firefox I would assume this change is not a result of changes to our code.

Modify GitHub actions config so that Percy runs comparisons with the PR's target branch as the base, rather than always using 'main'.
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-4180 September 5, 2023 15:36 Inactive
@querkmachine querkmachine marked this pull request as ready for review September 5, 2023 15:44
@querkmachine querkmachine requested a review from a team as a code owner September 5, 2023 15:44
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-4180 September 12, 2023 09:32 Inactive
Copy link
Contributor

@colinrotherham colinrotherham left a comment

Choose a reason for hiding this comment

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

Works great in a manual run too? Let's do it

@querkmachine querkmachine merged commit 5f15a4d into support/4.x Sep 12, 2023
39 checks passed
@querkmachine querkmachine deleted the v4-percy-target-branch branch September 12, 2023 10:07
@querkmachine
Copy link
Member Author

querkmachine commented Sep 12, 2023

@colinrotherham From what I can gather there isn't an obvious way of making this work in manual runs without hardcoding the branch name. GitHub Actions always defaults to using main as github.event.pull_request.base is presumably null or undefined. Alternatively, manual runs always use the version of the file in the main branch, so aren't using this branch's configuration anyway.

Choosing from the "Use workflow from" dropdown in the Actions interface only changes what branch is compared against main.

I've merged on the basis that the last commit to this branch seemed to produce the expected comparisons in Percy: https://percy.io/55ba5e1a/govuk-frontend/builds/29991587/

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.

Configure Percy to compare against the support branch for PRs raised against the support/4.x branch
3 participants