-
Notifications
You must be signed in to change notification settings - Fork 5k
[Fix-13434][Resource Center] fix the NPE when use OSS as the resource center #13435
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
Conversation
|
Hi, @EricPyZhou @EricGao888 @SbloodyS Could you please help review this? |
Codecov Report
@@ Coverage Diff @@
## dev #13435 +/- ##
==========================================
Coverage 39.57% 39.58%
- Complexity 4335 4377 +42
==========================================
Files 1086 1097 +11
Lines 40965 41519 +554
Branches 4700 4776 +76
==========================================
+ Hits 16213 16435 +222
- Misses 22949 23260 +311
- Partials 1803 1824 +21
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
| stringBuilder.append(myStr, secondLastIndex + 1, lastIndex + 1); | ||
|
|
||
| return stringBuilder.toString(); | ||
| Path path = Paths.get(myStr); |
Check failure
Code scanning / CodeQL
Uncontrolled data used in path expression
...torage-s3/src/main/java/org/apache/dolphinscheduler/plugin/storage/s3/S3StorageOperator.java
Fixed
Show fixed
Hide fixed
ruanwenjun
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.
Basically LGTM
| return null; | ||
| List<StorageEntity> storageEntityList = new ArrayList<>(); | ||
|
|
||
| LinkedList<StorageEntity> foldersToFetch = new LinkedList<>(); |
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.
It's better to add initialize path in foldersToFetch, and then you only need to loop the foldersToFetch.
while (!foldersToFetch.isEmpty()) {
String pathToExplore = foldersToFetch.pop().getFullName();
try {
List<StorageEntity> tempList = listFilesStatus(pathToExplore, defaultPath, tenantCode, type);
for (StorageEntity temp : tempList) {
if (temp.isDirectory()) {
foldersToFetch.add(temp);
}
}
storageEntityList.addAll(tempList);
} catch (Exception e) {
logger.error("error while listing files status recursively, path: {}", pathToExplore, e);
}
}
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 we don't hope to add new feature in 3.1.x, so I add lable 3.2.0. |
EricGao888
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.
Good job for fixing these methods. Could u plz also add some related UT cases?
|
| try { | ||
| initialEntity = getFileStatus(path, defaultPath, tenantCode, type); | ||
| } catch (Exception e) { | ||
| logger.error("error while listing files status recursively, path: {}", path, e); |
Check failure
Code scanning / CodeQL
Log Injection
|
SonarCloud Quality Gate failed. |
Amy0104
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.
The front end part LGTM.









Purpose of the pull request
close: [Bug] [Resource Center] NPE when use OSS as the resource center #13434
After the resource center is refactored in [Feature-10495][Resource Center] Resource Center Refactor #12076
The new methods in
StorageOperateis not implemented inOSSBrief change log
Verify this pull request
manually tested