refactor: improve Percy build verification process#7
Open
devin-ai-integration[bot] wants to merge 3 commits intomainfrom
Open
refactor: improve Percy build verification process#7devin-ai-integration[bot] wants to merge 3 commits intomainfrom
devin-ai-integration[bot] wants to merge 3 commits intomainfrom
Conversation
- Create centralized error handling utility (percy-error.ts) with: - Custom PercyError class with standardized error codes - Result types for consistent error handling patterns - Retry utilities with configurable options and exponential backoff - Logging utilities for debug, warning, and error messages - Log pattern matching for retryable errors - Build status formatting and alert-worthy detection - Refactor percy-api.ts to use centralized error handling: - Improved logging with context tracking - Better error messages with error codes - Refactor read-build-number-from-logs.ts: - Replace fragile string parsing with regex-based extraction - Add build ID validation - Add detailed result types for better error tracking - Simplify e2e.yml workflow: - Extract check_logs function for log analysis - Create is_retryable_error function for retry logic - Simplify retry mechanism with dedicated functions - Improve e2e-affected/action.yml: - Better Percy token validation with error messaging - Extract constants for better maintainability - Add helper functions for parallel commit fetching - Expand test coverage for all new utilities Co-Authored-By: benc@cognition.ai <Benc@windsurf.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Co-Authored-By: benc@cognition.ai <Benc@windsurf.com>
Co-Authored-By: benc@cognition.ai <Benc@windsurf.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
refactor: improve Percy build verification with centralized error handling
Summary
This PR refactors the Percy build verification process to make it more robust and maintainable. The main changes include:
New centralized error handling utility (
percy-error.ts) that provides:PercyErrorclass with standardized error codesPercyResult<T>type for consistent success/failure handlingwithRetryutility with configurable exponential backofflogDebug,logWarning,logError)formatBuildStatus,isAlertWorthy)Improved build ID extraction (
read-build-number-from-logs.ts):extractBuildIdWithDetailsfunction with detailed result informationSimplified GitHub Actions workflow (
e2e.yml):check_logsfunction for log analysisis_retryable_errorfunction for retry logicBetter affected detection (
e2e-affected/action.yml):Updates since last revision
isAlertWorthyfunction that created unreachable codeReview & Testing Checklist for Human
This is a medium-risk change affecting critical CI/CD infrastructure. Please verify:
[^/]+\/[^/]+(exactly 2 path segments) to.*(any segments). Verify this matches all expected Percy URL formats likehttps://percy.io/82a32315/web/skyux-integration-e2e/builds/41420284Recommended test plan:
Notes
Link to Devin run: https://app.devin.ai/sessions/51b556e9f4df4de095b9c69e0b4b5641
Requested by: @bcmake