Skip to content

refactor(asf): unify Dropwizard service bootstrap into common/auth#5983

Open
Ma77Ball wants to merge 4 commits into
apache:mainfrom
Ma77Ball:refactor/unify-service-bootstrap
Open

refactor(asf): unify Dropwizard service bootstrap into common/auth#5983
Ma77Ball wants to merge 4 commits into
apache:mainfrom
Ma77Ball:refactor/unify-service-bootstrap

Conversation

@Ma77Ball

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

  • Added ServiceBootstrap in common/auth with three shared helpers: configure (YAML env-var substitution + DefaultScalaModule registration), initDatabase (open the SQL connection pool from StorageConfig), and configFilePath (resolve $TEXERA_HOME/<service>/src/main/resources/<file>).
  • Migrated all six Dropwizard services (config, access-control, file, computing-unit-managing, workflow-compiling, notebook-migration) onto ServiceBootstrap, removing the duplicated initialize() / initConnection / main() boilerplate.
  • Pointed WorkflowCompilingService at the shared RequestLoggingFilter.register instead of its hand-rolled inline servlet filter, and NotebookMigrationService at the shared AuthFeatures.register instead of its own identical registerAuthFeatures.
  • Added jackson-module-scala as a provided dependency of common/auth for ServiceBootstrap's DefaultScalaModule.

Any related issues, documentation, discussions?

Closes: #5982

How was this PR tested?

  • New ServiceBootstrapSpec: run sbt -J-Dnet.bytebuddy.experimental=true "Auth/testOnly *ServiceBootstrapSpec", expect it to verify configure wraps the config source provider and registers the Scala module, and that configFilePath returns an absolute path ending in the conventional <service>/src/main/resources/<file> suffix.
  • Existing service specs still pass: sbt "ConfigService/testOnly *RunSpec" "AccessControlService/testOnly *RunSpec" "WorkflowCompilingService/testOnly *RunSpec" "ComputingUnitManagingService/testOnly *RunSpec" "NotebookMigrationService/testOnly *RunSpec" plus AuthFeaturesSpec, confirming each service still registers the same resources and auth stack.
  • Compiles clean: sbt "Auth/compile" "ConfigService/compile" "AccessControlService/compile" "FileService/compile" "ComputingUnitManagingService/compile" "WorkflowCompilingService/compile" "NotebookMigrationService/compile".
  • Note: this dev machine runs JDK 25, which Mockito/ByteBuddy and JaCoCo/ASM do not yet support, so mock-based specs were run with -J-Dnet.bytebuddy.experimental=true and FileServiceRunSpec could not be instrumented locally; all of these run normally on CI's JDK 21.

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

Co-authored with Claude Opus 4.8 in compliance with ASF

@github-actions github-actions Bot added dependencies Pull requests that update a dependency file refactor Refactor the code common platform Non-amber Scala service paths labels Jun 28, 2026
@github-actions

github-actions Bot commented Jun 28, 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: @zyratlo, @eugenegujing
    You can notify them by mentioning @zyratlo, @eugenegujing in a comment.

@codecov-commenter

codecov-commenter commented Jun 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 65.90909% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.86%. Comparing base (24b587f) to head (0e451a2).

Files with missing lines Patch % Lines
...g/apache/texera/service/AccessControlService.scala 40.00% 3 Missing ⚠️
.../texera/service/ComputingUnitManagingService.scala 40.00% 3 Missing ⚠️
...ache/texera/service/NotebookMigrationService.scala 50.00% 3 Missing ⚠️
...ache/texera/service/WorkflowCompilingService.scala 50.00% 3 Missing ⚠️
.../scala/org/apache/texera/service/FileService.scala 33.33% 2 Missing ⚠️
...cala/org/apache/texera/service/ConfigService.scala 66.66% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #5983      +/-   ##
============================================
- Coverage     56.89%   56.86%   -0.04%     
- Complexity     3058     3075      +17     
============================================
  Files          1129     1127       -2     
  Lines         43802    43272     -530     
  Branches       4743     4668      -75     
============================================
- Hits          24922    24607     -315     
+ Misses        17449    17267     -182     
+ Partials       1431     1398      -33     
Flag Coverage Δ *Carryforward flag
access-control-service 74.73% <40.00%> (+4.73%) ⬆️
agent-service 44.59% <ø> (ø) Carriedforward from 613b76e
amber 58.72% <100.00%> (+0.06%) ⬆️
computing-unit-managing-service 4.84% <40.00%> (+4.84%) ⬆️
config-service 67.92% <66.66%> (+15.61%) ⬆️
file-service 65.30% <33.33%> (+2.48%) ⬆️
frontend 49.45% <ø> (-0.68%) ⬇️ Carriedforward from 613b76e
notebook-migration-service 83.66% <50.00%> (+5.08%) ⬆️
pyamber 90.51% <ø> (-0.64%) ⬇️ Carriedforward from 613b76e
python 90.69% <ø> (ø) Carriedforward from 613b76e
workflow-compiling-service 75.00% <50.00%> (+19.85%) ⬆️

*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 Jun 28, 2026

Copy link
Copy Markdown
Contributor

⚠️ Benchmark changes need a look

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

Compared against main 24b587f 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 348 0.212 28,136/39,430/39,430 us 🔴 +8.4% / 🔴 +158.0%
🔴 bs=100 sw=10 sl=64 789 0.481 126,175/144,019/144,019 us 🔴 +5.5% / 🔴 +32.9%
bs=1000 sw=10 sl=64 892 0.544 1,119,170/1,167,585/1,167,585 us ⚪ within ±5% / 🔴 +12.6%
Baseline details

Latest main 24b587f from same runner

config metric PR latest main 7d avg Δ latest Δ 7d
bs=10 sw=10 sl=64 throughput 348 tuples/sec 352 tuples/sec 770.95 tuples/sec -1.1% -54.9%
bs=10 sw=10 sl=64 MB/s 0.212 MB/s 0.215 MB/s 0.471 MB/s -1.4% -54.9%
bs=10 sw=10 sl=64 p50 28,136 us 28,836 us 12,775 us -2.4% +120.2%
bs=10 sw=10 sl=64 p95 39,430 us 36,380 us 15,286 us +8.4% +158.0%
bs=10 sw=10 sl=64 p99 39,430 us 36,380 us 18,795 us +8.4% +109.8%
bs=100 sw=10 sl=64 throughput 789 tuples/sec 805 tuples/sec 976.93 tuples/sec -2.0% -19.2%
bs=100 sw=10 sl=64 MB/s 0.481 MB/s 0.491 MB/s 0.596 MB/s -2.0% -19.3%
bs=100 sw=10 sl=64 p50 126,175 us 122,644 us 102,557 us +2.9% +23.0%
bs=100 sw=10 sl=64 p95 144,019 us 136,507 us 108,383 us +5.5% +32.9%
bs=100 sw=10 sl=64 p99 144,019 us 136,507 us 115,249 us +5.5% +25.0%
bs=1000 sw=10 sl=64 throughput 892 tuples/sec 899 tuples/sec 1,009 tuples/sec -0.8% -11.6%
bs=1000 sw=10 sl=64 MB/s 0.544 MB/s 0.549 MB/s 0.616 MB/s -0.9% -11.7%
bs=1000 sw=10 sl=64 p50 1,119,170 us 1,115,967 us 997,695 us +0.3% +12.2%
bs=1000 sw=10 sl=64 p95 1,167,585 us 1,161,588 us 1,036,731 us +0.5% +12.6%
bs=1000 sw=10 sl=64 p99 1,167,585 us 1,161,588 us 1,069,334 us +0.5% +9.2%
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,575.18,200,128000,348,0.212,28135.50,39430.33,39430.33
1,100,10,64,20,2535.78,2000,1280000,789,0.481,126175.29,144019.14,144019.14
2,1000,10,64,20,22424.65,20000,12800000,892,0.544,1119170.36,1167584.92,1167584.92

@Ma77Ball Ma77Ball marked this pull request as ready for review July 1, 2026 18:59
Ma77Ball added 2 commits July 1, 2026 12:53
  per-service init/run paths

  Raise patch coverage for the bootstrap-unification
  refactor, which had
  left the extracted glue uncovered (Codecov patch was
  ~29%).

  - ServiceBootstrapSpec: exercise initDatabase (the
  shared SQL pool setup),
    tolerating the no-DB case so it runs whether or
  not a Postgres is reachable.
  - Add initialize()/run() tests to each service
  RunSpec so the bootstrap
    wiring (configure, initDatabase, config-file path,
  auth stack, HTTP path)
    is executed and asserted.

  initDatabase mutates the JVM-wide SqlServer
  singleton that the DB-backed
  suites in auth/access-control/notebook-migration
  rely on, so mark those
  three modules Test / parallelExecution := false to
  keep the suites hermetic.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common dependencies Pull requests that update a dependency file platform Non-amber Scala service paths refactor Refactor the code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unify Dropwizard service bootstrap and reuse shared auth/logging helpers

2 participants