fix: Validate UUID format in CreateOperationNodePayload#1373
Draft
sentry[bot] wants to merge 1 commit into
Draft
fix: Validate UUID format in CreateOperationNodePayload#1373sentry[bot] wants to merge 1 commit into
sentry[bot] wants to merge 1 commit into
Conversation
Author
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1373 +/- ##
=======================================
Coverage 58.66% 58.66%
=======================================
Files 132 132
Lines 15690 15690
=======================================
Hits 9205 9205
Misses 6485 6485 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
This PR addresses issue DALGO-BACKEND-26F by enforcing UUID format validation at the API schema level for operation node creation.
Previously, the
input_node_uuidinCreateOperationNodePayloadandinput_model_uuidinModelSrcOtherInputPayloadwere defined as plainstr. This allowed non-UUID strings (e.g., numeric IDs like '1772272235615') to pass initial schema validation, only to cause aValidationErrorwhen Django'sUUIDFieldattempted to process them during ORM queries (e.g.,CanvasNode.objects.get(uuid=...)).Changes Made:
ddpui/schemas/dbt_workflow_schema.py:import uuid.input_node_uuidinCreateOperationNodePayloadfromstrtouuid.UUID.input_model_uuidinModelSrcOtherInputPayloadfromstrtouuid.UUID.Impact:
input_node_uuidandinput_model_uuidare valid UUID strings. Requests with invalid formats will receive a422 Unprocessable Entityerror with a clear validation message, preventing server-side exceptions.transform_api.pyordbtautomation_service.py) as Django'sUUIDFieldnatively acceptsuuid.UUIDobjects directly, eliminating the need for explicitstr()conversions.Fixes DALGO-BACKEND-26F