Skip to content

[#603][7] Add navigation panel component and execute workflow service - #622

Merged
zuozhiw merged 30 commits into
masterfrom
new-gui-execute-workflow
Jun 21, 2018
Merged

zuozhiw merged 30 commits into
masterfrom
new-gui-execute-workflow

Conversation

@henrychen0220

@henrychen0220 henrychen0220 commented Jun 12, 2018 •

Copy link
Copy Markdown
Contributor

This PR adds the workflow execution functionality to the New GUI.

A new ExecuteWorkflowService is introduced to convert the frontend formatted graph into backend API formatted graph and send a Http post request to the backend to request the workflow result.

Whenever other Components want to fetch the current workflow and execute the workflow, they need to call executeWorkflow() method in ExecuteWorkflowService.

Components and Services should call getExecuteStartStream() method and subscribe to the Observable returned by this method to capture the moment when workflow graph begins execution.

Similarly, Components and Services should call getExecuteEndStream() method and subscribe to the Observable to capture the final result of executing the workflow, either some results or errors.

This PR also introduces new WorkflowGraph interface of the backend, which is used during the transformation of frontend workflow graph to backend workflow grpah.

LogicalLink represents each link in the workflow graph, with an ID of the origin operator and that of the destination operator.
LogicalOperator represents each operator in the graph. uniqueAttributes represent a list of different attributes that might be present of different types of operators. The type is defined as string | number | boolean | object to cover all possible types in typescript except NULL and undefined.
LogicalPlan represents the workflow graph that will be sent to the backend.
SuccessExecutionResult represents the returned result structure if the workflow is executed correctly
ErrorExecutionResult represents the returned result structure if the workflow has encountered an error
ExecutionResult represents the structure of the returned result, can be either of type SuccessExecutionResult or ErrorExecutionResult.

The new navigation bar:
capture

The execution result (currently in console):
capture

This PR adds 9 new tests cases.

henrychen0220 and others added 26 commits May 30, 2018 23:07
…button to the navigation component for execution
…ired imports to all the new test files, create a stub execute-workflow service to prevent sending http request during test time
…ange all the 'Object' type to non-primitive type 'object'
…re comments to both navigation component and execution workflow service
@henrychen0220
henrychen0220 requested review from avinash0161 and zuozhiw and removed request for zuozhiw June 12, 2018 07:46
console.log(errorResponse);

// error shown to the user in different error scenarios
const displayedErrorMessage = ExecuteWorkflowService.processErrorResponse(errorResponse);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why invoke class name and then call function? In rest of the code, local function is directly called.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

that's calling a static function, similar to Java

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

When a function does not involve touching a class member, I prefer it to be a static function.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think you misunderstood...I was saying that the function is being called in its own class... So, the class name is optional (whether function is static or non-static)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It's not optional in Typescript

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

oh...then it's ok

const workflowPlan = this.workflowActionService.getTexeraGraph();

// create a Logical Plan based on the workflow graph
const body = ExecuteWorkflowService.getLogicalPlanRequest(workflowPlan);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why invoke class name and then call function? In rest of the code, local function is directly called.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same as above

*/
public static getLogicalPlanRequest(workflowGraph: WorkflowGraphReadonly): LogicalPlan {

const operators: LogicalOperator[] = workflowGraph

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

For data members, as per my discussion with Zuozhi, type is not mandatory. @zuozhiw is it required here? And also check the const links data member below.

@zuozhiw zuozhiw Jun 21, 2018 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In short it's not required here, but it's good to write the type explicitly in this case. It's more complicated to explain:

Here's a simpler example to illustrate this issue. Here we define an interface A has to members, a and b.

interface A {
  a: number,
  b: number
}

We have a list originalList, we want to construct a listOfA by applying some mapper function:

const listOfA = originalList.map(item => {a: item.a, b: item.b});

We let TS infer that the type of listOfA could be A[], however, consider what if we write the mapper function incorrectly:

const listOfA = originalList.map(item => {a: item.a});

Here we forgot the item b, although we still name the variable listOfA, we know that it no longer has type we wanted A[], so in this case, it's better to write with type declaration, so that we can make sure the variable indeed has the type we wanted

// error
const listOfA: A[] = originalList.map(item => {a: item.a});

@avinash0161 avinash0161 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please check a few minor comments that I gave.

@zuozhiw zuozhiw left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I have discussed this Pull Request with Henry f2f about the code.
I have reviewed the testing coverage and it looks good.
I added some more documentation to the code and approved this PR.

Note: as the comments in the code said, the console log statements in this PR should be removed in subsequent PRs.

@zuozhiw
zuozhiw merged commit 6c0a9be into master Jun 21, 2018
@zuozhiw
zuozhiw deleted the new-gui-execute-workflow branch June 21, 2018 08:14
Yicong-Huang added a commit that referenced this pull request Jul 5, 2026
### What changes were proposed in this PR?

Patch-level alignment of all Angular packages in `frontend/`, across the
two Angular release lines:

| Line | Packages | Before | After |
| --- | --- | --- | --- |
| CLI toolchain | `@angular/cli`, `@angular-devkit/build-angular`,
`@angular-devkit/core`, `@angular-devkit/schematics`,
`@schematics/angular` | 21.2.8 | 21.2.18 |
| Framework | `@angular/{core,common,compiler,compiler-cli,localize}` |
21.2.17 | 21.2.17 (unchanged) |
| Framework |
`@angular/{animations,forms,router,platform-browser,platform-browser-dynamic}`
| 21.2.10 | 21.2.17 |
| CDK | `@angular/cdk` | 21.2.8 | 21.2.14 |

(The framework line has no 21.2.18 — 21.2.17 is its latest; CLI and
framework version independently.)

The toolchain bump is security-motivated: 21.2.8 exact-pins several
build-time dependencies with open advisories, which a plain lockfile
refresh cannot move. 21.2.18 re-pins them all to patched versions:

| Pinned dep | Before | After | Dependabot alerts resolved |
| --- | --- | --- | --- |
| undici | 7.24.4 | 7.28.0 |
[#617](https://github.com/apache/texera/security/dependabot/617) (high),
[#614](https://github.com/apache/texera/security/dependabot/614) (high),
[#621](https://github.com/apache/texera/security/dependabot/621),
[#613](https://github.com/apache/texera/security/dependabot/613),
[#623](https://github.com/apache/texera/security/dependabot/623),
[#616](https://github.com/apache/texera/security/dependabot/616) |
| vite | 7.3.2 | 7.3.6 |
[#591](https://github.com/apache/texera/security/dependabot/591) (high),
[#594](https://github.com/apache/texera/security/dependabot/594) |
| piscina | 5.1.4 | 5.2.0 |
[#610](https://github.com/apache/texera/security/dependabot/610) (high)
|
| webpack-dev-server | 5.2.3 | 5.2.5 |
[#609](https://github.com/apache/texera/security/dependabot/609),
[#518](https://github.com/apache/texera/security/dependabot/518) |
| esbuild | 0.27.3 | 0.28.1 |
[#555](https://github.com/apache/texera/security/dependabot/555) |
| postcss | 8.5.6 | 8.5.12 |
[#474](https://github.com/apache/texera/security/dependabot/474) |

13 alerts total (4 high). Not covered here (separate lockfile copies of
the same packages, planned as a follow-up refresh): undici `^6.25.0`
([#622](https://github.com/apache/texera/security/dependabot/622),
[#620](https://github.com/apache/texera/security/dependabot/620),
[#615](https://github.com/apache/texera/security/dependabot/615)) and
vite 8.x
([#593](https://github.com/apache/texera/security/dependabot/593),
[#590](https://github.com/apache/texera/security/dependabot/590)).

The framework/CDK alignment additionally clears the `YN0060`
incorrect-peer-dependency warnings printed on every `yarn install` (the
tree previously mixed 21.2.10 and 21.2.17).

Diff is `frontend/package.json` + the corresponding `yarn.lock`
re-resolution; no config or code changes.

### Any related issues, documentation, discussions?

Closes #6154

### How was this PR tested?

Existing test cases; no behavior change expected.

- `yarn build` (production `ng build`) — succeeds, only pre-existing
CommonJS warnings.
- `yarn test:ci` — all suites pass (`NX Successfully ran target test for
project gui`).

Both were run after each of the two commits (toolchain bump;
framework/CDK alignment).

### Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Claude Fable 5)

---------

(backported from commit fd79073)

Co-authored-by: Claude Fable 5 <[email protected]>
aglinxinyuan pushed a commit to aglinxinyuan/texera that referenced this pull request Jul 5, 2026
…#6155)

### What changes were proposed in this PR?

Patch-level alignment of all Angular packages in `frontend/`, across the
two Angular release lines:

| Line | Packages | Before | After |
| --- | --- | --- | --- |
| CLI toolchain | `@angular/cli`, `@angular-devkit/build-angular`,
`@angular-devkit/core`, `@angular-devkit/schematics`,
`@schematics/angular` | 21.2.8 | 21.2.18 |
| Framework | `@angular/{core,common,compiler,compiler-cli,localize}` |
21.2.17 | 21.2.17 (unchanged) |
| Framework |
`@angular/{animations,forms,router,platform-browser,platform-browser-dynamic}`
| 21.2.10 | 21.2.17 |
| CDK | `@angular/cdk` | 21.2.8 | 21.2.14 |

(The framework line has no 21.2.18 — 21.2.17 is its latest; CLI and
framework version independently.)

The toolchain bump is security-motivated: 21.2.8 exact-pins several
build-time dependencies with open advisories, which a plain lockfile
refresh cannot move. 21.2.18 re-pins them all to patched versions:

| Pinned dep | Before | After | Dependabot alerts resolved |
| --- | --- | --- | --- |
| undici | 7.24.4 | 7.28.0 |
[apache#617](https://github.com/apache/texera/security/dependabot/617) (high),
[apache#614](https://github.com/apache/texera/security/dependabot/614) (high),
[apache#621](https://github.com/apache/texera/security/dependabot/621),
[apache#613](https://github.com/apache/texera/security/dependabot/613),
[apache#623](https://github.com/apache/texera/security/dependabot/623),
[apache#616](https://github.com/apache/texera/security/dependabot/616) |
| vite | 7.3.2 | 7.3.6 |
[apache#591](https://github.com/apache/texera/security/dependabot/591) (high),
[apache#594](https://github.com/apache/texera/security/dependabot/594) |
| piscina | 5.1.4 | 5.2.0 |
[apache#610](https://github.com/apache/texera/security/dependabot/610) (high)
|
| webpack-dev-server | 5.2.3 | 5.2.5 |
[apache#609](https://github.com/apache/texera/security/dependabot/609),
[apache#518](https://github.com/apache/texera/security/dependabot/518) |
| esbuild | 0.27.3 | 0.28.1 |
[apache#555](https://github.com/apache/texera/security/dependabot/555) |
| postcss | 8.5.6 | 8.5.12 |
[apache#474](https://github.com/apache/texera/security/dependabot/474) |

13 alerts total (4 high). Not covered here (separate lockfile copies of
the same packages, planned as a follow-up refresh): undici `^6.25.0`
([apache#622](https://github.com/apache/texera/security/dependabot/622),
[apache#620](https://github.com/apache/texera/security/dependabot/620),
[apache#615](https://github.com/apache/texera/security/dependabot/615)) and
vite 8.x
([apache#593](https://github.com/apache/texera/security/dependabot/593),
[apache#590](https://github.com/apache/texera/security/dependabot/590)).

The framework/CDK alignment additionally clears the `YN0060`
incorrect-peer-dependency warnings printed on every `yarn install` (the
tree previously mixed 21.2.10 and 21.2.17).

Diff is `frontend/package.json` + the corresponding `yarn.lock`
re-resolution; no config or code changes.

### Any related issues, documentation, discussions?

Closes apache#6154

### How was this PR tested?

Existing test cases; no behavior change expected.

- `yarn build` (production `ng build`) — succeeds, only pre-existing
CommonJS warnings.
- `yarn test:ci` — all suites pass (`NX Successfully ran target test for
project gui`).

Both were run after each of the two commits (toolchain bump;
framework/CDK alignment).

### Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Claude Fable 5)

---------

Co-authored-by: Claude Fable 5 <[email protected]>
renovate-bot pushed a commit to renovate-bot/apache-_-texera that referenced this pull request Oct 8, 2026
…#8896)

### What changes were proposed in this PR?

Removes three exported REST endpoint constants from
`execute-workflow.service.ts` that nothing imports:
`EXECUTE_WORKFLOW_ENDPOINT`, `PAUSE_WORKFLOW_ENDPOINT` and
`RESUME_WORKFLOW_ENDPOINT`. **−5 lines.** There is no behaviour change.
Execute, pause and resume are sent over the websocket
(`WorkflowExecuteRequest` / `WorkflowPauseRequest` /
`WorkflowResumeRequest`), and the backend has no `queryplan/execute`,
`pause` or `resume` REST routes.

### History

| | |
| --- | --- |
| **Introduced by** | apache#622 (2018-06-21), the first execute-workflow
service: `EXECUTE_WORKFLOW_ENDPOINT`. apache#684 (2019-03-10), pause/resume
buttons: the other two |
| **Usage removed by** | apache#811 (2020-08-21), the Amber merge, which moved
pause/resume to websocket requests and removed their `http.post` calls.
apache#982 (2021-01-25), "Improves multiple ports support in Texera operators
(Step 4)", which removed the last REST execute call |

The pause/resume constants have been unused for six years, and the
execute one for nearly five.

### Any related issues, documentation, discussions?

Closes apache#8895

### How was this PR tested?

No new tests; no spec imported the constants.

From `frontend/`:

- `npx ng test --watch=false`, covering
`execute-workflow.service.spec.ts` plus all 17 specs that import the
service (18 files): 1363 tests pass, 1 is skipped (an existing
`it.skip`).
- `yarn format:ci`: clean.
- `npx ng build`: success.

To re-check:

```
git grep -n -w -E "EXECUTE_WORKFLOW_ENDPOINT|PAUSE_WORKFLOW_ENDPOINT|RESUME_WORKFLOW_ENDPOINT"   # no hits
```

### Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Claude Opus 5.5)

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.

3 participants