Skip to content

refactor: remove redundant imports, branches and exports - #9692

Merged
aglinxinyuan merged 2 commits into
apache:mainfrom
aglinxinyuan:refactor/redundant-imports-branches-and-exports
Nov 26, 2026
Merged

aglinxinyuan merged 2 commits into
apache:mainfrom
aglinxinyuan:refactor/redundant-imports-branches-and-exports

Conversation

@aglinxinyuan

@aglinxinyuan aglinxinyuan commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Remove redundant code from the frontend, the licensing scripts, two Scala sources and the agent service (+26/−41 lines). There is no behavior change.

  • Dataset and model detail pages: each route.params emission was switched to this.route.data, and the empty .subscribe() threw away what that emitted. The pages now tap the params, so the same fetches run in the same order without the extra subscription. The dataset page's THROTTLE_TIME_MS also becomes file-local: workspace.component.ts and the hub spec import the copy in hub-workflow-detail.component.ts, never this one.
  • Version uploader: the abort handler's 404 branch called done() and returned, which is what the handler already does for every error it does not retry. Its three constants become file-local: nothing imported FINISHED_TASK_HIDE_DELAY_MS, and only the spec imported the other two. The spec now states the retry policy it expects.
  • Computing-unit actions: confirmAndTerminate reads unit.computingUnit.uri and unit.computingUnit.name before unit?.computingUnit.type, so the ?. goes.
  • Loop blocks: LOOP_END_OP_TYPE becomes file-local. Only its spec imported it, and the spec now checks the backend's "LoopEnd" name directly.
  • Agent interaction: two imports from agent.service become one.
  • Licensing scripts: audit_jar_licenses.py stored each group's notice hash in a field that nothing reads, and the NOTICE test helper make_jar had an extra parameter that no caller passes.
  • PveResource: drops import javax.ws.rs.DELETE and import javax.ws.rs.PathParam, which import javax.ws.rs._ already covers.
  • SQLSourceOpExec and AsterixDBSourceOpExec: five fallback arms list BOOLEAN, STRING and ANY before a trailing _, as in case AttributeType.BOOLEAN | AttributeType.STRING | AttributeType.ANY | _. The _ matches those types as well, so each becomes case _.
  • agent-service/.dockerignore: Docker reads the ignore file at the root of the build context. CI's image matrix (build-and-push-images.yml) and bin/build-images.sh both use the repository root as the context, and the agent Dockerfile copies agent-service/... paths from there, so the root .dockerignore applies and this file is never read.
Event PR / Commit
Introduced by Dataset and model detail: #2413 (2024-02-26), #3269 (2025-02-19), #8072 (2026-08-28); version uploader: #4136 (2026-01-05), moved by #8078 (2026-08-31); computing-unit actions: #4331 (2026-04-09); loop blocks: #8640 (2026-10-24); agent interaction: #6009 (2026-11-13); licensing scripts: #4387 (2026-04-29), #5417 (2026-06-10); PveResource: #5035 (2026-05-13); SQLSourceOpExec: #1013 (2021-02-11); AsterixDBSourceOpExec: #1044 (2021-02-25); agent-service/.dockerignore: #4495 (2026-04-28)
Usage removed by agent-service/.dockerignore: #4544 (2026-05-01) added the agent image's Dockerfile with paths from the repository root, so no build has read the file. Everything else: unused or redundant since introduction.

As of 2026-11-25:

  • The SQL sources' fallback arms have listed redundant types for over 5 years.
  • The dataset page's discarded subscription is almost 3 years old.
  • The version uploader's 404 branch has been redundant for over 10 months.
  • agent-service/.dockerignore has gone unread for almost 7 months.
  • The duplicate agent import is 12 days old.

Any related issues, documentation, discussions?

Closes #9691.

How was this PR tested?

Ran on this branch and on main at afc2b3db7a (Windows 11; Node 24 with Yarn 4.14.1; Python 3.12 with pytest 9.0.3 and CI's pinned ruff 0.14.7; JDK 17):

cd frontend
npx ng test --watch=false --include='**/dataset-detail.component.spec.ts' --include='**/model-detail.component.spec.ts' --include='**/version-uploader.component.spec.ts' --include='**/computing-unit-actions.service.spec.ts' --include='**/loop-block.util.spec.ts' --include='**/agent-interaction.component.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 ..
pytest bin/licensing
ruff check bin/licensing/audit_jar_licenses.py bin/licensing/test_generate_notice_binary.py
python bin/licensing/audit_jar_licenses.py <directory of 60 jars>
sbt "WorkflowOperator/testOnly org.apache.texera.amber.operator.source.sql.*" "WorkflowExecutionService/testOnly org.apache.texera.web.resource.pythonvirtualenvironment.*" WorkflowOperator/scalafmtCheckAll WorkflowExecutionService/scalafmtCheckAll "WorkflowOperator/scalafixAll --check" "WorkflowExecutionService/scalafixAll --check"
  • Frontend: the six specs run 379 tests, all passing on both sides. Both typechecks, prettier-eslint and ESLint pass.
  • Python: the licensing tests run 53 tests and 5 subtests, all passing on both sides, and Ruff passes. audit_jar_licenses.py prints the same report on both sides for 60 jars from the local Coursier cache.
  • Scala:
    • The 11 source.sql suites run 204 tests, all passing on both sides.
    • The two PVE resource suites run 75 tests on both sides: 74 pass and 1 is canceled. The canceled test needs a file that is not executable, which this Windows filesystem cannot represent.
    • scalafmt and scalafix pass on both modules.
  • agent-service/.dockerignore: no image was built. The build context comes from context="." for every bin/dockerfiles/*.dockerfile in build-and-push-images.yml, and from the .. that bin/build-images.sh passes from bin/.

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

Generated-by: Claude Code (Claude Opus 5.5)

- The dataset and model detail pages tap the route params instead of
  switching each emission to a route.data subscription nothing reads.
- The version uploader drops a 404 branch that does what the
  fall-through does, and its three constants become file-local.
- Computing-unit actions, loop blocks and agent interaction drop an
  optional chain on a value dereferenced two lines up, a test-only
  export and a second import from the same module.
- The licensing scripts drop a hash nothing reads and a test-helper
  parameter no caller passes.
- PveResource drops two imports that `javax.ws.rs._` already covers.
- SQLSourceOpExec's three fallback arms list types before `_`, which
  already matches them.
- agent-service/.dockerignore goes: every image build passes the
  repository root as the context, so Docker reads the root ignore file.
@aglinxinyuan
aglinxinyuan requested review from kunwp1 and a balanced review from Copilot November 25, 2026 23:44
@github-actions github-actions Bot added engine refactor Refactor the code frontend Changes related to the frontend GUI infra common agent-service labels Nov 25, 2026

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.

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

@codecov-commenter

codecov-commenter commented Nov 25, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.77%. Comparing base (afc2b3d) to head (d0212bc).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #9692   +/-   ##
=========================================
  Coverage     91.77%   91.77%           
  Complexity     5139     5139           
=========================================
  Files          1306     1306           
  Lines         58291    58277   -14     
  Branches       7595     7590    -5     
=========================================
- Hits          53496    53485   -11     
  Misses         2896     2896           
+ Partials       1899     1896    -3     
Flag Coverage Δ *Carryforward flag
access-control-service 77.44% <ø> (ø)
agent-service 99.56% <ø> (ø)
amber 85.95% <ø> (+0.01%) ⬆️ Carriedforward from 340483c
computing-unit-managing-service 63.81% <ø> (ø)
config-service 87.50% <ø> (ø)
file-service 82.16% <ø> (ø)
frontend 96.44% <100.00%> (-0.01%) ⬇️ Carriedforward from 340483c
notebook-migration-service 83.84% <ø> (ø)
pyamber 98.58% <ø> (ø) Carriedforward from 340483c
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.

@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Benchmark changes need a look

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

Compared against main 315de0b 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 405 0.247 23,298/36,530/36,530 us 🔴 -13.3% / 🔴 +169.2%
🟢 bs=100 sw=10 sl=64 963 0.588 102,264/117,690/117,690 us 🟢 -14.0% / 🔴 +30.4%
⚪ bs=1000 sw=10 sl=64 1,120 0.684 888,271/962,913/962,913 us ⚪ within ±5% / 🔴 -15.0%
Baseline details

Latest main 315de0b from same runner

config metric PR latest main 7d avg Δ latest Δ 7d
bs=10 sw=10 sl=64 throughput 405 tuples/sec 467 tuples/sec 956.03 tuples/sec -13.3% -57.6%
bs=10 sw=10 sl=64 MB/s 0.247 MB/s 0.285 MB/s 0.584 MB/s -13.3% -57.7%
bs=10 sw=10 sl=64 p50 23,298 us 21,076 us 10,527 us +10.5% +121.3%
bs=10 sw=10 sl=64 p95 36,530 us 32,277 us 13,570 us +13.2% +169.2%
bs=10 sw=10 sl=64 p99 36,530 us 32,277 us 16,510 us +13.2% +121.3%
bs=100 sw=10 sl=64 throughput 963 tuples/sec 974 tuples/sec 1,273 tuples/sec -1.1% -24.4%
bs=100 sw=10 sl=64 MB/s 0.588 MB/s 0.594 MB/s 0.777 MB/s -1.0% -24.3%
bs=100 sw=10 sl=64 p50 102,264 us 97,570 us 82,483 us +4.8% +24.0%
bs=100 sw=10 sl=64 p95 117,690 us 136,790 us 90,219 us -14.0% +30.4%
bs=100 sw=10 sl=64 p99 117,690 us 136,790 us 102,794 us -14.0% +14.5%
bs=1000 sw=10 sl=64 throughput 1,120 tuples/sec 1,118 tuples/sec 1,318 tuples/sec +0.2% -15.0%
bs=1000 sw=10 sl=64 MB/s 0.684 MB/s 0.682 MB/s 0.804 MB/s +0.3% -14.9%
bs=1000 sw=10 sl=64 p50 888,271 us 887,988 us 802,593 us +0.0% +10.7%
bs=1000 sw=10 sl=64 p95 962,913 us 955,927 us 843,998 us +0.7% +14.1%
bs=1000 sw=10 sl=64 p99 962,913 us 955,927 us 894,722 us +0.7% +7.6%
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,493.89,200,128000,405,0.247,23298.49,36529.80,36529.80
1,100,10,64,20,2076.93,2000,1280000,963,0.588,102264.29,117689.50,117689.50
2,1000,10,64,20,17850.04,20000,12800000,1120,0.684,888270.97,962913.00,962913.00

@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! One optional suggestion and two nits below.

SQLSourceOpExec.hasNext and AsterixDBSourceOpExec.batchAttributeToString
had the same `... | _` fallback arm as the three already changed.
THROTTLE_TIME_MS in dataset-detail.component.ts is used only in that
file: workspace.component.ts and the hub spec import the copy in
hub-workflow-detail.component.ts.
@aglinxinyuan
aglinxinyuan added this pull request to the merge queue Nov 26, 2026
Merged via the queue into apache:main with commit b7d2bb3 Nov 26, 2026
45 checks passed
@aglinxinyuan
aglinxinyuan deleted the refactor/redundant-imports-branches-and-exports branch November 26, 2026 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-service common engine frontend Changes related to the frontend GUI infra refactor Refactor the code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove redundant imports, branches and exports

4 participants