Skip to content
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

[Improvement-16887][Dependent Task] Dependet task improvement #16910

Open
wants to merge 9 commits into
base: dev
Choose a base branch
from

Conversation

SbloodyS
Copy link
Member

Purpose of the pull request

close #16887

Brief change log

mr9O2M54vRhYXUb.png
g3O7fbEdYDXVyvA.png
AHXeuS1j2Oq54cT.png

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:

(or)

Pull Request Notice

Pull Request Notice

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

@SbloodyS SbloodyS added UI ui and front end related improvement make more easy to user or prompt friendly backend labels Dec 21, 2024
@SbloodyS SbloodyS added this to the 3.3.0 milestone Dec 21, 2024
@SbloodyS SbloodyS self-assigned this Dec 21, 2024
import lombok.Data;
import lombok.EqualsAndHashCode;

@EqualsAndHashCode(callSuper = true)

Check notice

Code scanning / CodeQL

Missing Override annotation Note

This method overrides
TaskInstance.canEqual
; it is advisable to add an Override annotation.
import lombok.Data;
import lombok.EqualsAndHashCode;

@EqualsAndHashCode(callSuper = true)

Check notice

Code scanning / CodeQL

Missing Override annotation Note

This method overrides
DependentItem.canEqual
; it is advisable to add an Override annotation.
@github-actions github-actions bot added the test label Dec 21, 2024
} else {
TaskDefinition taskDefinition = taskDefinitionMap.get(dependentItem.getDepTaskCode());
taskDependentResult.setTaskDefinitionCode(taskDefinition.getCode());
taskDependentResultDao.upsertTaskDependentResult(taskDependentResult);
Copy link
Member

Choose a reason for hiding this comment

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

It would be better if we can set the dependent result into taskInstance's app_link, then we can avoid importing a table here and we can also avoid query the dependent result in other place. cc @caishunfeng

Copy link
Member Author

Choose a reason for hiding this comment

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

TaskInstance's app_link is used to store yarn application ids. So I think it's not a good idea.

Copy link
Contributor

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 a field runtime_context to store all runtime context if need.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll create a new table t_ds_task_instance_context to store context.

@@ -48,7 +49,8 @@
TaskDefinitionDao taskDefinitionDao,
TaskInstanceDao taskInstanceDao,
WorkflowInstanceDao workflowInstanceDao,
IWorkflowExecutionRunnable workflowExecutionRunnable) {
IWorkflowExecutionRunnable workflowExecutionRunnable,

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'workflowExecutionRunnable' is never used.
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
18.9% Coverage on New Code (required ≥ 60%)

See analysis details on SonarQube Cloud


private String context;

private ContextType contextType;
Copy link
Member

Choose a reason for hiding this comment

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

I am not sure if we need to add context type here, one task instance should only have one context? or we will add more type in the future? e.g. RESULT_CONTEXT, RUNTIME_CONTEXT. If we will move more context into this table, it's better to change the enum in ContextType to RESULT_CONTEXT and RUNTIME_CONTEXT, otherwise, there might bring a lot of type here, and the type is only used to do deserization, we can move the task type into context, then we can use @JsonSubTypes to help us do serialization, some example can find at ICommandParam.


DEPENDENT_RESULT(1, "dependent task result");

@EnumValue
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 store name to db rather than code, this will not cost big performance, but will help to have better readability.


@EqualsAndHashCode(callSuper = true)
@Data
public class TaskInstanceDependentResult extends TaskInstance {
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 a new class like below, the inheritance relationship looks strange.

public class TaskInstanceDetails {
    private TaskInstance taskInstance;
    private TaskInstanceContext taskInstanceContext;
}

import lombok.Data;

@Data
public class TaskInstanceDependentResultContext {
Copy link
Member

Choose a reason for hiding this comment

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

Add an interface TaskInstanceResultContext can help us to do deserialization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend improvement make more easy to user or prompt friendly test UI ui and front end related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Improvement][Dependent Task] Dependet task improvement
3 participants