Skip to content

Conversation

@rickchengx
Copy link
Contributor

Purpose of the pull request

image

Brief change log

Verify this pull request

manually tested

截屏2023-01-20 11 44 52

截屏2023-01-20 11 44 59

@github-actions github-actions bot added backend UI ui and front end related labels Jan 20, 2023
@rickchengx
Copy link
Contributor Author

rickchengx commented Jan 20, 2023

Hi, @EricPyZhou @EricGao888 @SbloodyS Could you please help review this?

@codecov-commenter
Copy link

codecov-commenter commented Jan 20, 2023

Codecov Report

Merging #13435 (4fd1802) into dev (3b54de0) will increase coverage by 0.00%.
The diff coverage is 37.98%.

@@            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     
Impacted Files Coverage Δ
...heduler/plugin/storage/oss/OssStorageOperator.java 35.48% <37.00%> (+2.68%) ⬆️
...heduler/api/service/impl/ResourcesServiceImpl.java 38.51% <100.00%> (+0.11%) ⬆️
...e/dolphinscheduler/dao/upgrade/WorkerGroupDao.java 41.17% <0.00%> (-14.38%) ⬇️
...hinscheduler/dao/upgrade/ProcessDefinitionDao.java 7.79% <0.00%> (-1.07%) ⬇️
.../org/apache/dolphinscheduler/api/enums/Status.java 100.00% <0.00%> (ø)
...pache/dolphinscheduler/dao/upgrade/ProjectDao.java 0.00% <0.00%> (ø)
...ache/dolphinscheduler/dao/upgrade/ScheduleDao.java 0.00% <0.00%> (ø)
...che/dolphinscheduler/dao/upgrade/JsonSplitDao.java 0.00% <0.00%> (ø)
...heduler/server/worker/rpc/WorkerMessageSender.java 0.00% <0.00%> (ø)
...duler/server/master/processor/queue/TaskEvent.java 60.00% <0.00%> (ø)
... and 26 more

📣 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

This path depends on a [user-provided value](1). This path depends on a [user-provided value](2). This path depends on a [user-provided value](3). This path depends on a [user-provided value](4). This path depends on a [user-provided value](5). This path depends on a [user-provided value](6).
Copy link
Member

@ruanwenjun ruanwenjun left a 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<>();
Copy link
Member

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);
       }
}

Copy link
Contributor Author

@rickchengx rickchengx Jan 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, @ruanwenjun , thanks for your suggestion!

I've changed as below, (also in S3)

image

@ruanwenjun ruanwenjun added the 3.2.0 for 3.2.0 version label Jan 20, 2023
@ruanwenjun ruanwenjun modified the milestones: 3.1.4, 3.2.0 Jan 20, 2023
@ruanwenjun ruanwenjun added the feature new feature label Jan 20, 2023
@ruanwenjun
Copy link
Member

Since we don't hope to add new feature in 3.1.x, so I add lable 3.2.0.

Copy link
Member

@EricGao888 EricGao888 left a 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?

@rickchengx
Copy link
Contributor Author

rickchengx commented Jan 30, 2023

Good job for fixing these methods. Could u plz also add some related UT cases?
Hi @EricGao888 , thanks for your suggestion and I've added related UTs.

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

This log entry depends on a [user-provided value](1). This log entry depends on a [user-provided value](2).
@rickchengx rickchengx closed this Feb 1, 2023
@rickchengx rickchengx reopened this Feb 1, 2023
@rickchengx rickchengx closed this Feb 1, 2023
@rickchengx rickchengx reopened this Feb 1, 2023
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 1, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 4 Code Smells

38.0% 38.0% Coverage
44.7% 44.7% Duplication

Copy link
Member

@Amy0104 Amy0104 left a 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.

@Amy0104 Amy0104 merged commit 8a59ab4 into apache:dev Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.2.0 for 3.2.0 version backend feature new feature UI ui and front end related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] [Resource Center] NPE when use OSS as the resource center

5 participants