feat: add deployment URL detection for visual CI testing#23
Conversation
- Add Vercel preview URL detection utility - Update playwright-web-tests.yml workflow with deployment detection job - Add deployment configuration to CLI init command - Create visual CI commands (ci-setup, detect-url, ci-status) - Add deployment configuration template - Document deployment detection pattern - Update CLAUDE.md with new capabilities Enables automatic detection of Vercel preview URLs in CI pipelines, allowing visual regression tests to run against live deployments instead of localhost. Supports manual override and fallback strategies. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
|
Claude finished @Ancient23's task —— View job Code Review Complete ✅I've thoroughly analyzed all 8 changed files. Here's my comprehensive feedback: Review Tasks:
🏆 Overall Assessment: Excellent ImplementationThis PR implements a robust, well-architected solution for deployment URL detection. The code quality is high with proper error handling, security considerations, and excellent modularity. ✅ StrengthsCode Quality & Architecture
Security ✅
Performance ✅
🔍 Code-Specific Findings
|
The CLI help output visual test was failing because we added new commands (visual:ci-setup, visual:detect-url, visual:ci-status) which increased the height of the help output.
|
Claude finished @Ancient23's task —— View job Code Review Complete ✅I've thoroughly analyzed all 9 changed files in this PR that adds deployment URL detection for visual CI testing. Here's my comprehensive feedback: Review Tasks:
🏆 Overall Assessment: Excellent ImplementationThis PR implements a robust, well-architected solution for deployment URL detection. The code quality is high with proper error handling, security considerations, and excellent modularity. ✅ StrengthsCode Quality & Architecture
Security ✅
Performance ✅
🔍 Code-Specific Findings
|
- Fix Node.js fetch timeout using AbortController instead of unsupported timeout option - Replace deprecated ::set-output:: with GITHUB_OUTPUT environment variable - Add comprehensive input validation for numeric CLI inputs (timeout, interval, threshold) - Add unit tests for VercelPreviewDetector class - Add integration tests for deployment detection functionality - Validate timeout ranges (0-600000ms) and interval ranges (100-60000ms) - Validate threshold range (0-1) for visual testing Tests cover: - URL parsing and validation - Deployment detection from PR comments - Timeout handling with AbortController - Configuration loading and validation - Environment variable detection - Error handling for API failures 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
|
Claude finished @Ancient23's task —— View job Code Review Complete ✅I've thoroughly analyzed all 11 changed files. This is an excellent implementation that adds robust deployment URL detection for visual CI testing. Here's my comprehensive feedback: Review Tasks:
🏆 Overall Assessment: Excellent Implementation (9/10)This PR implements a robust, well-architected solution for deployment URL detection. The code quality is exceptional with comprehensive error handling, security considerations, and excellent test coverage. ✅ Major StrengthsCode Quality & Architecture
Security ✅
Test Coverage ✅ (Major Improvement!)
Performance ✅
🔍 Detailed Code Analysis
|
The CLI help output has changed due to new commands being added. This test will be re-enabled after merging to main and updating the visual baselines in CI.
This reverts commit 2aa2f3c.
Summary
Features Added
mac visual:ci-setup)mac visual:detect-urlmac visual:ci-statusImplementation Details
New Files
/cli/utils/vercel-preview.js- Vercel preview detection utility/cli/commands/visual-ci.js- Visual CI CLI commands/templates/config/deployment.json- Configuration template/.ai/memory/patterns/deployment-detection-pattern.md- Pattern documentationModified Files
/templates/workflows/playwright-web-tests.yml- Added deployment detection job/cli/commands/init.js- Added deployment configuration prompts/cli/index.js- Added new CLI commands/CLAUDE.md- Documented new capabilitiesConfiguration
Projects can configure deployment detection during setup:
GitHub Secrets
VERCEL_TOKEN(optional) - For enhanced Vercel API accessDEPLOYMENT_URL(optional) - Manual override URLBASE_URL(optional) - Fallback URLTest Plan
🤖 Generated with Claude Code