Skip to content

Introduce execution snapshot - #1634

Merged
sadeemsaleh merged 48 commits into
masterfrom
charles-snapshot-execution
Oct 5, 2022
Merged

sadeemsaleh merged 48 commits into
masterfrom
charles-snapshot-execution

Conversation

@liqinye

@liqinye liqinye commented Aug 19, 2022 •

Copy link
Copy Markdown
Contributor
  • fix the corner case when the version is not important, and there are executions yet the snapshot gets deleted but it is the first. This is caused because the developer assumed the previous executions should always have a snapshot.

This PR fixes #1562 it enables users to view the snapshot of the execution in execution table. We introduce workflow-snapshot table in sql to store every execution's snapshot.
For now, an execution's snapshot will only be updated if there are addition/removal of operators. Changes such as reset operator properties or move the operator around won't trigger the update of execution snapshot.
The database schema has changed -- a new column "sid" is added to the table workflow_execution. The corresponding ALTER TABLE command is: ALTER TABLE workflow_executions ADD COLUMN sid INT UNSIGNED NOT NULL references workflow_snapshot(sid);.
-- a new table is created workflow_snapshot. The corresponding CREATE TABLE command is:

CREATE TABLE IF NOT EXISTS workflow_snapshot
(
    `sid`             INT UNSIGNED AUTO_INCREMENT NOT NULL,
    `wid`             INT UNSIGNED NOT NULL,
    `snapshot`        MEDIUMBLOB,
    PRIMARY KEY (`sid`)
) ENGINE = INNODB;

snapshot

TODO: Suppose there is a snapshot A, if the last execution that is associated with snapshot A is deleted from the database, currently the snapshot A would still be in the database instead of being deleted simultaneously. In the future, this problem can be fixed by introducing Trigger in SQL.

Liqin Ye added 19 commits July 13, 2022 22:20
@liqinye liqinye added feature gui ddl-change Changes to the TexeraDB DDL labels Aug 19, 2022
@liqinye
liqinye requested a review from sadeemsaleh August 19, 2022 21:25
@liqinye liqinye self-assigned this Aug 19, 2022
@sadeemsaleh

Copy link
Copy Markdown
Contributor

Looks nice, I haven't looked at the code yet but from the review I see the sort icon is there, can we disable it for the snapshot column

@sadeemsaleh sadeemsaleh 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.

looks very nice, left minor comments

Comment thread core/new-gui/yarn.lock Resolved

@sadeemsaleh sadeemsaleh 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 address comments

Liqin Ye and others added 11 commits September 4, 2022 15:34
# Conflicts:
#	core/new-gui/src/app/app.module.ts
# Conflicts:
#	core/amber/src/main/scala/edu/uci/ics/texera/web/model/jooq/generated/Indexes.java
#	core/amber/src/main/scala/edu/uci/ics/texera/web/model/jooq/generated/Keys.java
#	core/amber/src/main/scala/edu/uci/ics/texera/web/model/jooq/generated/tables/WorkflowExecutions.java
#	core/amber/src/main/scala/edu/uci/ics/texera/web/model/jooq/generated/tables/daos/WorkflowExecutionsDao.java
#	core/amber/src/main/scala/edu/uci/ics/texera/web/model/jooq/generated/tables/interfaces/IWorkflowExecutions.java
#	core/amber/src/main/scala/edu/uci/ics/texera/web/model/jooq/generated/tables/pojos/WorkflowExecutions.java
#	core/amber/src/main/scala/edu/uci/ics/texera/web/model/jooq/generated/tables/records/WorkflowExecutionsRecord.java
#	core/new-gui/src/app/workspace/service/execute-workflow/execute-workflow.service.spec.ts
#	core/new-gui/src/app/workspace/service/execute-workflow/execute-workflow.service.ts
@sadeemsaleh
sadeemsaleh merged commit fa3e8c5 into master Oct 5, 2022
@sadeemsaleh
sadeemsaleh deleted the charles-snapshot-execution branch October 5, 2022 01:26
@Yicong-Huang Yicong-Huang added frontend Changes related to the frontend GUI and removed gui labels Jul 6, 2025
yangzhang75 pushed a commit to yangzhang75/texera that referenced this pull request Jun 22, 2026
- [x] fix the corner case when the version is not important, and there are executions yet the snapshot gets deleted but it is the first. This is caused because the developer assumed the previous executions should always have a snapshot.

This PR fixes apache#1562 it enables users to view the snapshot of the execution in execution table. We introduce workflow-snapshot table in sql to store every execution's snapshot. 
For now, an execution's snapshot will only be updated if there are **addition/removal** of operators. Changes such as reset operator properties or move the operator around won't trigger the update of execution snapshot.
The database schema has changed -- a new column "sid" is added to the table workflow_execution. The corresponding ALTER TABLE command is: **`ALTER TABLE workflow_executions ADD COLUMN sid INT UNSIGNED NOT NULL references workflow_snapshot(sid);`**.
-- a new table is created workflow_snapshot. The corresponding CREATE TABLE command is: 
```
CREATE TABLE IF NOT EXISTS workflow_snapshot
(
    `sid`             INT UNSIGNED AUTO_INCREMENT NOT NULL,
    `wid`             INT UNSIGNED NOT NULL,
    `snapshot`        MEDIUMBLOB,
    PRIMARY KEY (`sid`)
) ENGINE = INNODB;
```

![snapshot](https://user-images.githubusercontent.com/69664190/185709192-020bceb9-4760-4702-9ef8-b2bfde6df06e.gif)

**TODO**: Suppose there is a snapshot A, if the last execution that is associated with snapshot A is deleted from the database, currently the snapshot A would still be in the database instead of being deleted simultaneously. In the future, this problem can be fixed by introducing Trigger in SQL.

Co-authored-by: Liqin Ye <[email protected]>
Co-authored-by: sadeem <[email protected]>
renovate-bot pushed a commit to renovate-bot/apache-_-texera that referenced this pull request Oct 5, 2026
### What changes were proposed in this PR?

Removes the leftovers of the execution-snapshot column from the workflow
execution-history modal. **−14 lines.** There is no behaviour change.

- **Styles:** the `.version-sample` and `.workflow-snapshot` rules in
`workflow-execution-history.component.scss`. Nothing uses either class:
the template has no static or dynamic use, the component uses emulated
encapsulation, and no other stylesheet or `::ng-deep` relies on them.
- **Column width:** the `"Workflow Version Sample"` entry in
`customColumnWidth`. `executionsTableHeaders` no longer lists that
column, so the template's `customColumnWidth[column]` lookup never reads
the key.

### History

| | |
| --- | --- |
| **Introduced by** | apache#1634 (2022-10-04), "Introduce execution
snapshot". It added a "Workflow Version Sample" column showing a
snapshot per execution, styled by these classes and sized by this width
entry |
| **Usage removed by** | apache#1695 (2022-10-18), "Remove snapshot feature
and fix version pagination". It deleted the column header and the markup
that used both classes, but kept the rules and the width entry |

They have been dead for nearly four years.

### Any related issues, documentation, discussions?

Closes apache#8836

### How was this PR tested?

No new tests; no spec referenced any of them.

From `frontend/`:

- `npx ng test --watch=false
--include='**/workflow-execution-history.component.spec.ts'
--include='**/admin-execution.component.spec.ts'
--include='**/left-panel.component.spec.ts'`: 3 files, 138 tests, all
pass. The last two specs cover the components that host this modal.
- `yarn format:ci`: clean.
- `npx ng build`: success.

To re-check:

```
git grep -n -E "version-sample|workflow-snapshot|Version Sample" -- frontend   # 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)
renovate-bot pushed a commit to renovate-bot/apache-_-texera that referenced this pull request Nov 25, 2026
…9644)

### What changes were proposed in this PR?

Remove unused and inert SCSS rules, an empty component stylesheet,
unread callback and lifecycle parameters, and a duplicate module import
across the Angular frontend (**+13/-134 lines**). There is no observable
UI or runtime behavior change.

- **Detail-page SCSS selectors:** Remove unmatched `.file-title`,
`.file-size`, `.versions-tab-content`, `nz-layout`, `html, body`,
`.grayed-out`, `.disabled-click`, and `.ant-collapse-content-box` rules
from `DatasetDetailComponent` SCSS, and unmatched
`.versions-tab-content` and `nz-layout` rules from
`ModelDetailComponent` SCSS. Both components use Angular's default
`ViewEncapsulation.Emulated`, `apache#8942` moved the version browser markup
and styles to `VersionsFilesBrowserComponent`, and zero matching
elements remain in either component template.
- **Unused and inert cross-component SCSS rules:** Remove unmatched
`#googleButton`, `.hidden` (dashboard and hub templates use HTML
`hidden` / `[hidden]` / `aria-hidden` attributes rather than a CSS
class), unused Sass variable `$dashboard-navigation-height`,
`.uploaded-files-list`, empty `.file-uploader-banner {}`,
`.dataset-menu-bar`, `.condition-input-popup.fade-out`, and
`.ai-fix-field` (zero template or TypeScript references in
`frontend/src`), along with the `opacity: 1` and `transition: opacity 1s
ease-in-out` declarations on `.condition-input-popup` that only existed
to animate `.fade-out`. Remove emulated `.ant-table-thead > tr > th` and
`.ant-table` rules in `WorkflowExecutionHistoryComponent` SCSS (default
`ViewEncapsulation.Emulated` scopes them to host attributes that cannot
match `nz-table` internal DOM without `::ng-deep`), remove obsolete
`.ant-collapse-content-box` overrides in global `styles.scss`
(`ng-zorro-antd` 21 emits `.ant-collapse-body` with zero
`.ant-collapse-content-box` occurrences), and delete the empty
license-only `hub.component.scss` along with its `styleUrls` entry in
`HubComponent`.
- **Unread subscriber callback parameters:** Drop six unread `(res:
Response)` and `(err: unknown)` parameters in `DatasetDetailComponent`
(`onPublicStatusChange`, `onDownloadableStatusChange`, and
`onPreviouslyUploadedFileDeleted`) that were never read in their
callback bodies.
- **Unread lifecycle parameter and import:** Drop the unread `changes:
SimpleChanges` parameter and orphaned `SimpleChanges` import in
`BrowseSectionComponent.ngOnChanges`, along with two placeholder `{} as
any` arguments in `browse-section.component.spec.ts`.
- **Duplicate module import:** Merge the duplicate `import` from
`ui-udf-parameters-parser.service` in `UiUdfParametersComponent` into
the existing import block from the same module.

| Event | PR / Commit |
| --- | --- |
| Introduced by | Detail SCSS: apache#2413 (2024-02-26), apache#2927 (2024-10-14),
apache#4928 (2026-05-04), apache#7043 (2026-07-30), apache#6953 (2026-08-03), apache#8072
(2026-08-28); other SCSS and empty `hub.component.scss`: apache#1634
(2022-10-04), apache#2413 (2024-02-26), apache#2435 (2024-03-17), apache#2502
(2024-03-27), apache#2571 (2024-04-05), apache#2737 (2024-07-15), apache#2776
(2024-08-19), apache#2878 (2024-09-27), apache#2953 (2024-10-25), apache#3415
(2025-05-03), apache#4484 (2026-05-01), apache#8637 (2026-10-28); unread parameters
and duplicate import: apache#2515 (2024-03-27), apache#3296 (2025-03-10), apache#3363
(2025-04-10), apache#3663 (2025-08-16), apache#6897 (2026-09-21, duplicating apache#7551
from 2026-08-13) |
| Usage removed by | Detail version styles: apache#8942 (2026-10-10,
`refactor(frontend): extract shared VersionsFilesBrowser component`);
`.ant-collapse-content-box`: apache#5895 (2026-06-22, `chore: upgrade
ng-zorro-antd to 21.3.1`); remaining selectors, empty
`hub.component.scss`, unread parameters, and duplicate import: unused or
inert since introduction or prior UI refactors |

As of 2026-11-23, the `.ai-fix-field` rule has been unused for about 4
weeks, the orphaned detail-page version styles for 6 weeks, the
duplicate import for 2 months, the obsolete `.ant-collapse-content-box`
rules for 5 months, and the remaining rules and unread parameters for 15
to 49 months.

### Any related issues, documentation, discussions?

Closes apache#9643.

### How was this PR tested?

Ran in `frontend/` on `ff6361f2ea` (Node 24, `node
.yarn/releases/yarn-4.14.1.cjs install --immutable --inline-builds`):

```bash
node .yarn/releases/yarn-4.14.1.cjs format:ci
node .yarn/releases/yarn-4.14.1.cjs exec tsc -p src/tsconfig.app.json --noEmit
node .yarn/releases/yarn-4.14.1.cjs exec tsc -p src/tsconfig.spec.json --noEmit
node .yarn/releases/yarn-4.14.1.cjs build
node .yarn/releases/yarn-4.14.1.cjs test
```

- `format:ci` (`prettier-eslint --list-different` and `eslint ./src`):
passed.
- `tsc --noEmit` (`src/tsconfig.app.json` and `src/tsconfig.spec.json`):
passed.
- `build` (production Angular AOT build): passed.
- `test` (Vitest, JUnit XML): `255` suites passed (`7,385` passed, `0`
failed, `0` errors, `1` pre-existing skipped in untouched
`operator-property-edit-frame.component.spec.ts`).

Review follow-up `aacada02e9` only removes the two inert declarations on
`.condition-input-popup`; it was checked locally with `prettier --check`
(3.2.5) and a `sass` (1.71.1) compile of the changed stylesheet, and CI
runs the full build and tests on the new head.

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

Generated-by: Antigravity (Gemini 4 Neon)
Generated-by: Claude Code (Opus 5.5), review follow-up `aacada02e9`

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ddl-change Changes to the TexeraDB DDL feature frontend Changes related to the frontend GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Executions] Show a snapshot of the workflow version with the (differences colored)

4 participants