Skip to content

[Fix-18672][UI] Allow SeaTunnel workflow tasks to select stream execution - #18673

Open
sunlishuo25 wants to merge 46 commits into
apache:devfrom
sunlishuo25:Fix-18672
Open

sunlishuo25 wants to merge 46 commits into
apache:devfrom
sunlishuo25:Fix-18672

Conversation

@sunlishuo25

@sunlishuo25 sunlishuo25 commented Oct 3, 2026 •

Copy link
Copy Markdown

Was this PR generated or assisted by AI?

YES. I found this issue myself. I used AI as an assistant to help write the code changes, and I manually reviewed and verified all of them.

Purpose of the pull request

Fixes #18672.

A SeaTunnel task in a workflow is always saved as taskExecuteType=BATCH, and the form gives no way to choose Stream, so a streaming SeaTunnel job can never appear under Task Instance -> Stream Task. This PR adds an explicit Batch/Stream choice to the SeaTunnel form. Batch stays the default, including for existing definitions.

The backend already persists taskExecuteType and copies it to task instances, so no backend change is needed.

Brief change log

  • SeaTunnel form: add a Batch/Stream radio bound to the existing taskExecuteType field.
  • useTask: keep the saved taskExecuteType when an existing task is reopened.
  • Task modal (detail-modal.tsx): clear the saved taskExecuteType when the task type changes, so the new task type starts from its own default.
  • DAG: carry each task's execution type through loading, copying and editing, and update the dashed edge style when it changes.
  • editTask now edits a copy of the task definition, so changes made in the modal (e.g. task type) are discarded on Cancel instead of leaking into the definition.
  • Stream task instance list: disable the savepoint action for SeaTunnel, which does not implement StreamTask. Flink savepoint is unchanged.
  • E2E: add SeaTunnelTaskE2ETest (under cases/tasks, following the existing page object structure) with real SeaTunnel and Flink fixtures, and register it in the E2E matrix. Shared page objects that no longer matched the current UI are fixed, and the DAG format button gets the graph-format class that WorkflowForm already uses to locate it.
  • Docs: describe the option in the English and Chinese SeaTunnel task docs.

Verify this pull request

SeaTunnelTaskE2ETest covers, in six focused scenarios:

  • Batch default, Cancel/Save, and persistence after reopening the workflow.
  • Copying a STREAM task keeps STREAM.
  • Edge style switches between solid and dashed with BATCH/STREAM.
  • A real BATCH run succeeds and is listed only under Batch Task.
  • A real STREAM run is listed only under Stream Task, its savepoint action is disabled, and it can be stopped from the UI.
  • A real local-mode FLINK_STREAM SQL job is listed under Stream Task and keeps its savepoint action enabled.

The official workflows passed on my fork (ubuntu-latest, AMD64): E2E for 64e5cac (all 24 jobs; SeaTunnelTaskE2ETest ran 6 tests with 0 failures in about 10 minutes, well within the 30-minute limit), and Backend, Frontend, Test, API-Test, E2E-K8S and CodeQL for 7713eb1. The commits after 7713eb1 only change E2E test code.

Pull Request Notice

Pull Request Notice

@boring-cyborg

boring-cyborg Bot commented Oct 3, 2026

Copy link
Copy Markdown

Thanks for opening this pull request! Please check out our contributing guidelines. (https://github.com/apache/dolphinscheduler/blob/dev/docs/docs/en/contribute/join/pull-request.md)

@github-actions github-actions Bot added UI ui and front end related test e2e e2e test document labels Oct 3, 2026
@github-actions github-actions Bot added the CI&CD label Oct 3, 2026
@sunlishuo25
sunlishuo25 marked this pull request as ready for review October 3, 2026 02:31
@sunlishuo25
sunlishuo25 requested a review from SbloodyS as a code owner October 3, 2026 02:31
sunlishuo25 and others added 5 commits October 3, 2026 14:06
Discard the previous task's stored execution mode only when its task type
changes, so the new type uses the existing defaults. Preserve SeaTunnel's
explicit mode when the type is unchanged and when a definition is reopened.

Add focused source checks for task type transitions, mode preservation,
custom/resource configuration round trips, and legacy defaults.
@SbloodyS SbloodyS added the first time contributor First-time contributor label Oct 5, 2026
@SbloodyS SbloodyS added this to the 3.5.0 milestone Oct 6, 2026
@SbloodyS SbloodyS added the bug Something isn't working label Oct 6, 2026

@SbloodyS SbloodyS left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The new E2E covers execution-type selection and save/reload, but leaves several changed paths untested.

Please add regression coverage for copying a STREAM SeaTunnel task, updating connected-edge styling when switching between BATCH and STREAM, and disabling SeaTunnel savepoint while keeping Flink savepoint enabled.

The test also never executes the workflow or checks the Stream Task instance list, so it does not verify the instance-classification outcome described in the PR.

sunlishuo25 and others added 6 commits October 12, 2026 20:11
Keep a task query pending while its table is visibly loading instead of repeatedly refreshing it. Read the task state before sampling the current table class, avoiding a loading-selector lookup that could wait for the next poll. Preserve prompt business assertions and the existing120-second/500ms wait.
Locate this case's exact task operation cell under the existing Batch and Stream row boundaries. Preserve the original native retry and ten-second completion wait, and check the visible Log completion after each successful click in the same iteration.

Keep shared page helpers, Stop, workflow assertions and engine waits unchanged.

@SbloodyS SbloodyS left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

WorkflowSeaTunnelE2ETest failed. Please fix it. @sunlishuo25

Give the SeaTunnel case a 90-minute budget while retaining 30 minutes for other
cases. Bound both pinned fixture downloads and confirm project creation with
native Enter, preserving the existing business assertions.
@sunlishuo25

sunlishuo25 commented Oct 13, 2026 •

Copy link
Copy Markdown
Author

@SbloodyS I ran the full WorkflowSeaTunnelE2ETest locally, and it passed on Linux ARM64 with the default application and SeaTunnel heap settings: 1 test, 0 failures, 0 errors, 0 skipped. I've attached the test report, relevant logs, and recording.

DolphinScheduler-18673-complete-evidence.zip

Comment thread .github/workflows/e2e.yml Outdated
needs: build
runs-on: ubuntu-latest
timeout-minutes: 30
timeout-minutes: ${{ matrix.case.name == 'WorkflowSeaTunnelE2ETest' && 90 || 30 }}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

All e2e tests need to be completed within 30 minutes. Please optimize the implementation.

@sunlishuo25

Copy link
Copy Markdown
Author

@SbloodyS I've restored the 30-minute timeout and fixed the E2E UI interactions. Both WorkflowSwitchE2ETest and WorkflowSeaTunnelE2ETest passed locally on Linux ARM64 with the default application and SeaTunnel heap settings. The test reports, logs, and recordings are attached in one ZIP.

pr-18673-local-e2e-evidence.zip

public final class SwitchTaskForm extends TaskNodeForm {

@FindBy(id = "btnAddIfBranch")
static final String NODE_MODAL = "//div[contains(concat(' ', normalize-space(@class), ' '), ' n-modal ')"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please don't modify irrelevant code in all places.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Removed the unrelated changes and pushed the update. The local SeaTunnel E2E test passed; CI is awaiting approval.

- Remove dolphinscheduler-ui/tests/*.cjs, which no workflow runs.
- Replace the JavaScript scrollIntoView in SeaTunnelTaskForm with native WebDriver wheel actions.
- Run the BATCH job before the STREAM job and drop the extra shell workflows that tracked engine PIDs.
- Assert that the savepoint action is disabled for the SeaTunnel stream instance.
@sunlishuo25

Copy link
Copy Markdown
Author

@SbloodyS I've cleaned up the PR in 850ce3e:

  • Removed the unused dolphinscheduler-ui/tests/*.cjs scripts.
  • Replaced the JavaScript scrollIntoView in SeaTunnelTaskForm with native WebDriver actions.
  • Simplified WorkflowSeaTunnelE2ETest: the BATCH job now runs before the STREAM job, so the extra shell workflows that tracked engine PIDs are gone. It also asserts that the savepoint action is disabled for SeaTunnel.

The same commit passed the official E2E workflow on my fork: WorkflowSeaTunnelE2ETest (1 test, 0 failures, ~7 min on AMD64), and all 24 E2E jobs were green.

Run a real local-mode FLINK_STREAM SQL job in WorkflowSeaTunnelE2ETest and assert that its savepoint action
stays enabled in the Stream task instance list, alongside the disabled SeaTunnel savepoint. The fixture now
installs Flink 1.20.3.
# Conflicts:
#	dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/project/workflow/WorkflowForm.java
Wait for the shared data-modal-ready marker instead of Naive UI transition classes, click modal controls through
UiInteraction, and enter the SeaTunnel script through CodeEditor. The Flink SQL form keeps keyboard input because
its initialization script editor is visible alongside the script editor.

@SbloodyS SbloodyS left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please resolves conflicts.

@sunlishuo25

Copy link
Copy Markdown
Author

@SbloodyS I've resolved the conflicts by merging the latest dev, keeping the waits added in #18715 and only passing this test's drop coordinates through addTask. The SeaTunnel E2E now follows the helpers from #18715: it waits for data-modal-ready, clicks modal controls through UiInteraction, and enters the SeaTunnel script through CodeEditor.

This update also covers your earlier request to keep Flink savepoint enabled. WorkflowSeaTunnelE2ETest now runs a real local-mode FLINK_STREAM SQL job (datagen to print) on Flink 1.20.3, checks real print-sink rows in the task log, and asserts that its savepoint action stays enabled while SeaTunnel's is disabled.

On my fork, the E2E workflow for this commit passed: all 24 jobs after re-running one unrelated job whose Docker Compose environment failed to start. Backend, Frontend, Test, API-Test, E2E-K8S and CodeQL passed as well.

@SbloodyS SbloodyS left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please refactor this E2E test to follow the project's existing Page Object Model and test structure.

Reuse the existing Page Objects for project navigation, task configuration, submission, and workflow execution. If an existing interaction needs improvement, fix it in the corresponding Page Object instead of adding a separate implementation inside WorkflowSeaTunnelE2ETest.

Please also consolidate overlapping node lookup/opening logic, reduce unnecessary helper methods, and keep changes to shared helpers such as addTask and dragAndDrop.js limited to demonstrated needs. Split the long test into focused scenarios with explicit setup dependencies, while preserving the real SeaTunnel/Flink execution and regression assertions.


@SneakyThrows
@SuppressWarnings("unchecked")
public <T> T addTask(TaskType type, Integer x, Integer y) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Remove unnessnary changes.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Removed the overload and restored dragAndDrop.js to dev. The test now lays out the dropped nodes with the existing formatDAG() instead of passing drop coordinates; I fixed formatDAG() / WorkflowFormatDialog because they no longer matched the current UI (details in my review reply).

- Move the test to cases/tasks/SeaTunnelTaskE2ETest, extend BaseWorkflowE2ETest and split it into focused
  scenarios that keep the real SeaTunnel and Flink runs and all regression assertions.
- Remove the addTask coordinate overload and restore dragAndDrop.js; lay out nodes with formatDAG instead.
- Fix the existing page objects instead of adding test-local helpers: preTask, the DAG format dialog,
  exact task lookup in getTask, CodeEditor reading, workflow editing and task instance logs.
- Add the graph-format class that WorkflowForm already uses to locate the DAG format button.
@sunlishuo25

sunlishuo25 commented Oct 17, 2026 •

Copy link
Copy Markdown
Author

@SbloodyS Thanks for the review. I've refactored the test to use the existing page objects: it is now cases/tasks/SeaTunnelTaskE2ETest, extends BaseWorkflowE2ETest, and is split into six @Order scenarios that only depend on @BeforeAll (except that the STREAM scenario reuses the BATCH run as evidence that the Batch list has loaded). The real SeaTunnel/Flink runs and all regression assertions are kept. The addTask(type, x, y) overload and the dragAndDrop.js change are removed. All 24 E2E jobs pass on my fork: run.

Where the existing page objects failed, and the fix:

  1. WorkflowSaveDialog.submit(): failed in testCopiedStreamTaskKeepsExecutionType when saving an existing workflow, with ElementClickInterceptedException on the submit button, because it clicks while the dialog is still opening (job). It now clicks through UiInteraction, as in [Improvement-18712][E2E] Fix flaky e2e test #18715.
  2. WorkflowForm.getTask(): failed in testEdgeStyleFollowsExecutionType. After formatDAG(), the node was outside the scrolled canvas, so the double-click missed it and the task modal never opened (job). It now scrolls the node into view first, and matches the exact title so a copied task is not mistaken for its source.
  3. WorkflowForm.formatDAG(), WorkflowFormatDialog.confirm() and TaskNodeForm.preTask(): these look for graph-format, el-dialog__wrapper / el-button--primary and option-pre-tasks, none of which exist in the current UI, so they cannot work. Their only user, WorkflowSwitchE2ETest, is disabled. I added graph-format to the format button (the only production change, the same way as btn-save) and moved the dialog and preTask to UiInteraction.

The other page object additions are new methods the scenarios need.

CI runs on my fork:

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working CI&CD document e2e e2e test first time contributor First-time contributor test UI ui and front end related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug][UI] SeaTunnel workflow tasks cannot select stream execution type

3 participants