Skip to content

feat(client): add visual-config support for create-build#2139

Open
shantanuk-browserstack wants to merge 4 commits intomasterfrom
CN-2616-migration-vs-settings
Open

feat(client): add visual-config support for create-build#2139
shantanuk-browserstack wants to merge 4 commits intomasterfrom
CN-2616-migration-vs-settings

Conversation

@shantanuk-browserstack
Copy link
Contributor

Summary

  • add PERCY_VISUAL_CONFIG parsing and validation in @percy/client
  • pass sanitized visual-config to create-build API payload
  • strip unknown keys with warnings before API call
  • validate supported field types/ranges including nested intelliIgnore
  • normalize browsers values before sending

Tests

  • add createBuild specs for:
    • valid visual-config payload propagation
    • unknown key stripping with warnings
    • invalid JSON rejection
    • invalid type rejection

Notes

  • this is the CLI PR for the visual-config end-to-end integration plan, paired with the percy-api PR

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds support in @percy/client for configuring build-level visual comparison behavior via a PERCY_VISUAL_CONFIG env var, including sanitization/validation and payload propagation to the create-build API.

Changes:

  • Parse PERCY_VISUAL_CONFIG, validate supported fields/types/ranges, and warn+strip unknown keys (including nested intelliIgnore keys).
  • Send sanitized visual-config in the create-build API request attributes.
  • Add createBuild test coverage for valid propagation, unknown key stripping w/ warnings, and invalid input rejection.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/client/src/client.js Implements env parsing/sanitization/validation for PERCY_VISUAL_CONFIG and includes visual-config in create-build payload.
packages/client/test/client.test.js Adds tests for createBuild visual-config propagation, warnings/stripping, and validation error cases.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

'testhub-build-uuid': this.env.testhubBuildUuid,
'testhub-build-run-id': this.env.testhubBuildRunId
'testhub-build-run-id': this.env.testhubBuildRunId,
...(visualConfig ? { 'visual-config': visualConfig } : {})
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.

2 participants