Skip to content

refactor(frontend): drop unused utils and obsolete types - #9256

Merged
aglinxinyuan merged 1 commit into
apache:mainfrom
aglinxinyuan:refactor/fe-dead-util-types
Nov 2, 2026
Merged

aglinxinyuan merged 1 commit into
apache:mainfrom
aglinxinyuan:refactor/fe-dead-util-types

Conversation

@aglinxinyuan

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Removes unreferenced utility functions, dead assertions, and obsolete websocket types in rontend:

  • rontend/src/app/common/util/storage.ts & storage.spec.ts:
    • Drops localRemoveObject and sessionRemoveObject (-24 lines prod + spec) with zero call sites across the repository.
  • rontend/src/app/common/util/assert.ts & �ssert.spec.ts:
    • Drops obsolete assertion and type guard utilities �ssertType, isNull, isNotNull, and
      onNull (-101 lines prod + spec) with zero callers across the repository.
  • rontend/src/app/common/service/workflow-persist/stub-workflow-persist.service.ts:
    • Drops unused route constants WORKFLOW_BASE_URL and WORKFLOW_SEARCH_URL (-3 lines).
  • rontend/src/app/workspace/types/collab-websocket.interface.ts:
    • Drops orphaned interface file (-74 lines) with zero imports across the frontend.
  • rontend/src/app/workspace/types/workflow-websocket.interface.ts:
    • Drops ResultExportRequest and ResultExportResponse types and their entries in TexeraWebsocketRequestTypeMap and TexeraWebsocketEventTypeMap (-19 lines), which are HTTP REST models rather than websocket messages.

+3/-232 lines across 7 files. Pure refactoring with no behavior change.

Any related issues, documentation, discussions?

Closes #9255.

How was this PR tested?

  • Prettier check passed:
    �ash yarn prettier --check src/app/common/util/storage.ts src/app/common/util/storage.spec.ts src/app/common/util/assert.ts src/app/common/util/assert.spec.ts src/app/common/service/workflow-persist/stub-workflow-persist.service.ts src/app/workspace/types/workflow-websocket.interface.ts
  • Unit tests passed (20 tests, 2 test files):
    �ash yarn ng test --watch=false --include=src/app/common/util/storage.spec.ts --include=src/app/common/util/assert.spec.ts
  • Verified 0 callers repo-wide across the entire repository.

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

Generated-by: Antigravity 2.0

Copilot AI balanced review requested due to automatic review settings November 2, 2026 06:39

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@aglinxinyuan aglinxinyuan added refactor Refactor the code frontend Changes related to the frontend GUI labels Nov 2, 2026
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @Ma77Ball, @tanishqgandhi1908, @kz930
    You can notify them by mentioning @Ma77Ball, @tanishqgandhi1908, @kz930 in a comment.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.17%. Comparing base (05c19a4) to head (80150f5).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #9256      +/-   ##
============================================
- Coverage     92.17%   92.17%   -0.01%     
  Complexity     5043     5043              
============================================
  Files          1287     1287              
  Lines         55799    55788      -11     
  Branches       7144     7140       -4     
============================================
- Hits          51434    51423      -11     
  Misses         2598     2598              
  Partials       1767     1767              
Flag Coverage Δ *Carryforward flag
access-control-service 77.44% <ø> (ø) Carriedforward from 05c19a4
agent-service 99.54% <ø> (ø) Carriedforward from 05c19a4
amber 86.90% <ø> (ø) Carriedforward from 05c19a4
computing-unit-managing-service 64.02% <ø> (ø) Carriedforward from 05c19a4
config-service 87.61% <ø> (ø) Carriedforward from 05c19a4
file-service 82.29% <ø> (ø) Carriedforward from 05c19a4
frontend 96.47% <ø> (-0.01%) ⬇️
notebook-migration-service 83.77% <ø> (ø) Carriedforward from 05c19a4
pyamber 98.47% <ø> (ø) Carriedforward from 05c19a4
workflow-compiling-service 77.95% <ø> (ø) Carriedforward from 05c19a4

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

LGTM

@aglinxinyuan
aglinxinyuan added this pull request to the merge queue Nov 2, 2026
Merged via the queue into apache:main with commit 675167c Nov 2, 2026
30 of 36 checks passed
@aglinxinyuan
aglinxinyuan deleted the refactor/fe-dead-util-types branch November 2, 2026 22:07
renovate-bot pushed a commit to renovate-bot/apache-_-texera that referenced this pull request Nov 16, 2026
…#9435)

### What changes were proposed in this PR?

Clean up dead methods and helpers that remain unused in the latest
upstream `main` and were only referenced by their own specs, as tracked
in apache#9195:

1. **`UserConfigService.getDict()`** in
`frontend/src/app/common/service/user/config/user-config.service.ts`:
   - Removed the unread dictionary getter.
- Refactored `user-config.service.spec.ts` to preserve complete
behavioral coverage across fetch, set, delete, login, and logout using
observable behavior and public interfaces (verifying that `delete()`
issues an HTTP DELETE request only when the target key is present in the
local cache).
2. **`GuiConfigService.source()`** in
`frontend/src/app/common/service/gui-config.service.ts`:
- Removed uncalled `source(name: ConfigSource)` which was superseded by
memoized configuration getters (`env`).
   - Removed corresponding unit tests in `gui-config.service.spec.ts`.
3. **`assert()`** in `frontend/src/app/common/util/assert.ts`:
- Removed uncalled `assert()` function (`asType` and `isType` type
guards remain).
   - Removed corresponding unit tests in `assert.spec.ts`.

*(Note: Per maintainer confirmation on apache#9195, `dictionaryChangedSubject`
landed earlier in apache#8817 and `localRemoveObject`/`sessionRemoveObject`
landed earlier in apache#9256; those completed changes are untouched.)*

### Any related issues, documentation, discussions?

Closes apache#9195

### How was this PR tested?

All changes were thoroughly tested locally via the repository-standard
test runner:

1. **Affected Spec Files:**
- `yarn ng test --watch=false
--include=src/app/common/util/assert.spec.ts` (6/6 passed)
- `yarn ng test --watch=false
--include=src/app/common/service/gui-config.service.spec.ts` (12/12
passed)
- `yarn ng test --watch=false
--include=src/app/common/service/user/config/user-config.service.spec.ts`
(20/20 passed)
2. **Dependent / Downstream Spec Files:**
- `yarn ng test --watch=false
--include=src/app/workspace/service/preset/preset.service.spec.ts`
(48/48 passed)
3. **Common Suite:**
- `yarn ng test --watch=false --include="src/app/common/**/*.spec.ts"`
(876/876 passed across 55 test files)
4. **Code Quality, Type-Checking, and Build:**
   - `yarn tsc --noEmit` (Passed with 0 errors)
- `yarn tsc -p src/tsconfig.app.json --noEmit && yarn tsc -p
src/tsconfig.spec.json --noEmit` (Passed with 0 errors)
   - `yarn format:ci` (Passed cleanly)
   - `yarn lint` (Passed with 0 errors)
   - `yarn build` (Production frontend build succeeded)
   - `git diff --check` (Clean)

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

Generated-by: Antigravity IDE (Gemini 3.8 Flash)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend Changes related to the frontend GUI refactor Refactor the code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Drop unused utility functions and obsolete websocket types in frontend

4 participants