Merged
Conversation
Expose a mutable `form` property on `RequestInfo` so users can read and modify multipart/form-encoded fields (strings and file uploads) inside `convert_request_to_next_version_for` handlers. The property returns `None` for non-form requests, matching the existing pattern for missing bodies. Mutated form data is reconstructed into a new `FormData` before being passed to FastAPI's dependency solver. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #359 +/- ##
==========================================
- Coverage 99.89% 99.84% -0.06%
==========================================
Files 72 72
Lines 5553 5645 +92
Branches 356 358 +2
==========================================
+ Hits 5547 5636 +89
- Misses 6 9 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Remove redundant None guards in migrator functions that were always True, causing partial branch coverage. The tests only make form requests so form is always set; add type: ignore comments to keep type checkers happy. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Code reviewFound 2 issues:
cadwyn/cadwyn/structure/data.py Lines 27 to 30 in e9e20b4 cadwyn/cadwyn/structure/versions.py Lines 434 to 437 in e9e20b4
cadwyn/cadwyn/structure/versions.py Lines 740 to 744 in e9e20b4 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
- Store form data as list[tuple] instead of dict to preserve duplicate keys (e.g. tags=a&tags=b no longer truncated to tags=b) - Reconstruct FormData directly from the list, dropping the lossy .items() call in _migrate_request - Remove function-level pragma: no cover from _get_body since the form migration tests now exercise it; retain targeted pragmas only on the two defensive exception handlers (HTTPException re-raise and generic Exception catch) - Update existing form migration tests to use list operations and add tests for multi-value fields and all previously uncovered _get_body branches Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…pport Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.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.
Expose a mutable
formproperty onRequestInfoso users can read and modify multipart/form-encoded fields (strings and file uploads) insideconvert_request_to_next_version_forhandlers. The property returnsNonefor non-form requests, matching the existing pattern for missing bodies. Mutated form data is reconstructed into a newFormDatabefore being passed to FastAPI's dependency solver.