Repository navigation
fix(file-service): return 404 for another dataset's version and 400 for a missing upload type - #9099
Conversation
…or a missing upload type
Automated Reviewer SuggestionsBased on the
|
Backport auto-label reportThis
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9099 +/- ##
============================================
+ Coverage 91.81% 92.34% +0.53%
+ Complexity 5069 5018 -51
============================================
Files 1271 1267 -4
Lines 55208 54433 -775
Branches 6987 6879 -108
============================================
- Hits 50688 50265 -423
+ Misses 2800 2490 -310
+ Partials 1720 1678 -42
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Pull request was closed
What changes were proposed in this PR?
Two dataset endpoints skipped input checks the model endpoints already make, so bad input produced a 500:
versionZipchecked access ondidbut loaded versiondvidwithout checking it belongs todid.getDatasetVersionByIDnow filters ondidas well, likegetModelVersionByID, so a version from another dataset returns 404.typeon multipart upload.POST /dataset/multipart-uploadcalledtoLowerCaseon a missingtype. The model endpoint's check is now a sharedResourceUploadService.multipartOperationOrThrow, used by both, which returns 400 for a missing or unknowntype.Any related issues, documentation, discussions?
Closes #9098
How was this PR tested?
Added three cases to
DatasetResourceSpec: another dataset's version returns 404 from the public and owner file-list endpoints and fromversionZip, and a missingtypereturns 400. All fail without the fix.Also checked against a local stack with
curl(table above).Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Opus 5.5)