Skip to content

refactor: remove unused helpers, constants and bindings - #9696

Merged
aglinxinyuan merged 3 commits into
apache:mainfrom
aglinxinyuan:refactor/unused-cover-setter-bindings-and-imports
Nov 26, 2026
Merged

aglinxinyuan merged 3 commits into
apache:mainfrom
aglinxinyuan:refactor/unused-cover-setter-bindings-and-imports

Conversation

@aglinxinyuan

@aglinxinyuan aglinxinyuan commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Remove code that nothing uses, or that repeats work already done, across 16 files in the frontend, Amber, the shared config and observability modules, and the sbt license helper (+22/−152 lines). There is no behavior change.

  • PresetService: getOperatorPreset, filterOperatorPresetProperties and the private ajvStrip validator they share have no caller outside their own spec. Their two spec blocks go with them.
  • UserConfigService: set and delete return their request observables, and no caller reads them; PresetService, the only caller, discards both. They now return void, so the shareReplay carriers and the of import go. Each call still sends its request once and updates the local dictionary when the request succeeds.
  • Resource registry: ResourceDescriptor.setCover and its dataset and model implementations have no caller outside the registry's own spec. The dataset and model pages set a cover through DatasetService.updateDatasetCoverImage and ModelService.updateModelCoverImage directly. The spec drops its setCover call, the matching assertion and the updateModelCoverImage stub, and the workflow descriptor's comment stops naming the hook.
  • StorageConfig: 12 JDBC, Iceberg and S3 name constants that nothing reads. Every reader, such as ComputingUnitManagingResource, uses the same names from EnvironmentalVariable. The four cleanup and warehouse constants stay, because StorageConfigSpec reads them.
  • Telemetry: WorkflowMetricsRecorder.init calls WorkflowMetrics.ensureBound() right after setActiveExecutionsSupplier, which already calls it. OtelInit.initialized only ever holds an OpenTelemetrySdk, so it is now typed that way, and resetForTest loses a fallback arm that could not run.
  • CollaborationResource: the heartbeat, tryLock, acquireLock and restoreVersion patterns bind names that their bodies never read, so each becomes _.
  • Result table: nothing reads the #statsRow template reference.
  • search-results.component.spec.ts: the card-template host imports NgTemplateOutlet, which its template never uses.
  • TexeraWebApplication: drops a commented-out call to discardUncommittedChangesOfAllDatasets and its TODO. That method no longer exists.
  • AddMetaInfLicenseFiles: drops import com.typesafe.sbt.packager.universal.UniversalPlugin.autoImport._, which nothing in the helper uses.
Event PR / Commit
Introduced by PresetService: #1164 (2022-01-14); UserConfigService: #1162 (2021-06-27); resource registry: #8299 (2026-08-31); StorageConfig: #3337 (2025-04-06); telemetry: #5375 (2026-10-25) and #5376 (2026-10-27); CollaborationResource: #1427 (2022-02-15); result table: #2931 (2024-10-14); search results spec: #6565 (2026-07-20); TexeraWebApplication: #2391 (2024-02-20), commented out by #2733 (2024-07-15); AddMetaInfLicenseFiles: #4367 (2026-04-17)
Usage removed by TexeraWebApplication: #3314 (2025-03-12) deleted discardUncommittedChangesOfAllDatasets. AddMetaInfLicenseFiles: #4449 (2026-04-29) removed the last Universal reference. Everything else: unused since introduction.

As of 2026-11-25:

  • No caller has read the UserConfigService return values in the more than 5 years since they were added.
  • The two PresetService helpers have had no caller outside their spec for almost 5 years, and the CollaborationResource bindings have been unused for as long.
  • The #statsRow reference has been unread for over 2 years.
  • The commented call has pointed at a deleted method, and the StorageConfig constants have been unread, for over a year and a half each.
  • The Universal import has been unused for almost 7 months.
  • The setCover hook has had no caller in the almost 3 months it has existed, and the telemetry duplicates have done nothing in the month since they were added.

Any related issues, documentation, discussions?

Closes #9695.

How was this PR tested?

Ran on this branch and on main at d1a0c5e673 (Windows 11; Node 24 with Yarn 4.14.1; JDK 17):

cd frontend
npx ng test --watch=false --include='**/preset.service.spec.ts' --include='**/user-config.service.spec.ts' --include='**/preset-wrapper.component.spec.ts' --include='**/result-table-frame.component.spec.ts' --include='**/search-results.component.spec.ts' --include='**/resource-registry.service.spec.ts'
npx tsc --noEmit -p src/tsconfig.app.json
npx tsc --noEmit -p src/tsconfig.spec.json
yarn prettier-eslint --list-different $(git diff --name-only --relative origin/main -- src)
yarn eslint $(git diff --name-only --relative origin/main -- src)
cd ..
sbt Config/test Observability/test "WorkflowExecutionService/testOnly org.apache.texera.web.resource.CollaborationResourceSpec org.apache.texera.web.observability.WorkflowMetricsRecorderSpec"
sbt Config/scalafmtCheckAll Observability/scalafmtCheckAll WorkflowExecutionService/scalafmtCheckAll "Config/scalafixAll --check" "Observability/scalafixAll --check" "WorkflowExecutionService/scalafixAll --check"
  • Frontend: the six specs run 199 tests on this branch and 206 on main, all passing. The 7 extra on main are the deleted helpers' own spec cases; every other test keeps its name and outcome. Both typechecks, prettier-eslint and ESLint pass.
  • Scala: the Config and Observability suites and the two Amber specs run 212 tests, all passing on both sides with the same names and outcomes. scalafmt and scalafix pass for all three projects.
  • Every sbt run compiles the build definition, so AddMetaInfLicenseFiles.scala compiled with and without the import.

To re-check, both commands return no hits on this branch:

git grep -nwE "getOperatorPreset|filterOperatorPresetProperties|ajvStrip|setCover" -- frontend/src
git grep -nE "ENV_(JDBC|ICEBERG|S3)_" -- common/config/src/main/scala/org/apache/texera/common/config/StorageConfig.scala

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

Generated-by: Claude Code (Claude Opus 5.5)

- The resource registry's `setCover` hook has no caller outside its own
  spec: the dataset and model pages call their services directly.
- CollaborationResource names four case bindings it never reads.
- The result table's `#statsRow` template ref is never read.
- The search-results spec's card-template host imports NgTemplateOutlet
  without using it.
- TexeraWebApplication keeps a commented call, with its TODO, to
  discardUncommittedChangesOfAllDatasets, which no longer exists.
- AddMetaInfLicenseFiles imports the Universal plugin's auto-imports
  without using any of them.
@aglinxinyuan
aglinxinyuan requested review from kunwp1 and a balanced review from Copilot November 26, 2026 00:29

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 changed the title refactor: remove an unused cover setter, bindings and imports refactor: remove unused cover setter, bindings and imports Nov 26, 2026
@github-actions github-actions Bot added engine refactor Refactor the code frontend Changes related to the frontend GUI common labels Nov 26, 2026
@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: @tanishqgandhi1908, @Ma77Ball, @mengw15
    You can notify them by mentioning @tanishqgandhi1908, @Ma77Ball, @mengw15 in a comment.

@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Benchmark changes need a look

🟢 0 better · 🔴 9 worse · ⚪ 6 noise (<±5%) · 0 without baseline

Compared against main d1a0c5e benchmarked on this same runner, so the delta is largely free of cross-runner hardware noise. The "7d avg" column still reflects the gh-pages dashboard. Treat <±5% as noise unless repeated.

Dashboard · Run

config throughput MB/s latency max Δ latest / 7d
🔴 bs=10 sw=10 sl=64 443 0.27 21,515/43,248/43,248 us 🔴 +66.9% / 🔴 +218.7%
🔴 bs=100 sw=10 sl=64 1,254 0.765 78,912/109,013/109,013 us 🔴 +8.1% / 🔴 +20.8%
🔴 bs=1000 sw=10 sl=64 1,424 0.869 692,223/801,601/801,601 us 🔴 +6.6% / 🟢 -13.8%
Baseline details

Latest main d1a0c5e from same runner

config metric PR latest main 7d avg Δ latest Δ 7d
bs=10 sw=10 sl=64 throughput 443 tuples/sec 595 tuples/sec 956.03 tuples/sec -25.5% -53.7%
bs=10 sw=10 sl=64 MB/s 0.27 MB/s 0.363 MB/s 0.584 MB/s -25.6% -53.7%
bs=10 sw=10 sl=64 p50 21,515 us 15,008 us 10,527 us +43.4% +104.4%
bs=10 sw=10 sl=64 p95 43,248 us 25,910 us 13,570 us +66.9% +218.7%
bs=10 sw=10 sl=64 p99 43,248 us 25,910 us 16,510 us +66.9% +162.0%
bs=100 sw=10 sl=64 throughput 1,254 tuples/sec 1,270 tuples/sec 1,273 tuples/sec -1.3% -1.5%
bs=100 sw=10 sl=64 MB/s 0.765 MB/s 0.775 MB/s 0.777 MB/s -1.3% -1.5%
bs=100 sw=10 sl=64 p50 78,912 us 78,018 us 82,483 us +1.1% -4.3%
bs=100 sw=10 sl=64 p95 109,013 us 100,858 us 90,219 us +8.1% +20.8%
bs=100 sw=10 sl=64 p99 109,013 us 100,858 us 102,794 us +8.1% +6.1%
bs=1000 sw=10 sl=64 throughput 1,424 tuples/sec 1,460 tuples/sec 1,318 tuples/sec -2.5% +8.1%
bs=1000 sw=10 sl=64 MB/s 0.869 MB/s 0.891 MB/s 0.804 MB/s -2.5% +8.1%
bs=1000 sw=10 sl=64 p50 692,223 us 689,881 us 802,593 us +0.3% -13.8%
bs=1000 sw=10 sl=64 p95 801,601 us 751,862 us 843,998 us +6.6% -5.0%
bs=1000 sw=10 sl=64 p99 801,601 us 751,862 us 894,722 us +6.6% -10.4%
Raw CSV
config_idx,batch_size,schema_width,string_len,num_batches,total_ms,total_tuples,total_bytes,tuples_per_sec,mb_per_sec,lat_p50_us,lat_p95_us,lat_p99_us
0,10,10,64,20,451.59,200,128000,443,0.270,21515.31,43247.75,43247.75
1,100,10,64,20,1595.14,2000,1280000,1254,0.765,78911.83,109013.34,109013.34
2,1000,10,64,20,14044.28,20000,12800000,1424,0.869,692223.08,801601.08,801601.08

@codecov-commenter

codecov-commenter commented Nov 26, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.90909% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 91.76%. Comparing base (d1a0c5e) to head (8c92f34).

Files with missing lines Patch % Lines
...he/texera/web/resource/CollaborationResource.scala 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #9696      +/-   ##
============================================
- Coverage     91.79%   91.76%   -0.03%     
+ Complexity     5137     5135       -2     
============================================
  Files          1306     1305       -1     
  Lines         58272    58111     -161     
  Branches       7583     7580       -3     
============================================
- Hits          53489    53324     -165     
- Misses         2893     2894       +1     
- Partials       1890     1893       +3     
Flag Coverage Δ *Carryforward flag
access-control-service 77.44% <ø> (ø)
agent-service 99.55% <ø> (-0.02%) ⬇️ Carriedforward from 424b2a7
amber 85.94% <83.33%> (-0.03%) ⬇️
computing-unit-managing-service 63.81% <ø> (ø)
config-service 87.50% <ø> (ø)
file-service 82.16% <ø> (ø)
frontend 96.44% <100.00%> (-0.01%) ⬇️
notebook-migration-service 83.84% <ø> (ø)
pyamber 98.66% <ø> (-0.01%) ⬇️ Carriedforward from 424b2a7
result-service 86.48% <ø> (ø)
workflow-compiling-service 80.90% <ø> (ø)

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

- PresetService: getOperatorPreset, filterOperatorPresetProperties and the
  private ajvStrip validator had no caller outside their own spec.
- UserConfigService: set and delete returned observables that no caller read.
- WorkflowMetricsRecorder.init: setActiveExecutionsSupplier already binds the
  instruments, so the second ensureBound() call did nothing.
- OtelInit: initialized only ever holds an OpenTelemetrySdk, so resetForTest's
  fallback arm could not run.
- StorageConfig: 12 JDBC, Iceberg and S3 name constants that nothing read;
  every reader uses the EnvironmentalVariable copies.
@aglinxinyuan aglinxinyuan changed the title refactor: remove unused cover setter, bindings and imports refactor: remove unused helpers, constants and bindings Nov 26, 2026

@kunwp1 kunwp1 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 26, 2026
Merged via the queue into apache:main with commit c0c3f3f Nov 26, 2026
42 checks passed
@aglinxinyuan
aglinxinyuan deleted the refactor/unused-cover-setter-bindings-and-imports branch November 26, 2026 04:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common engine frontend Changes related to the frontend GUI refactor Refactor the code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove unused helpers, constants and bindings

4 participants