dolphinscheduler icon indicating copy to clipboard operation
dolphinscheduler copied to clipboard

[Fix-#11669][Workflow Instance Page] Fix the duration and EndTime in Workflow Instance page.

Open DarkAssassinator opened this issue 3 years ago • 6 comments

Purpose of the pull request

fix #11669

Brief change log

  1. Set the update strategy of field ProcessInstance#endTime to @TableField(updateStrategy = FieldStrategy.IGNORED). Because now setEndTime(null) cannot take affect.
  2. When processInstance is running or serial wait, the val of workflow instance duration should be null.
  3. Add a condition in DateUtils.format2Duration, make sure that startTime must before endTime.

Verify this pull request

This pull request is code cleanup without any test coverage.

(or)

This pull request is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

re-run a workflow instance, then check the endTime and duration.

(or)

If your pull request contain incompatible change, you should also add it to docs/docs/en/guide/upgrede/incompatible.md

DarkAssassinator avatar Aug 29 '22 14:08 DarkAssassinator

Hi @DarkAssassinator I think you can use the restartTime field in processInstance to calculate the duration when restart. WDYT?

caishunfeng avatar Sep 09 '22 12:09 caishunfeng

Hi @DarkAssassinator I think you can use the restartTime field in processInstance to calculate the duration when restart. WDYT?

Hi @caishunfeng happy mid-Autumn Festival. The following change can make sure the duration value. image

But the UI page still will show the last EndTime, but re-run still running, not finish. So i think that we need to make sure that setEndTime(null) can take affect

DarkAssassinator avatar Sep 10 '22 01:09 DarkAssassinator

But the UI page still will show the last EndTime, but re-run still running, not finish. So i think that we need to make sure that setEndTime(null) can take affect

OK, but can we replace the field annotation with udpateWrapper or the global config FieldStrategy? Because if you just configure a field separately, it may be a hidden logic. WDYT? cc @ruanwenjun

caishunfeng avatar Sep 13 '22 00:09 caishunfeng

But the UI page still will show the last EndTime, but re-run still running, not finish. So i think that we need to make sure that setEndTime(null) can take affect

OK, but can we replace the field annotation with udpateWrapper or the global config FieldStrategy? Because if you just configure a field separately, it may be a hidden logic. WDYT? cc @ruanwenjun

i think that the global config FieldStratrgy should be better, but we need review all MybatisPlus updateById to make sure that the FiledStrategy.IGNORE can match all scenes

DarkAssassinator avatar Sep 13 '22 14:09 DarkAssassinator

But the UI page still will show the last EndTime, but re-run still running, not finish. So i think that we need to make sure that setEndTime(null) can take affect

OK, but can we replace the field annotation with udpateWrapper or the global config FieldStrategy? Because if you just configure a field separately, it may be a hidden logic. WDYT? cc @ruanwenjun

i think that the global config FieldStratrgy should be better, but we need review all MybatisPlus updateById to make sure that the FiledStrategy.IGNORE can match all scenes

It's not a good idea to use the strategy from MybatisPlus, we may use another ORM in the future.

ruanwenjun avatar Sep 19 '22 01:09 ruanwenjun

But the UI page still will show the last EndTime, but re-run still running, not finish. So i think that we need to make sure that setEndTime(null) can take affect

OK, but can we replace the field annotation with udpateWrapper or the global config FieldStrategy? Because if you just configure a field separately, it may be a hidden logic. WDYT? cc @ruanwenjun

i think that the global config FieldStratrgy should be better, but we need review all MybatisPlus updateById to make sure that the FiledStrategy.IGNORE can match all scenes

It's not a good idea to use the strategy from MybatisPlus, we may use another ORM in the future.

+1 I also think MP is not suitable for enterprise projects

DarkAssassinator avatar Sep 19 '22 13:09 DarkAssassinator

Codecov Report

Merging #11693 (41885c8) into dev (6fc209a) will increase coverage by 0.00%. The diff coverage is 60.00%.

@@            Coverage Diff            @@
##                dev   #11693   +/-   ##
=========================================
  Coverage     39.70%   39.71%           
+ Complexity     4193     4191    -2     
=========================================
  Files          1016     1016           
  Lines         38049    38057    +8     
  Branches       4363     4369    +6     
=========================================
+ Hits          15109    15114    +5     
  Misses        21195    21195           
- Partials       1745     1748    +3     
Impacted Files Coverage Δ
...r/api/service/impl/ProcessInstanceServiceImpl.java 57.37% <50.00%> (-0.34%) :arrow_down:
...pache/dolphinscheduler/common/utils/DateUtils.java 74.39% <100.00%> (+0.31%) :arrow_up:
...er/master/dispatch/host/assign/RandomSelector.java 77.77% <0.00%> (-5.56%) :arrow_down:
...r/plugin/task/sqoop/parameter/SqoopParameters.java 55.12% <0.00%> (-1.29%) :arrow_down:
...erver/master/processor/queue/TaskEventService.java 80.35% <0.00%> (+5.35%) :arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

codecov-commenter avatar Oct 03 '22 06:10 codecov-commenter

wrong PR, contain many history records, close it and then will re-open a new PR

DarkAssassinator avatar Oct 08 '22 14:10 DarkAssassinator