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

Fetch task template in dynamic workflow task #254

Merged
merged 4 commits into from
Oct 2, 2023
Merged

Conversation

honnix
Copy link
Member

@honnix honnix commented Sep 29, 2023

TL;DR

Fetch task template when encountering remote task in dynamic workflow.

Type

  • Bug Fix
  • Feature
  • Plugin

Are all requirements met?

  • Code completed
  • Smoke tested
  • Unit tests added
  • Code documentation added
  • Any pending items have an associated Issue

Complete description

#248 is not sufficient because in order to build dynamic job, we need task template, so in this PR we fetch task template for remote workflow.

Tracking Issue

NA

Follow-up issue

NA

Signed-off-by: Hongxin Liang <[email protected]>
@@ -185,34 +184,38 @@ public TaskIdentifier fetchLatestTaskId(NamedEntityIdentifier taskId) {
return fetchLatestResource(
taskId,
request -> stub.listTasks(request).getTasksList(),
TaskOuterClass.Task::getId,
Copy link
Member Author

Choose a reason for hiding this comment

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

This double-function doesn't seem to be necessary.

@@ -374,8 +375,10 @@ public static Map<WorkflowIdentifier, WorkflowTemplate> collectSubWorkflows(
.collect(toUnmodifiableMap());
}

public static Map<TaskIdentifier, TaskTemplate> collectTasks(
List<Node> rewrittenNodes, Map<TaskIdentifier, TaskTemplate> allTasks) {
public static Map<TaskIdentifier, TaskTemplate> collectDynamicWorkflowTasks(
Copy link
Member Author

Choose a reason for hiding this comment

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

Rename it to be more specific. This is not used by anything else.

@@ -138,33 +137,7 @@ public void shouldPropagateCreateTaskToStub() {
.version(TASK_VERSION)
.build();

TypedInterface interface_ =
Copy link
Member Author

Choose a reason for hiding this comment

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

Extracted to Fixtures.

Signed-off-by: Hongxin Liang <[email protected]>
Signed-off-by: Hongxin Liang <[email protected]>
@honnix honnix marked this pull request as ready for review September 29, 2023 18:42
@honnix honnix changed the title Fetch task template Fetch task template in dynamic workflow task Oct 2, 2023
@honnix honnix requested a review from andresgomezfrr October 2, 2023 07:07
@andresgomezfrr andresgomezfrr merged commit 66efab8 into master Oct 2, 2023
3 checks passed
@andresgomezfrr andresgomezfrr deleted the more-remoter branch October 2, 2023 08:35
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.

2 participants