Skip to content

refactor(frontend): clean up unused config and assert helpers - #9435

Merged
aglinxinyuan merged 1 commit into
apache:mainfrom
sunny-kavixo:cleanup-unused-config-assert
Nov 16, 2026
Merged

aglinxinyuan merged 1 commit into
apache:mainfrom
sunny-kavixo:cleanup-unused-config-assert

Conversation

@sunny-kavixo

Copy link
Copy Markdown
Contributor

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 #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 #9195, dictionaryChangedSubject landed earlier in #8817 and localRemoveObject/sessionRemoveObject landed earlier in #9256; those completed changes are untouched.)

Any related issues, documentation, discussions?

Closes #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)

Remove unused methods and helpers that remain only referenced by their own specs:
- UserConfigService.getDict()
- GuiConfigService.source()
- assert() in assert.ts

Preserve behavioral test coverage in user-config.service.spec.ts across fetch,
set, delete, login, and logout by testing observable behavior through public
interfaces (specifically, that delete() only dispatches HTTP DELETE requests
when the target key is present in the local cache).

Closes apache#9195
@github-actions github-actions Bot added the frontend Changes related to the frontend GUI label Nov 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

👋 Thanks for your first contribution to Texera, @sunny-kavixo!

If you're looking for a good place to start, browse issues labeled starter-task; they're scoped to be approachable for newcomers.

You can drive common housekeeping yourself by commenting one of these commands on its own line:

  • Issues. Comment /take to assign an open issue to yourself, or /untake to release it. You can find unclaimed work with the search filter is:issue is:open no:assignee.
  • Sub-issues. To link issues into a parent/child hierarchy, comment /sub-issue #5166 #5222 on the parent to attach those children (or /unsub-issue #5166 #5222 to detach them). From a child issue, comment /parent-issue #5166 to set its parent, or /unparent-issue to clear it (the current parent is detected automatically). References may be written as #5166 or as a bare 5166; cross-repository references are not supported.
  • Pull requests (author only). Comment /request-review @user to request a review from someone, or /unrequest-review @user to withdraw that request.

Each command must match exactly: /take this will not work, only /take does. For the full contribution flow, see CONTRIBUTING.md.

@github-actions

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: @aglinxinyuan, @Ma77Ball, @Neilk1021
    You can notify them by mentioning @aglinxinyuan, @Ma77Ball, @Neilk1021 in a comment.

@sunny-kavixo

Copy link
Copy Markdown
Contributor Author

/request-review @aglinxinyuan

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.78%. Comparing base (b2ff978) to head (90a7003).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #9435      +/-   ##
============================================
- Coverage     91.78%   91.78%   -0.01%     
  Complexity     5023     5023              
============================================
  Files          1283     1283              
  Lines         56875    56871       -4     
  Branches       7442     7440       -2     
============================================
- Hits          52205    52201       -4     
  Misses         2800     2800              
  Partials       1870     1870              
Flag Coverage Δ *Carryforward flag
access-control-service 77.44% <ø> (ø) Carriedforward from b2ff978
agent-service 99.55% <ø> (ø) Carriedforward from b2ff978
amber 85.75% <ø> (ø) Carriedforward from b2ff978
computing-unit-managing-service 64.05% <ø> (ø) Carriedforward from b2ff978
config-service 87.73% <ø> (ø) Carriedforward from b2ff978
file-service 82.31% <ø> (ø) Carriedforward from b2ff978
frontend 96.42% <ø> (-0.01%) ⬇️
notebook-migration-service 83.77% <ø> (ø) Carriedforward from b2ff978
pyamber 98.50% <ø> (ø) Carriedforward from b2ff978
workflow-compiling-service 78.30% <ø> (ø) Carriedforward from b2ff978

*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.

@aglinxinyuan
aglinxinyuan added this pull request to the merge queue Nov 16, 2026
Merged via the queue into apache:main with commit 7adc729 Nov 16, 2026
38 of 40 checks passed
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clean up unused methods and helpers in common config services, storage, and assert utils

3 participants