Skip to content

Conversation

@ruanwenjun
Copy link
Member

@ruanwenjun ruanwenjun commented Mar 20, 2021

  • Refact create/ update datasource API

Purpose of the pull request

Increasing code scalability, make it ease to add a new datasource type for developer. More detail can see #5083

This also closes #5083

Brief change log

Change the create/update datasource method in DataSourceController

Verify this pull request

Add Unit test and can be tested from ui.

@ruanwenjun ruanwenjun force-pushed the dev_wenjun_optimize_datasource branch from daa8dc8 to df5d6d8 Compare March 20, 2021 05:58
@codecov-io
Copy link

codecov-io commented Mar 20, 2021

Codecov Report

Merging #5116 (7476149) into dev (f3195fc) will increase coverage by 0.20%.
The diff coverage is 66.17%.

Impacted file tree graph

@@             Coverage Diff              @@
##                dev    #5116      +/-   ##
============================================
+ Coverage     47.42%   47.62%   +0.20%     
- Complexity     3750     3806      +56     
============================================
  Files           570      592      +22     
  Lines         24116    24259     +143     
  Branches       2806     2791      -15     
============================================
+ Hits          11437    11554     +117     
- Misses        11616    11644      +28     
+ Partials       1063     1061       -2     
Impacted Files Coverage Δ Complexity Δ
...scheduler/api/controller/DataSourceController.java 4.76% <0.00%> (+0.11%) 2.00 <0.00> (ø)
...eduler/api/service/impl/DataSourceServiceImpl.java 54.75% <0.00%> (+0.06%) 21.00 <0.00> (-18.00) ⬆️
...e/dolphinscheduler/common/enums/DbConnectType.java 0.00% <ø> (ø) 0.00 <0.00> (ø)
.../utils/datasource/AbstractDatasourceProcessor.java 59.18% <59.18%> (ø) 11.00 <11.00> (?)
...i/dto/datasource/ClickHouseDatasourceParamDTO.java 66.66% <66.66%> (ø) 2.00 <2.00> (?)
...uler/api/dto/datasource/Db2DatasourceParamDTO.java 66.66% <66.66%> (ø) 2.00 <2.00> (?)
...ler/api/dto/datasource/HiveDataSourceParamDTO.java 66.66% <66.66%> (ø) 2.00 <2.00> (?)
...er/api/dto/datasource/MysqlDatasourceParamDTO.java 66.66% <66.66%> (ø) 2.00 <2.00> (?)
...i/dto/datasource/PostgreSqlDatasourceParamDTO.java 66.66% <66.66%> (ø) 2.00 <2.00> (?)
...r/api/dto/datasource/PrestoDatasourceParamDTO.java 66.66% <66.66%> (ø) 2.00 <2.00> (?)
... and 42 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f3195fc...7476149. Read the comment docs.

@ruanwenjun ruanwenjun force-pushed the dev_wenjun_optimize_datasource branch 12 times, most recently from 7c8b97f to 39ac35d Compare March 23, 2021 16:18
@ruanwenjun ruanwenjun force-pushed the dev_wenjun_optimize_datasource branch from 39ac35d to d0e31fe Compare March 27, 2021 12:39
@CalvinKirs
Copy link
Member

@zhuangchong please take a look.thx

@chengshiwen
Copy link
Member

@ruanwenjun Hi, sorry for too late review, could you solve the 18 Code Smells and 2.8% Duplication at first? Thanks so much

@ruanwenjun ruanwenjun force-pushed the dev_wenjun_optimize_datasource branch 7 times, most recently from 0799404 to 8e4b568 Compare April 11, 2021 09:29
@ruanwenjun ruanwenjun force-pushed the dev_wenjun_optimize_datasource branch 5 times, most recently from 7138ae8 to c844b66 Compare April 15, 2021 14:05
@ruanwenjun ruanwenjun force-pushed the dev_wenjun_optimize_datasource branch 3 times, most recently from d6c89a0 to 98a1eef Compare April 15, 2021 16:32
@ruanwenjun
Copy link
Member Author

@zhuangchong Hi, Zhaungchong, I have re-modified according to your suggestion, please help me review. And there seems some problem with code coverage calculate, some unit test are not added to the SonarCloud.

@ruanwenjun ruanwenjun requested a review from zhuangchong April 20, 2021 11:20
@zhuangchong
Copy link
Contributor

@zhuangchong Hi, Zhaungchong, I have re-modified according to your suggestion, please help me review. And there seems some problem with code coverage calculate, some unit test are not added to the SonarCloud.

ok, let me take a look, please solve code coverage and code smell.

@ruanwenjun ruanwenjun force-pushed the dev_wenjun_optimize_datasource branch from cb46d1f to c2c720a Compare April 23, 2021 05:28
@ruanwenjun ruanwenjun force-pushed the dev_wenjun_optimize_datasource branch from c2c720a to 71cc499 Compare April 23, 2021 05:31
@ruanwenjun ruanwenjun force-pushed the dev_wenjun_optimize_datasource branch from 71cc499 to e0c38be Compare April 23, 2021 05:33
@codecov-commenter
Copy link

codecov-commenter commented Apr 23, 2021

Codecov Report

Merging #5116 (e0c38be) into dev (3a7006a) will decrease coverage by 0.24%.
The diff coverage is 40.10%.

Impacted file tree graph

@@             Coverage Diff              @@
##                dev    #5116      +/-   ##
============================================
- Coverage     48.59%   48.34%   -0.25%     
- Complexity     3814     3869      +55     
============================================
  Files           570      592      +22     
  Lines         24154    24469     +315     
  Branches       2801     2780      -21     
============================================
+ Hits          11737    11829      +92     
- Misses        11336    11567     +231     
+ Partials       1081     1073       -8     
Impacted Files Coverage Δ Complexity Δ
...scheduler/api/controller/DataSourceController.java 4.76% <0.00%> (+0.11%) 2.00 <0.00> (ø)
...e/dolphinscheduler/common/enums/DbConnectType.java 77.77% <ø> (+77.77%) 2.00 <0.00> (+2.00)
...che/dolphinscheduler/common/utils/CommonUtils.java 65.30% <ø> (ø) 13.00 <0.00> (ø)
.../server/worker/task/processdure/ProcedureTask.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...lphinscheduler/server/worker/task/sql/SqlTask.java 7.38% <0.00%> (ø) 2.00 <0.00> (ø)
.../common/datasource/BaseHdfsDatasourceParamDTO.java 7.69% <7.69%> (ø) 1.00 <1.00> (?)
...common/datasource/AbstractDatasourceProcessor.java 23.80% <23.80%> (ø) 2.00 <2.00> (?)
...eduler/api/service/impl/DataSourceServiceImpl.java 46.95% <25.00%> (-7.60%) 18.00 <0.00> (-21.00)
...mon/datasource/mysql/MysqlDatasourceProcessor.java 30.30% <30.30%> (ø) 7.00 <7.00> (?)
...ommon/datasource/hive/HiveDatasourceProcessor.java 30.48% <30.48%> (ø) 9.00 <9.00> (?)
... and 65 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3a7006a...e0c38be. Read the comment docs.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

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

41.3% 41.3% Coverage
0.8% 0.8% Duplication

Copy link
Contributor

@zhuangchong zhuangchong left a comment

Choose a reason for hiding this comment

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

LGTM.

Copy link
Member

@CalvinKirs CalvinKirs left a comment

Choose a reason for hiding this comment

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

LGTM

@CalvinKirs CalvinKirs merged commit e6d8da4 into apache:dev Apr 25, 2021
@ruanwenjun ruanwenjun deleted the dev_wenjun_optimize_datasource branch July 9, 2021 13:54
@CalvinKirs CalvinKirs changed the title [Improvement][API] Create Datasource #5083 [Improvement#5083][API] Refactored data source creation Oct 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Improvement][API] Refactored data source creation

6 participants