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

fix Percy workflows not running correctly in multi-label case #5188

Merged
merged 1 commit into from
Jun 26, 2024

Conversation

jmuzina
Copy link
Member

@jmuzina jmuzina commented Jun 24, 2024

Done

Fixes Percy tests not being run properly against PRs with multiple labels.

The array of label names was being converted to "Array" and my if checks were failing. I quoted the conditionals on the jobs, converted them to JSON, and also removed the dependence on a repo variable for the label name.

QA

Check if PR is ready for release

If this PR contains Vanilla SCSS code changes, it should contain the following changes to make sure it's ready for the release:

  • PR should have one of the following labels to automatically categorise it in release notes:
    • Feature 🎁, Breaking Change 💣, Bug 🐛, Documentation 📝, Maintenance 🔨.
  • Vanilla version in package.json should be updated relative to the most recent release, following semver convention:
    • if CSS class names are not changed it can be bugfix relesase (x.x.X)
    • if CSS class names are changed/added/removed it should be minor version (x.X.0)
    • see the wiki for more details
  • Any changes to component class names (new patterns, variants, removed or added features) should be listed on the what's new page.

@webteam-app
Copy link

@jmuzina jmuzina marked this pull request as ready for review June 24, 2024 17:06
@jmuzina jmuzina added Review: Percy needed This PR needs a review of Percy for visual regressions Review: Percy +1 and removed Review: Percy needed This PR needs a review of Percy for visual regressions labels Jun 24, 2024
@bartaz
Copy link
Member

bartaz commented Jun 24, 2024

Not sure if I understand what was wrong, and why changing array to JSON fixes it, but if that works I'm good.

@jmuzina
Copy link
Member Author

jmuzina commented Jun 25, 2024

Not sure if I understand what was wrong, and why changing array to JSON fixes it, but if that works I'm good.

@bartaz

It's not entirely clear to me either - from what I was seeing, this was working in initial tests of the PR, then stopped working when multiple labels were applied to real PRs. I whipped this up as a quick / heavy-handed fix so that our live PRs can get Percy tested, but it can get a more thorough re-look later if needed.

My current best guess is it's something to do with how the array of names is serialized with respect to contains(), or maybe it's just that I quoted the label name with this PR and it wasn't quoted when using the variable. However contains() is supposed to work with arrays out of the box.

So this is converting the array of names into a string, and performing a substring match to find the quoted Percy label.

@bartaz
Copy link
Member

bartaz commented Jun 26, 2024

Changing label from Bug to Maintenance, as it's not a bug in Vanilla codebase (so doesn't need to be featured as a bugfix for consumers of Vanilla).

Copy link
Member

@bartaz bartaz left a comment

Choose a reason for hiding this comment

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

OK, lets try it out, but keep an eye on it.

@jmuzina jmuzina merged commit c45c2f7 into canonical:main Jun 26, 2024
12 checks passed
jmuzina added a commit to jmuzina/vanilla-framework that referenced this pull request Jun 26, 2024
@jmuzina jmuzina deleted the percy-label-trigger-fix branch August 28, 2024 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants