Skip to content

[PR 10] Add validateSchemaNode Error Handling for DML #2486

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

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

NoritakaIkeda
Copy link
Member

@NoritakaIkeda NoritakaIkeda commented Jul 10, 2025

Issue

Why is this change needed?

This PR adds error handling and retry mechanism for DML execution failures in the validateSchemaNode. Previously, DML execution errors would fail immediately without any retry logic, even for transient errors like constraint violations that might succeed on retry.

What would you like reviewers to focus on?

  • The retry logic implementation for DML execution errors
  • The list of retryable error patterns (constraint violations, foreign keys, etc.)
  • Test coverage for all error scenarios

Testing Verification

Unit tests have been added to verify:

  • Retryable error detection works correctly
  • Retry mechanism respects the max retry limit
  • Non-retryable errors fail immediately
  • Mixed success/failure scenarios are handled properly

What was done

  • Add error handling and retry mechanism for DML execution in validateSchemaNode
  • Implement detection of retryable errors (constraint violations, foreign keys, deadlocks, etc.)
  • Add MAX_DML_EXECUTION_RETRIES configuration constant
  • Add comprehensive test coverage for all error scenarios
  • Ensure proper logging for debugging and monitoring

pr_agent:summary

Detailed Changes

  • Modified validateSchemaNode.ts to check for retryable errors and implement retry logic
  • Added RETRYABLE_ERROR_PATTERNS constant to identify errors that should trigger retries
  • Updated state with retry count tracking and retry flags
  • Added extensive test cases covering all error handling scenarios

pr_agent:walkthrough

Additional Notes

This PR builds on the combined DDL/DML execution feature and adds robust error handling specifically for DML execution failures.

🤖 Generated with Claude Code

- Add retryable error detection for constraint violations, foreign keys, etc.
- Implement retry logic with MAX_DML_EXECUTION_RETRIES configuration
- Add comprehensive test coverage for error scenarios
- Handle mixed success/failure results properly
- Track retry count in workflow state

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Copy link

changeset-bot bot commented Jul 10, 2025

⚠️ No Changeset found

Latest commit: 1042281

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Jul 10, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
liam-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 11, 2025 11:46am
liam-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 11, 2025 11:46am
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
liam-docs ⬜️ Ignored (Inspect) Visit Preview Jul 11, 2025 11:46am
liam-erd-sample ⬜️ Skipped (Inspect) Jul 11, 2025 11:46am

Copy link

supabase bot commented Jul 10, 2025

Updates to Preview Branch (feat/pr10-add-validate-error-handling) ↗︎

Deployments Status Updated
Database Fri, 11 Jul 2025 11:43:24 UTC
Services Fri, 11 Jul 2025 11:43:24 UTC
APIs Fri, 11 Jul 2025 11:43:24 UTC

Tasks are run on every commit but only new migration files are pushed.
Close and reopen this PR if you want to apply changes from existing seed or migration files.

Tasks Status Updated
Configurations Fri, 11 Jul 2025 11:43:29 UTC
Migrations Fri, 11 Jul 2025 11:43:29 UTC
Seeding Fri, 11 Jul 2025 11:43:29 UTC
Edge Functions Fri, 11 Jul 2025 11:43:29 UTC

View logs for this Workflow Run ↗︎.
Learn more about Supabase for Git ↗︎.

@NoritakaIkeda NoritakaIkeda self-assigned this Jul 10, 2025
@NoritakaIkeda NoritakaIkeda changed the base branch from main to feat/pr9-add-combined-execution July 10, 2025 11:02
@vercel vercel bot temporarily deployed to Preview – liam-erd-sample July 11, 2025 11:42 Inactive
Base automatically changed from feat/pr9-add-combined-execution to main July 14, 2025 02:56
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.

1 participant