-
Notifications
You must be signed in to change notification settings - Fork 5k
[DSIP-45] Polish the Storage SPI #16141
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
[DSIP-45] Polish the Storage SPI #16141
Conversation
d1333cf to
a0db19d
Compare
...torage-s3/src/main/java/org/apache/dolphinscheduler/plugin/storage/s3/S3StorageOperator.java
Fixed
Show fixed
Hide fixed
| response.setContentType("application/octet-stream"); | ||
| response.setCharacterEncoding("utf-8"); | ||
| response.setContentLength(length); | ||
| response.setHeader("Content-Disposition", "attachment;filename=" + fileName); |
Check warning
Code scanning / CodeQL
HTTP response splitting
| response.setCharacterEncoding("utf-8"); | ||
| response.setContentLength(length); | ||
| response.setHeader("Content-Disposition", "attachment;filename=" + fileName); | ||
| Files.copy(Paths.get(localTmpFileAbsolutePath), response.getOutputStream()); |
Check failure
Code scanning / CodeQL
Uncontrolled data used in path expression
...eduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java
Fixed
Show fixed
Hide fixed
...eduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java
Fixed
Show fixed
Hide fixed
| String originDirectoryAbsolutePath = renameDirectoryDto.getOriginDirectoryAbsolutePath(); | ||
| String targetDirectoryAbsolutePath = renameDirectoryDto.getTargetDirectoryAbsolutePath(); | ||
| storageOperate.copy(originDirectoryAbsolutePath, targetDirectoryAbsolutePath, true, true); | ||
| log.info("Success rename directory: {} -> {} ", originDirectoryAbsolutePath, targetDirectoryAbsolutePath); |
Check failure
Code scanning / CodeQL
Log Injection
| String originFileAbsolutePath = renameFileDto.getOriginFileAbsolutePath(); | ||
| String targetFileAbsolutePath = renameFileDto.getTargetFileAbsolutePath(); | ||
| storageOperate.copy(originFileAbsolutePath, targetFileAbsolutePath, true, true); | ||
| log.info("Success rename file: {} -> {} ", originFileAbsolutePath, targetFileAbsolutePath); |
Check failure
Code scanning / CodeQL
Log Injection
| String originFileAbsolutePath = renameFileDto.getOriginFileAbsolutePath(); | ||
| String targetFileAbsolutePath = renameFileDto.getTargetFileAbsolutePath(); | ||
| storageOperate.copy(originFileAbsolutePath, targetFileAbsolutePath, true, true); | ||
| log.info("Success rename file: {} -> {} ", originFileAbsolutePath, targetFileAbsolutePath); |
Check failure
Code scanning / CodeQL
Log Injection
| } | ||
| storageOperate.upload(srcLocalTmpFileAbsolutePath, updateFileDto.getFileAbsolutePath(), true, true); | ||
| ApiServerMetrics.recordApiResourceUploadSize(updateFileDto.getFile().getSize()); | ||
| log.info("Success upload resource file: {} complete.", updateFileDto.getFileAbsolutePath()); |
Check failure
Code scanning / CodeQL
Log Injection
| storageOperate.upload(srcLocalTmpFileAbsolutePath, updateFileFromContentDto.getFileAbsolutePath(), true, | ||
| true); | ||
| ApiServerMetrics.recordApiResourceUploadSize(updateFileFromContentDto.getFileContent().length()); | ||
| log.info("Success upload resource file: {} complete.", updateFileFromContentDto.getFileAbsolutePath()); |
Check failure
Code scanning / CodeQL
Log Injection
448904a to
02350b4
Compare
1cff355 to
b89b35b
Compare
...torage-api/src/main/java/org/apache/dolphinscheduler/plugin/storage/api/StorageOperator.java
Fixed
Show fixed
Hide fixed
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #16141 +/- ##
============================================
+ Coverage 40.70% 41.07% +0.36%
+ Complexity 5245 5155 -90
============================================
Files 1385 1399 +14
Lines 46109 44856 -1253
Branches 4923 4756 -167
============================================
- Hits 18768 18423 -345
+ Misses 25414 24628 -786
+ Partials 1927 1805 -122 ☔ View full report in Codecov by Sentry. |
b89b35b to
554b9f2
Compare
8c6a08c to
41332d7
Compare
346663b to
c3253e9
Compare
rickchengx
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM, thanks @ruanwenjun for refactoring Storage API to enhance the robustness and maintainability of this part of the code.
...ler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java
Show resolved
Hide resolved
...ler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java
Show resolved
Hide resolved
rickchengx
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is a refactor of the storage module, it would be better to provide some screenshots.
c3253e9 to
80d9adb
Compare
Good suggestion, I add some picture in the description |
2bf30e1 to
2fa31dc
Compare
SbloodyS
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check failed UT.
72ab21f to
8876467
Compare
Done |
8876467 to
6964ceb
Compare
6964ceb to
9fb32f3
Compare
SbloodyS
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
rickchengx
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|




Purpose of the pull request
close #16140
close #16072
Brief change log
Verify this pull request
Verify by e2e(s3 case) / IT(local hdfs/ s3 case) and manual test.
Resource CRUD
UDF CRUD
Using in task