Skip to content

Conversation

@bs-shobhitkumar
Copy link
Contributor

This pull request introduces an automatic domain validation and allow-listing feature to Percy, enabling projects to dynamically validate and manage allowed and blocked domains during builds. The implementation adds configuration options, integrates with an external validation endpoint, and persists newly discovered domains to the project configuration for future builds.

Auto Domain Validation Feature:

  • Added a new autoDomainValidation configuration option in config.js to control domain validation settings, including enabling/disabling, endpoint URL, timeout, and whether to save results to the project.
  • The Percy class now maintains domain validation state, loads pre-approved/pre-blocked domains from the project on startup, and saves newly discovered allowed/blocked domains at shutdown. This ensures persistent and evolving domain allow-lists per project. [1] [2] [3] [4]

Domain Validation Logic Integration:

  • The Network class and resource handling logic now use the auto domain validation context. Requests are checked against manual config, then validated via the external service if not explicitly allowed/blocked, with results cached for the session and persisted for future builds. [1] [2] [3] [4]
  • Added validateDomainForAllowlist() to handle validation, caching, and error fallback, ensuring robust and efficient domain management during resource requests.

Percy Client API Extensions:

  • The PercyClient class now provides methods to fetch and update project domain configuration, and to validate domains via the external endpoint, supporting the new auto domain validation workflow.

These changes collectively enable Percy to automatically manage domain allow-lists, improving build reliability and reducing manual configuration.

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