Skip to content

feat(notebook-migration): resolve the Jupyter URL and token per user - #8032

Merged
mengw15 merged 21 commits into
apache:mainfrom
zyratlo:migration-tool-jupyter-per-user
Sep 3, 2026
Merged

mengw15 merged 21 commits into
apache:mainfrom
zyratlo:migration-tool-jupyter-per-user

Conversation

@zyratlo

@zyratlo zyratlo commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

notebook-migration-service read one Jupyter URL and token from configuration as process-wide values. That is safe only under the per-user-pod model, where each user runs their own pod. A single global instance would hand every user the same Jupyter and the same token. This resolves both per user instead.

This is stage 2 of the staged roadmap in the architectural note on #5258. Stage 1 (#7390) and stage 4 (#7671) are merged. Stage 3 (#8006) depends on this one.

Registry table
A new user_jupyter table holds one row per user whose Jupyter has been provisioned, keyed on uid. Both the internal and public URLs are stored rather than derived at read time, matching how workflow_computing_unit.uri is the recorded source of truth for a computing unit's address. Storing them lets the deployment change its addressing scheme without a code change, which is what #8006 needs in order to choose between per-user hostnames and a path prefix.

Derived tokens
Each user's token is HMAC-SHA256(secret, uid), computed from storage.jupyter.token-secret. No credential is stored at rest, any replica of the service derives the same value, and rotation is a secret change. The service refuses to start when per-user Jupyter is on with an empty secret: an empty HMAC key is publicly known, so tokens would still look distinct per user while anyone could derive anyone else's.

Fallback gated on a flag, not on row absence
With kubernetes.jupyter-enabled off, every user resolves to the statically configured Jupyter, which is how the single-node (#7932) and local-dev (#7934) deployments run one shared JupyterLab. With it on, a user with no row has nothing provisioned yet and gets an unavailable response. Falling back to the shared server there would hand an unprovisioned user somebody else's notebooks, and would let delete-notebook remove another user's file. The flag is deliberately separate from kubernetes.enabled, so a deployment can run computing units on Kubernetes without per-user Jupyter.

Provisioning
JupyterKubernetesClient mirrors the computing unit's KubernetesClient, including the hostname and subdomain pair that makes the pod FQDN resolve through a headless service. get-jupyter-iframe-url and set-notebook provision on demand; get-jupyter-url and delete-notebook resolve only, so reading a URL or deleting a file never starts a pod. A registered pod that stops answering is discarded and rebuilt, since the row would otherwise outlive the pod and point every later request at nothing. Two concurrent first requests are resolved by the primary key: the loser keeps the winner's row, which holds the same uid-derived addresses.

The uid always comes from the authenticated session and never from a request body, so one user cannot address another's Jupyter.

Two notes on the implementation. The Kubernetes client is built on demand rather than at object initialisation, unlike the computing unit's, because the single-node and local-dev deployments have no cluster to build one against and never provision. Adding io.fabric8:kubernetes-client also raises three transitive versions over Dropwizard's pins (slf4j-api to 2.0.13, jackson-dataformat-yaml and jackson-datatype-jsr310 to 2.17.0); LICENSE-binary claims are updated to match.

Out of scope, and left to #8006: the Helm templates, the NetworkPolicy, and the global Deployment. Also out of scope is reclaiming idle pods. A dead pod self-heals on next use, but nothing reaps one that is merely unused, and the row's ON DELETE CASCADE drops the registration without deleting the pod. Until a deployment supplies a browser-reachable address, kubernetes.jupyter-public-url-template defaults to empty and the public URL falls back to the in-cluster one.

Any related issues, documentation, discussions?

Closes #7665
Parent issue #4301

Stage 3 (#8006) is built directly on this branch, so every decision here has been exercised on a real cluster rather than only in unit tests. See the verification comment below.

How was this PR tested?

NotebookMigrationService/test passes (72) and Config/test passes (71). Test/compile across the whole repo is clean, as is scalafmtCheckAll.

New coverage: token derivation is deterministic per uid, distinct across 50 uids, and changes with the secret; the start-up guard rejects an empty secret only when the feature is on. Resolution falls back with the feature off, returns the row with it on, returns nothing for an unregistered user, and never returns one user's Jupyter to another. Provisioning is exercised against a stubbed Kubernetes client across every branch: fresh provision, reuse of a live pod, rebuild of a pod that stopped answering, cleanup when readiness never arrives, public URL templating, and the concurrent-registration race.

The existing withFakeJupyter suite is untouched and still passes on the stub bound to localhost:9100, which is the point of the flag-gated fallback: test users have no registry row and take the configured path exactly as before.

Applied sql/texera_ddl.sql to a scratch database the way CI does, confirmed the table shape, and confirmed that deleting a user removes their registration row. check_binary_deps.py passes under both the PR-mode and the strict nightly invocations, and NOTICE-binary matches generator output byte for byte.

Not tested on a live cluster. The chart has no notebook-migration or Jupyter templates yet, and the in-cluster pod address does not resolve from outside the cluster, so end to end Kubernetes validation belongs to #8006.

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

Generated-by: Claude Code (Claude Opus 5)

@github-actions github-actions Bot added dependencies Pull requests that update a dependency file ddl-change Changes to the TexeraDB DDL common platform Non-amber Scala service paths labels Aug 27, 2026
@github-actions

github-actions Bot commented Aug 27, 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: @yangzhang75, @aicam, @Ma77Ball
    You can notify them by mentioning @yangzhang75, @aicam, @Ma77Ball in a comment.

@codecov-commenter

codecov-commenter commented Aug 27, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.57895% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.02%. Comparing base (cd4fd5a) to head (5c854b7).

Files with missing lines Patch % Lines
...pache/texera/service/util/JupyterProvisioner.scala 85.36% 0 Missing and 12 partials ⚠️
.../org/apache/texera/service/util/JupyterProbe.scala 90.00% 0 Missing and 2 partials ⚠️
...a/service/resource/NotebookMigrationResource.scala 94.11% 0 Missing and 1 partial ⚠️
.../apache/texera/service/util/JupyterEndpoints.scala 83.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8032      +/-   ##
============================================
- Coverage     94.03%   94.02%   -0.01%     
- Complexity     4771     4818      +47     
============================================
  Files          1196     1202       +6     
  Lines         48757    48921     +164     
  Branches       5916     5940      +24     
============================================
+ Hits          45850    46000     +150     
+ Misses         1458     1457       -1     
- Partials       1449     1464      +15     
Flag Coverage Δ *Carryforward flag
access-control-service 81.00% <ø> (ø)
agent-service 99.32% <ø> (ø) Carriedforward from cd4fd5a
amber 89.90% <100.00%> (+<0.01%) ⬆️
computing-unit-managing-service 73.67% <ø> (ø)
config-service 87.12% <ø> (ø)
file-service 87.91% <ø> (ø)
frontend 96.81% <ø> (ø) Carriedforward from cd4fd5a
notebook-migration-service 83.57% <91.06%> (+4.26%) ⬆️
pyamber 98.47% <ø> (ø) Carriedforward from cd4fd5a
workflow-compiling-service 77.19% <ø> (ø)

*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 Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Benchmark changes need a look

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

Compared against main cd4fd5a 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 671 0.41 14,426/23,845/23,845 us 🟢 -9.6% / 🔴 +49.2%
🔴 bs=100 sw=10 sl=64 1,705 1.041 57,453/77,675/77,675 us 🔴 +25.9% / 🟢 +74.7%
🔴 bs=1000 sw=10 sl=64 1,908 1.165 510,702/595,867/595,867 us 🔴 +6.4% / 🟢 +89.7%
Baseline details

Latest main cd4fd5a from same runner

config metric PR latest main 7d avg Δ latest Δ 7d
bs=10 sw=10 sl=64 throughput 671 tuples/sec 683 tuples/sec 755.36 tuples/sec -1.8% -11.2%
bs=10 sw=10 sl=64 MB/s 0.41 MB/s 0.417 MB/s 0.461 MB/s -1.7% -11.1%
bs=10 sw=10 sl=64 p50 14,426 us 14,174 us 12,938 us +1.8% +11.5%
bs=10 sw=10 sl=64 p95 23,845 us 26,384 us 15,980 us -9.6% +49.2%
bs=10 sw=10 sl=64 p99 23,845 us 26,384 us 19,233 us -9.6% +24.0%
bs=100 sw=10 sl=64 throughput 1,705 tuples/sec 1,737 tuples/sec 976.3 tuples/sec -1.8% +74.6%
bs=100 sw=10 sl=64 MB/s 1.041 MB/s 1.06 MB/s 0.596 MB/s -1.8% +74.7%
bs=100 sw=10 sl=64 p50 57,453 us 58,401 us 102,340 us -1.6% -43.9%
bs=100 sw=10 sl=64 p95 77,675 us 61,689 us 109,262 us +25.9% -28.9%
bs=100 sw=10 sl=64 p99 77,675 us 61,689 us 118,827 us +25.9% -34.6%
bs=1000 sw=10 sl=64 throughput 1,908 tuples/sec 1,991 tuples/sec 1,006 tuples/sec -4.2% +89.6%
bs=1000 sw=10 sl=64 MB/s 1.165 MB/s 1.215 MB/s 0.614 MB/s -4.1% +89.7%
bs=1000 sw=10 sl=64 p50 510,702 us 499,736 us 999,855 us +2.2% -48.9%
bs=1000 sw=10 sl=64 p95 595,867 us 559,971 us 1,042,833 us +6.4% -42.9%
bs=1000 sw=10 sl=64 p99 595,867 us 559,971 us 1,070,722 us +6.4% -44.3%
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,297.88,200,128000,671,0.410,14426.34,23844.94,23844.94
1,100,10,64,20,1172.92,2000,1280000,1705,1.041,57452.62,77675.23,77675.23
2,1000,10,64,20,10480.22,20000,12800000,1908,1.165,510702.02,595866.89,595866.89

@zyratlo

zyratlo commented Aug 28, 2026

Copy link
Copy Markdown
Contributor Author

Flagging that tests are a large share of this PR: 728 of the 1380 added lines, about 53%, or a 1.40:1 ratio against production code.

Most of that came from a coverage pass after Codecov reported 42 missing lines on the first push. The biggest single file is JupyterKubernetesClientSpec at 188 lines, and much of it is Mockito scaffolding rather than assertions. fabric8's fluent API returns type variables, so RETURNS_DEEP_STUBS cannot be used and every step of each chain is stubbed by hand. That mirrors what KubernetesClientSpec in computing-unit-managing-service already does. The payoff is that the pod spec is now asserted field by field, including the hostname and subdomain pair that makes the pod FQDN resolve, which nothing covered before.

The six new files under util/ are at 100% line coverage with no missed lines. The branch partials that remain are scala-logging macro expansions, which would need the suite run at two log levels to cover, so I left them rather than contort the tests.

Worth noting the production side is smaller than the 520 figure suggests: NotebookMigrationResource.scala shows 49 added against 49 deleted because JupyterEndpoints and the reachability probe moved out into util/, so the genuinely new logic is the 451 lines across the six new files.

@zyratlo

zyratlo commented Aug 28, 2026

Copy link
Copy Markdown
Contributor Author

Worth recording that this has been exercised end to end, not only unit tested.

Stage 3 (#8006) is stacked on this branch, and deploying it to a local Minikube cluster ran every decision in this PR against real infrastructure. Calico was used deliberately, because Minikube's default CNI creates NetworkPolicy objects without enforcing them, which would make an isolation test look correct while enforcing nothing.

What that confirmed:

  • Provisioning creates the pod on demand and the resource quota moves to match. The pod's labels, hostname and subdomain line up with what the headless service selects, so the FQDN this PR records actually resolves.
  • The token a user receives matches an independent HMAC derivation of the same uid, computed outside the JVM from the configured secret. Two users receive different tokens.
  • The stale row path works. Deleting a pod without touching its registry row makes the next request log the recorded address as unreachable, discard the row, and provision a replacement.
  • Per-user isolation holds. One user's pod cannot reach another's on 8888 by pod IP or by DNS, in either direction, while the same pod reaches another namespace in the same probe. Removing the NetworkPolicy makes the connection succeed and restoring it blocks again, so the denial is attributable to the policy rather than to incidental CNI behaviour.

Three things only a real deployment surfaced, all fixed in the stage 3 branch rather than here, since none of them are defects in this code:

  • Deriving the browser-facing origin from a gateway hostname alone is not enough. A deployment reached by port-forward or NodePort has no hostname, so the origin has to be settable directly.
  • A proxy that rewrites the Host header breaks JupyterLab's own cross-origin check on cookie-authenticated requests, which silently prevents the kernel from starting.
  • The gateway route serving the LLM endpoints had no explicit timeout, so Envoy's 15 second default cut off completions that take longer and were succeeding upstream.

On the Codecov result: the twelve lines it reports are partials, not uncovered lines. The per-file breakdown reads 0 Missing throughout. Ten are scala-logging macro branches, where logger.warn(...) expands to an isWarnEnabled check that would need the suite run at two log levels to cover both sides. The other two are a pattern-match dispatch branch and a case class synthetic.

@zyratlo
zyratlo marked this pull request as ready for review August 28, 2026 19:48
@zyratlo

zyratlo commented Aug 28, 2026

Copy link
Copy Markdown
Contributor Author

/request-review @mengw15

@github-actions
github-actions Bot requested a review from mengw15 August 28, 2026 19:49
@mengw15
mengw15 requested a balanced review from Copilot August 28, 2026 22:23

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.

Pull request overview

Adds per-user JupyterLab resolution and Kubernetes provisioning while retaining shared Jupyter fallback for local and single-node deployments.

Changes:

  • Adds per-user endpoint registration, token derivation, and provisioning.
  • Routes authenticated notebook operations to each user’s Jupyter instance.
  • Adds schema, configuration, dependencies, licensing, and tests.

Reviewed changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
sql/updates/43.sql Adds registry migration.
sql/texera_ddl.sql Adds registry to base schema.
sql/changelog.xml Registers migration 43.
notebook-migration-service/src/test/scala/org/apache/texera/service/util/JupyterTokenDeriverSpec.scala Tests token derivation.
notebook-migration-service/src/test/scala/org/apache/texera/service/util/JupyterProbeSpec.scala Tests availability probing.
notebook-migration-service/src/test/scala/org/apache/texera/service/util/JupyterKubernetesClientSpec.scala Tests pod operations.
notebook-migration-service/src/test/scala/org/apache/texera/service/util/JupyterEndpointsSpec.scala Tests endpoint values.
notebook-migration-service/src/test/scala/org/apache/texera/service/resource/NotebookMigrationResourceSpec.scala Tests resolution and provisioning.
notebook-migration-service/src/main/scala/org/apache/texera/service/util/JupyterTokenDeriver.scala Derives per-user tokens.
notebook-migration-service/src/main/scala/org/apache/texera/service/util/JupyterProvisioner.scala Manages pod lifecycle and registration.
notebook-migration-service/src/main/scala/org/apache/texera/service/util/JupyterProbe.scala Checks Jupyter availability.
notebook-migration-service/src/main/scala/org/apache/texera/service/util/JupyterKubernetesClient.scala Creates and deletes Jupyter pods.
notebook-migration-service/src/main/scala/org/apache/texera/service/util/JupyterEndpoints.scala Models resolved endpoints.
notebook-migration-service/src/main/scala/org/apache/texera/service/util/JupyterEndpointResolver.scala Resolves endpoints per user.
notebook-migration-service/src/main/scala/org/apache/texera/service/resource/NotebookMigrationResource.scala Applies per-user routing.
notebook-migration-service/src/main/scala/org/apache/texera/service/NotebookMigrationService.scala Validates token configuration.
notebook-migration-service/LICENSE-binary Records added dependencies.
notebook-migration-service/build.sbt Adds Fabric8 client.
common/config/src/test/scala/org/apache/texera/common/config/StorageConfigSpec.scala Tests token-secret default.
common/config/src/test/scala/org/apache/texera/common/config/KubernetesConfigSpec.scala Tests Jupyter Kubernetes settings.
common/config/src/main/scala/org/apache/texera/common/config/StorageConfig.scala Exposes token secret.
common/config/src/main/scala/org/apache/texera/common/config/KubernetesConfig.scala Exposes provisioning settings.
common/config/src/main/resources/storage.conf Defines token-secret configuration.
common/config/src/main/resources/kubernetes.conf Defines Jupyter pod configuration.
Suppressed comments (2)

notebook-migration-service/src/main/scala/org/apache/texera/service/util/JupyterProvisioner.scala:70

  • Kubernetes pod deletion is asynchronous, so discard can return while the stale pod is still Terminating. provision then sees that pod in podExists, skips creation, and only polls an address for which no replacement is being started, causing this rebuilding request to time out. Wait for the old resource to disappear, or use a replace/recreate operation, before provisioning the replacement.
        discard(uid)
        provision(uid, token)

notebook-migration-service/src/main/scala/org/apache/texera/service/util/JupyterProvisioner.scala:79

  • This check-then-create is racy: two first requests can both observe no pod, then the losing create receives Kubernetes 409 and the outer catch returns None before the database primary-key race handling runs. Treat an AlreadyExists response as adoption and continue through readiness and registration so both requests converge on the same pod.
      if (!kubernetes.podExists(uid)) kubernetes.createPod(uid, token)

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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

One comment on a provisioning race. The security core all checks out: uid only ever comes from the session, the fallback is gated on the flag rather than row absence, and the derived-token scheme with the startup guard is a clean way to avoid credentials at rest.

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

One more from a second pass over the new util files.

@zyratlo
zyratlo requested a review from mengw15 September 1, 2026 21:50
@mengw15
mengw15 requested a balanced review from Copilot September 2, 2026 07:13

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.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Pull request overview

Copilot reviewed 24 out of 24 changed files in this pull request and generated 5 comments.

Suppressed comments (1)

notebook-migration-service/src/main/scala/org/apache/texera/service/resource/NotebookMigrationResource.scala:1

  • Returning HTTP 500 for “Jupyter unavailable” (including the new “user has no Jupyter provisioned” case) makes this look like an internal server error rather than a dependency/unavailable-resource condition. Using 503 Service Unavailable (optionally with Retry-After) would be a more accurate contract for callers and for monitoring/alerting that keys off 5xx classes.
// Licensed to the Apache Software Foundation (ASF) under one

Comment thread sql/updates/45.sql Resolved
@zyratlo
zyratlo requested a review from mengw15 September 2, 2026 20:46

@mengw15 mengw15 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, all threads addressed and verified. Before merging: main has taken 45–47, so the migration needs another renumber to 48 (file + changelog id), plus the merge conflicts.

@zyratlo

zyratlo commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

LGTM, all threads addressed and verified. Before merging: main has taken 45–47, so the migration needs another renumber to 48 (file + changelog id), plus the merge conflicts.

I've numbered to 48 in 6babcf4 and merged main in

@mengw15
mengw15 added this pull request to the merge queue Sep 3, 2026
Merged via the queue into apache:main with commit d091868 Sep 3, 2026
51 of 53 checks passed
renovate-bot pushed a commit to renovate-bot/apache-_-texera that referenced this pull request Sep 9, 2026
…Kubernetes (apache#8073)

### What changes were proposed in this PR?

The notebook migration tool runs in the single-node Docker stack (apache#7931)
and in local development (apache#7933), but the Helm chart has no
`notebook-migration-service` and no JupyterLab. A Kubernetes deployment
shows the tool in the workspace with nothing serving its endpoints. This
adds both, following the chart's existing convention that orchestrator
services are global and stateful resources are per user.

`notebook-migration-service` becomes a global Deployment alongside the
other services, with a ServiceAccount whose Role is scoped to the
JupyterLab namespace only. Per-user JupyterLab pods live in their own
namespace behind a headless Service, addressed as
`jupyter-<uid>.<service>.<namespace>.svc.cluster.local`, with a
ResourceQuota bounding the pool and an optional prepull DaemonSet. A
NetworkPolicy stops one user's pod reaching another's. One `values.yaml`
switch, `notebookMigrationService.enabled`, gates the Deployment, the
routes, the pool, and the button in the workspace, and it defaults to
off.

**Enabling the tool now requires a token secret**
`notebookMigrationService.jupyterTokenSecret` has no default. Every
user's JupyterLab token is `HMAC(secret, uid)` and `/jupyter/<uid>/` is
deliberately unauthenticated at the gateway, so a secret shipped in this
repo would be public and would let anyone derive any user's token. The
Secret template wraps the value in `required`, so enabling the tool
without one fails at install with a message naming the key rather than
coming up quietly insecure. Generate one with `openssl rand -hex 32`.
`values-development.yaml` carries an explicitly dev scoped value so the
Minikube flow keeps working.

**How browser traffic reaches the right pod**
This is the design decision worth reviewing closely. JupyterLab is
loaded in an iframe and then issues its own requests for assets,
contents and kernel websockets. None of those can carry a Texera token,
and Texera has no session cookie, so the caller cannot be authenticated
per request. Each user's JupyterLab is therefore served under
`/jupyter/<uid>/`, and the gateway's existing ExtAuthz hook resolves
that uid to the pod's recorded address and rewrites `Host`. It reuses
`dynamic-routes`, its `DynamicResolver` backend, and the
`SecurityPolicy` that already forwards `Host`, so no new gateway
machinery is introduced.

That mechanism routes; it does not authorize. What keeps users apart is
the per-user JupyterLab token from apache#7665, derived from a server held
secret and unguessable. Anyone who can reach the gateway can route to
any user's pod and will get a 403 from JupyterLab without that user's
token. The NetworkPolicy is defence in depth on top, closing the one
case where a genuinely hostile neighbour runs: another user's pod. This
is a weaker posture than a per-request authorization check, and it is
stated plainly in the code rather than left to be inferred.

Resolution fails closed. A uid too large for an `Int`, a missing
registry row, and a recorded address that will not parse all take one
path to 403, never a 500.

**This PR is not Helm only, unlike what apache#8006 anticipated**
Four backend changes are inseparable from a working deployment:

* JupyterLab serves under a configurable base path, since routing by
path requires it, and the recorded internal address carries that path
because JupyterLab serves every endpoint under it, `/api` included.
* `access-control-service` gains the Jupyter case in `authorize()`. The
uid regex is built from `kubernetes.jupyter-base-url` and the prefix is
quoted, so a base path is matched as a path and not as a pattern.
* JupyterLab is told which origin may embed it. The setting and the
pod's `TEXERA_ORIGIN` arrived with apache#8032; this PR passes it to
`--NotebookApp.allow_origin`, without which a proxy that rewrites `Host`
makes JupyterLab's own cross origin check fail on cookie authenticated
requests and kernel startup is blocked entirely.
* The browser facing origin is settable directly, not only derived from
a gateway hostname, because a deployment reached by port forward or
NodePort has no hostname to derive from. When it is derived, the scheme
comes from whether a certificate is configured, `gatewayConfig.issuer`
or `tlsSecretName`, because the chart declares both listeners
unconditionally and a hostname alone does not say which one serves.

`jupyterPool.basePath` is honoured by every layer that reads it: the
pod's `base_url`, the recorded internal URL, the public URL template,
the gateway route match, and the regex `access-control-service` matches
on. All five derive from the one value, so the prefix cannot be obeyed
in one place and ignored in another.

**Rebuilt pods and pooled connections**
A Jupyter pod is named after its uid, so a rebuild reuses the hostname
with a new IP. The gateway keeps pooled upstream connections to the old
address for its default idle hour, and a request handed one of those
hangs until the route timeout, because a departed pod IP is unrouted
rather than refused. A BackendTrafficPolicy sets `connectionIdleTimeout`
to 30s on the dynamic route so those connections are retired promptly.
Measured on the cluster below, a rebuild went from 14 failures in 40
requests scattered over minutes to 4, confined to the moment of the
switch. Computing units share this route and are unaffected either way:
their pods are keyed on a never reused cuid, so no hostname of theirs
ever moves.

**Two routes needed explicit timeouts**
Envoy's default request timeout is 15 seconds, which is shorter than two
things this tool does.

`/api/notebook-migration` now carries a 3m timeout. Provisioning waits
for a pod to terminate and then to answer, up to 60s each, so the
default was truncating work the service would have completed: rebuilds
measured 30 seconds and returned 504 to the browser while the pod came
up fine underneath, with an immediate retry succeeding.

The route serving `/api/chat` and `/api/models` takes its timeout from
`gatewayConfig.llmRequestTimeout`, defaulting to 10m to match
`python-notebook-migration-timeout-minutes`. LLM completions routinely
run past 15 seconds, and the upstream call succeeds and is then
discarded, so every conversion failed while burning the API call. This
also fixes the agent chat, which shares the route.

Known limitations, both worth their own issues:

* JupyterLab pods have no persistent volume, so a pod restart empties
`work/`. Notebooks survive in the database but are not re-uploaded
automatically. The same is true of a single-node container restart, so
this is not specific to Kubernetes.
* A dead pod self-heals on the next request, but an idle one is never
reclaimed.

### Any related issues, documentation, discussions?

Closes apache#8006
Parent issue apache#4301
Builds on apache#7665 (PR apache#8032, merged), which resolves the Jupyter URL and
token per user. Roadmap context is the architectural note on apache#5258.

### How was this PR tested?

Unit tests pass across the touched modules: `Config/test` (71),
`AccessControlService/test` (68), `NotebookMigrationService/test` (122),
with `scalafmtCheckAll` clean. `helm template` renders with the feature
on and off; with it disabled the chart emits no Jupyter or
notebook-migration objects at all, and with it enabled but no token
secret the render fails as intended.

Deployed and exercised end to end on a local Minikube cluster running
Calico, chosen because Minikube's default CNI creates NetworkPolicy
objects without enforcing them, which would make the isolation commit
look correct while enforcing nothing.

All seven endpoints were driven through the gateway: `get-jupyter-url`,
`get-jupyter-iframe-url`, `set-notebook`, `delete-notebook`, and the
three mapping endpoints. `set-notebook` was confirmed by reading the
file back through Jupyter's own contents API, and `delete-notebook` by
that read then returning 404. Requests with no token, a garbage token,
and an `INACTIVE` role are refused; `../../etc/x.ipynb`, a non `.ipynb`
name, and malformed JSON bodies are all 400.

Per-user separation was tested with two real users. Each got its own
pod, the quota moved from one to two, and the registry held two rows
with uid scoped addresses. Each served token matched an independent HMAC
derivation of that uid, and each token returned 200 on its own pod and
403 on the other. Routing to a uid with no pod, and to a uid that does
not exist, both return 403.

Isolation was tested with an ablation rather than a single observation.
`jupyter-1` cannot reach `jupyter-2` on 8888 by pod IP or by DNS, in
both directions, while the same pod reaches the `texera-dev` namespace
in the same probe, which rules out broken networking. Removing the
policy makes the connection succeed and restoring it blocks again.

Kernel startup was tested the way a browser does it, with a cookie and
an `Origin` header rather than a token query parameter, because a token
authenticated request skips JupyterLab's origin check and would pass
even when the browser path is broken. `POST /api/sessions` returns 201
and the pod logs `Kernel started`. Cell click sync was confirmed in the
browser.

The failure paths were provoked rather than assumed. Writing an
unparseable address into a registry row returns 403 and logs the
`URISyntaxException`, and 200 returns once restored. Deleting a pod
without touching its row causes the next request to log that the pod no
longer accepts its current token, discard the row and provision a
replacement. Setting `jupyterPool.basePath` to `/lab/notebooks` moves
the pod's `base_url`, the recorded URL, the gateway route and the regex
together, and removing `KUBERNETES_JUPYTER_BASE_URL` from
`access-control-service` restores the break, which is what proves the
wiring rather than the default doing the work.

### Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Opus 5)

---------

Co-authored-by: Meng Wang <[email protected]>
renovate-bot pushed a commit to renovate-bot/apache-_-texera that referenced this pull request Oct 12, 2026
…te constant (apache#7796)

### What changes were proposed in this PR?

Two places where a shared helper already existed but a local copy or
literal was used instead. **9 insertions, 27 deletions.**

**1. `WorkflowCompilingService` now calls the shared
`RequestLoggingFilter`.** It was the only Dropwizard-4 service still
inlining its own anonymous request-logging filter; the other five
(access-control, computing-unit-managing, config, file,
notebook-migration) all call
`RequestLoggingFilter.register(environment.getApplicationContext)` at
exactly this point.

The two implementations were compared line by line before swapping, not
assumed equivalent. Normalising fully-qualified prefixes and the
logger's local name, every observable matches: logger name
`"org.eclipse.jetty.server.RequestLog"`, the `isInfoEnabled` guard, the
same access-log format string, url pattern `"/*"`, and
`EnumSet.allOf(classOf[DispatcherType])`. The inline copy also sat
immediately after `RoleAnnotationEnforcer.enforce`, which is exactly
where the siblings place the `register` call — so this is a body-only
replacement.

**2. Four sites now use `SqlStates.UNIQUE_VIOLATION` instead of the
literal `"23505"`.**

| Site | Was |
|---|---|
| `PveResource.scala:110`, `:148` | `e.sqlState() == "23505"` |
| `NotebookMigrationResource.scala:404` | `e.sqlState == "23505"` |
| `JupyterProvisioner.scala:168` | `e.sqlState == "23505"` |

Both modules can already see `common/dao`: `NotebookMigrationService`
has a direct DAO dependency, and amber reaches it transitively (`Auth →
DAO`, and `WorkflowCompiler → WorkflowOperator → WorkflowCore → DAO`).
No build change was needed. The constant was already in use by
`ExternalAuthProvisioner`, `LocalAuthProvisioner` and `ResourceNaming`.

The remaining `23505` occurrences are CSV test fixtures, a `yarn.lock`
checksum, `SqlStates.scala` itself, and three comments that explain what
the code means — those are left alone.

> **Updated after merging `main`.** The `DatasetResource.scala` site
originally in this PR is gone: `main` (apache#7760) moved that check into
`ResourceNaming.failOnDuplicateName`, which already uses
`SqlStates.UNIQUE_VIOLATION`, so `DatasetResource.scala` is now
identical to `main`. `main` also added a new literal in
`JupyterProvisioner.register` (apache#8032), which this PR now converts as
well.

### amber's two inline copies are deliberately untouched

Worth recording so they are not "fixed" later: amber's remaining inline
filters **cannot** use the shared one. They are `javax.servlet`, because
amber pins Jetty 9.4.20, while `RequestLoggingFilter` is
`jakarta.servlet`. Their existing TODO — replace once Dropwizard is
upgraded — is accurate, and this PR does not touch them.

### Verification

Re-run on the branch after merging `main`:

- `WorkflowCompilingService/test`: **5 suites, 55 tests, 0 failures.**
This matters because `WorkflowCompilingServiceRunSpec` has cases
asserting the filter's registration, its dispatch set, and that it
forwards the request while logging one access line. They read the filter
back out of the captured `FilterHolder` rather than by class, so they
survived the swap unchanged — and they are what confirms the shared
filter behaves identically in place.
- `NotebookMigrationService/test`: **6 suites, 123 tests, 0 failures.**
`NotebookMigrationResourceSpec` drives a real unique-constraint
violation against embedded Postgres, and its "keep the winning row when
two requests provision at once" case exercises the `JupyterProvisioner`
race path.
- `PveResourceSpec` fails the same 6 tests **both with and without this
change** (45 succeeded / 6 failed / 1 canceled either way, verified by
swapping in `main`'s `PveResource.scala` and re-running; identical
failing set). All 6 are `PveManager` venv/pip cases that are
pre-existing on this machine; none touch the `23505` → 409 paths.
- `scalafmtCheckAll` and `scalafixAll --check` pass for
`WorkflowCompilingService`, `NotebookMigrationService`, `FileService`
and `WorkflowExecutionService`; no imports were left orphaned
(`FilterHolder` removed, `RequestLoggingFilter` added).

### Any related issues, documentation, discussions?

Closes apache#7792

### How was this PR tested?

```
sbt "WorkflowCompilingService/test" "NotebookMigrationService/test" "WorkflowExecutionService/testOnly org.apache.texera.web.resource.pythonvirtualenvironment.PveResourceSpec"
```

```
[info] Tests: succeeded 55, failed 0, canceled 0, ignored 0, pending 0
[info] Tests: succeeded 123, failed 0, canceled 0, ignored 0, pending 0
[info] Tests: succeeded 45, failed 6, canceled 1, ignored 0, pending 0   (identical on main)
```

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

Generated-by: Claude Code (Opus 5)
renovate-bot pushed a commit to renovate-bot/apache-_-texera that referenced this pull request Nov 25, 2026
### What changes were proposed in this PR?

Remove unused code from the Scala sources and tests of the Amber engine
and web server, `workflow-core`, `workflow-operator`, `observability`
and the notebook-migration service, and narrow the database reads of the
account, notification, dashboard-search, Hub and Jupyter-registration
lookups to the columns and rows they use (**+285/-316 lines**).
Production behavior does not change. Two CSV tests that are named for
multi-line data now read the multi-line file.

**Unused code**

- **Unused bindings:** pattern, `catch` and callback bindings that
nothing reads become `_` in `ClusterListener`, `DeadLetterMonitorActor`,
`Utils`, `SequentialRecordStorage`, the argument parsers of
`ComputingUnitMaster` and `ComputingUnitWorker`, `WebsocketInput`,
`WorkflowWebsocketResource`, `AiAssistantManager`, `ExecFactory`,
`VirtualIdentityUtils`, `URLFetchUtil` and `HtmlVizOpDesc`. The two
argument parsers end in `case _`, since `case Nil` already takes the
empty list.
- **`S3StorageClient.uploadObject`:**
- `readChunk` uses a plain `while` loop instead of assigning inside the
loop condition.
- The parts upload in a `while` loop that adds each `CompletedPart` to
the Java list the SDK takes. Before, an `Iterator` of `(partNumber,
size)` tuples became a Scala `List` and then went back through
`.asJava`.
- Each part is copied out of the reused buffer once and streamed from
that copy. `buffer.take` and `RequestBody.fromBytes`, which calls
`Arrays.copyOf` itself, copied it twice. The content provider gives each
SDK attempt a fresh stream over the same bytes.
- Part numbers, upload order, part sizes, the `application/octet-stream`
content type and the read of the next chunk after each upload are
unchanged.
- **`SQLSourceOpExec.fetchBatchByBoundary`:** returns the result of the
type `match` as a `val` instead of overwriting a `var` that starts as
`null`.
- **Worker statistics:** `StatisticsManager.getStatistics` drops the
executor parameter it has not read since its sink-operator check went
away. `DataProcessor` and both statistics specs stop passing an executor
to it.
- **Telemetry:** `WorkflowMetricsRecorder` drops a `LazyLogging` it
never logs with, and `WorkflowMetrics` drops the `Cancelled` outcome and
the `Unknown` workflow kind that nothing records.
- **Scan sources:** `SkippedRowReporter` drops its uncalled `count`, and
`ArrowSourceOpExec` drops a batch counter it only increments.
- **Arrow Flight benchmark:** sorts each run's latencies once, instead
of once per percentile.
- **Test helpers:**
- `DPThreadSpec.awaitCond` drops its unused default budget, and the
spec's callbacks name their unused argument `_`.
- `ExternalAuthProvisionerSpec`'s `seedUser` and `seedUserWithEmail`
drop the `avatar` parameter that no test passes.
- `DictionaryMatcherOpExecSpec.withExecutor`, `HashJoinOpSpec.tuple` and
the tuple builders of `IntervalOpExecSpec` drop defaults that every
caller overrides.
- `PythonWorkerPool` starts its stdout and stderr reader threads without
keeping the references it never reads.
- **Test fixtures:**
- `TestOperators` drops `asterixDBSourceOpDesc`, a descriptor for the
AsterixDB server at `ipubmed4.ics.uci.edu` that only its own
`TestOperatorsSpec` case still built. It also drops the `multiLine`
parameter that `getCsvScanOpDesc` never read.
- `headerlessSmallMultiLineDataCsvScanOpDesc` reads
`country_sales_headerless_small_multi_line.csv` again, so
`DataProcessingSpec`'s headerless multi-line case runs on multi-line
data.
- The matching `CSVScanSourceOpDescSpec` case now reads that file too,
and checks the scanned rows: 100 rows of 14 fields, a quoted value with
commas, and two values with line breaks.

**Database reads**

- **Account, login and notification queries:**
- `AuthResource`'s login query selects the user columns and the password
hash, instead of every column of the joined `auth_provider` and `user`
rows. `ExternalAuthProvisioner`'s lookup selects only the user columns.
- The admin-bootstrap and add-email checks in `AuthResource`, the
duplicate-email check in `AdminUserResource` and
`UserResource.isJoiningReasonRequired` read one column, or use
`selectOne`, instead of a full user row.
- `GmailResource` reads only the requester's name and the admins' email
addresses, compiles its email regex once, and passes the subject and the
domain-suffixed content to `createMimeMessage` instead of copying the
`EmailMessage`.
- **Dashboard search:**
- `searchAllResources` builds its results in one pass over the first
`count` rows. Before, it built a list of entries, filtered out the
omitted ones, and scanned the list again for `hasMismatch`.
- `getOrderFields` drops the `case None` branch and the private
`getColumnField` with its `case _ => null`, which its regex makes
unreachable, and compiles the regex once.
- `WorkflowSearchQueryBuilder` builds its access condition as a `val`
instead of overwriting a `DSL.trueCondition()` initializer.
`VersionedResourceSearchQueryBuilder` drops a `getGroupByFields`
override that returns the base default.
- `VersionedResourceTables.hydrate` stops pairing each entry with a
resource ID that every caller discarded, drops `idOf`, and reads the
owner email from the record without building a `User` POJO.
- **Hub (`HubResource`):**
- The versioned-resource lookup selects the resource columns, the owner
email and the privilege that `hydrate` reads, instead of every joined
column. `VersionedResourceTables.hydrationFields` defines that list next
to `hydrate`, because a query that left a column out would get a `null`
email or privilege without an error.
- `isLikedHelper` collects the liked IDs with `fetchSet`. Like/unlike
and clone check for an existing row with `fetchExists` instead of
fetching it, and like/unlike no longer goes through the batch helper.
- `getCounts` reuses each entity type's request group, and drops the
zero entries it added for missing view counts, since the lookup already
defaults to 0.
- **Notebook migration:** `NotebookMigrationResource` stops selecting
the notebook ID it never reads, and drops `JSONB` casts that its typed
fields make redundant. `JupyterEndpointResolver` selects the two
registration URLs instead of a full `user_jupyter` row, and
`JupyterProvisioner` derives a healthy registration's token once instead
of twice.

**Tests for rewritten paths no test reached**

- `DatasetSearchQueryBuilderSpec` runs a dataset search over a dataset
that lakeFS rejects, and expects it left out with `hasMismatch` set.
- `HubResourceSpec` fetches such a dataset by ID and expects it dropped.
- `AdminUserResourceSpec` moves a user to an address no other account
uses.

| Event | PR / Commit |
| --- | --- |
| Introduced by | Amber engine and web server: apache#945 (2021-01-05), apache#1101
(2021-05-03), apache#1387 (2022-02-10), apache#1381 (2022-05-13), apache#1671
(2022-11-07), apache#1677 (2022-11-07), apache#2060 (2023-07-14), apache#2529
(2024-03-29), apache#2570 (2024-04-07), apache#2808 (2024-09-02); account and
notification queries: apache#3080 (2024-11-19), apache#3393 (2025-04-29), apache#3440
(2025-06-08), apache#4185 (2026-02-16), apache#7055 (2026-08-10), apache#7758
(2026-08-21), apache#7639 (2026-08-30), apache#7978 (2026-08-31); dashboard search
and Hub: apache#2358 (2024-02-23), apache#2838 (2024-09-25), apache#3252 (2025-02-09),
apache#3446 (2025-05-26), apache#3442 (2025-06-28), apache#3519 (2025-07-09), apache#7928
(2026-08-26), apache#7930 (2026-09-01), apache#8890 (2026-10-27); `workflow-core`:
apache#2271 (2024-01-18), apache#3183 (2024-12-31), apache#4067 (2025-11-25);
`workflow-operator`: apache#1013 (2021-02-11), apache#1866 (2023-03-23), apache#3139
(2024-12-06), apache#3186 (2024-12-31), apache#6947 (2026-10-02); `observability`:
apache#5376 (2026-10-27); notebook migration: apache#5258 (2026-06-24), apache#8032
(2026-09-03); tests and benchmark: apache#1044 (2021-02-25), apache#1083
(2021-04-25), apache#1227 (2021-07-25), apache#2254 (2023-12-13), apache#2302
(2024-02-05), apache#3425 (2025-05-26), apache#4836 (2026-05-03), apache#5439
(2026-06-06), apache#5557 (2026-06-11), apache#6077 (2026-07-03), apache#7116
(2026-07-31), apache#7207 (2026-08-14), apache#7870 (2026-08-23), apache#7875
(2026-08-31), apache#9534 (2026-11-19), apache#9518 (2026-11-21) |
| Usage removed by | AsterixDB fixture: apache#1118 (2021-05-11, `Disable
dependent tests with AsterixDB`) commented out its only test use, which
apache#3294 (2025-03-04) deleted; multi-line fixture: apache#3111 (2024-11-26,
`Update amber to depend on sub projects`) pointed
`headerlessSmallMultiLineDataCsvScanOpDesc` at the single-line file;
`awaitCond`'s default budget: apache#9534 (2026-11-19, `test(amber): share
engine and service test fixtures`) routed its last callers through a
helper that always passes one; `getStatistics`' executor parameter:
apache#3312 (2025-03-12, `Remove Sink Operator in the Backend`) dropped its
only read, the sink-operator check; everything else: unused or redundant
since introduction |

As of 2026-11-24, the AsterixDB fixture has had no test use for over 5
years, and the headerless multi-line CSV fixture has read single-line
data for about 12 months.

### Any related issues, documentation, discussions?

Closes apache#9680.

### How was this PR tested?

The first commit (`cb95cd29b7`) ran on its base, `main` at `de3f021dec`.
The second commit ran on this branch before it (`2e980903c8`, after
merging `main`) and after it, the third likewise on `dee7711a88`, the
fourth on `3870a2da97`, and the fifth on `4c244837bf`. Both used Windows
11, JDK 17, `UDF_PYTHON_PATH` set to Python 3.12, and Docker for the
RustFS container that `S3StorageClientSpec` starts. The e2e case uses
the Hadoop Iceberg catalog because no REST catalog runs on this machine:

```bash
WUNUSED='set ThisBuild / scalacOptions += "-Wunused:patvars,params,privates"'
sbt "$WUNUSED" "WorkflowCore/testOnly org.apache.texera.amber.core.executor.CoreExecutorReflectionSpec org.apache.texera.amber.util.VirtualIdentityUtilsSpec org.apache.texera.service.util.S3StorageClientSpec"
sbt "$WUNUSED" "WorkflowOperator/testOnly org.apache.texera.amber.operator.TestOperatorsSpec org.apache.texera.amber.operator.dictionary.DictionaryMatcherOpExecSpec org.apache.texera.amber.operator.hashJoin.HashJoinOpSpec org.apache.texera.amber.operator.intervalJoin.IntervalOpExecSpec org.apache.texera.amber.operator.source.fetcher.URLFetchUtilSpec org.apache.texera.amber.operator.source.fetcher.URLFetcherOpExecSpec org.apache.texera.amber.operator.source.scan.csv.CSVScanSourceOpDescSpec org.apache.texera.amber.operator.source.scan.csv.CSVScanSourceOpExecSpec org.apache.texera.amber.operator.source.sql.* org.apache.texera.amber.operator.visualization.htmlviz.HtmlVizOpDescSpec org.apache.texera.amber.util.python.PythonWorkerPoolSpec"
sbt "$WUNUSED" "WorkflowExecutionService/testOnly org.apache.texera.amber.clustering.ClusterListenerSpec org.apache.texera.amber.engine.architecture.messaginglayer.DeadLetterMonitorActorSpec org.apache.texera.amber.engine.architecture.worker.DPThreadSpec org.apache.texera.amber.engine.common.UtilsSpec org.apache.texera.amber.engine.common.storage.SequentialRecordStorageSpec org.apache.texera.web.ComputingUnitMasterSpec org.apache.texera.web.ComputingUnitWorkerSpec org.apache.texera.web.WebsocketInputSpec org.apache.texera.web.resource.WorkflowWebsocketResourceSpec org.apache.texera.web.resource.aiassistant.AiAssistantManagerSpec org.apache.texera.web.resource.auth.ExternalAuthProvisionerSpec"
sbt "$WUNUSED" "WorkflowExecutionService/testOnly org.apache.texera.web.TexeraWebApplicationSpec org.apache.texera.web.resource.GmailResourceSpec org.apache.texera.web.resource.auth.AuthResourceSpec org.apache.texera.web.resource.auth.ExternalAuthProvisionerSpec org.apache.texera.web.resource.auth.OrcidAuthResourceSpec org.apache.texera.web.resource.dashboard.DashboardResourceSpec org.apache.texera.web.resource.dashboard.DatasetSearchQueryBuilderSpec org.apache.texera.web.resource.dashboard.ModelSearchQueryBuilderSpec org.apache.texera.web.resource.dashboard.UnifiedResourceSchemaSpec org.apache.texera.web.resource.dashboard.VersionedResourceTablesSpec org.apache.texera.web.resource.dashboard.WorkflowSearchQueryBuilderSpec org.apache.texera.web.resource.dashboard.admin.user.AdminUserResourceSpec org.apache.texera.web.resource.dashboard.file.DatasetResourceSpec org.apache.texera.web.resource.dashboard.file.WorkflowResourceSpec org.apache.texera.web.resource.dashboard.hub.EntityTablesSpec org.apache.texera.web.resource.dashboard.hub.HubEntityModelSpec org.apache.texera.web.resource.dashboard.hub.HubResourceSpec org.apache.texera.web.resource.dashboard.user.UserResourceSpec org.apache.texera.web.resource.dashboard.user.workflow.WorkflowPublishSpec org.apache.texera.web.service.WorkflowEmailNotifierSpec"
STORAGE_ICEBERG_CATALOG_TYPE=hadoop sbt "$WUNUSED" "WorkflowExecutionService/testOnly org.apache.texera.amber.engine.e2e.DataProcessingSpec -- -z headerlessMultiLineDataCsv"
sbt "$WUNUSED" Observability/test NotebookMigrationService/test "WorkflowOperator/testOnly org.apache.texera.amber.operator.source.scan.*"
sbt "$WUNUSED" "WorkflowExecutionService/testOnly org.apache.texera.amber.engine.architecture.coordinator.promisehandlers.ConsoleMessageHandlerSpec org.apache.texera.amber.engine.architecture.messaginglayer.WorkerTimerServiceSpec org.apache.texera.amber.engine.architecture.worker.DPThreadSpec org.apache.texera.amber.engine.architecture.worker.DataProcessorRPCHandlerInitializerSpec org.apache.texera.amber.engine.architecture.worker.DataProcessorSpec org.apache.texera.amber.engine.architecture.worker.WorkerSpec org.apache.texera.amber.engine.architecture.worker.WorkflowWorkerSpec org.apache.texera.amber.engine.architecture.worker.managers.StatisticsManagerSpec org.apache.texera.amber.engine.architecture.worker.managers.WorkerManagersSpec org.apache.texera.amber.engine.architecture.worker.promisehandlers.EndChannelHandlerSpec org.apache.texera.amber.engine.architecture.worker.promisehandlers.EndHandlerSpec org.apache.texera.amber.engine.architecture.worker.promisehandlers.FinalizeCheckpointHandlerSpec org.apache.texera.amber.engine.architecture.worker.promisehandlers.StartChannelHandlerSpec org.apache.texera.amber.engine.architecture.worker.promisehandlers.StartHandlerSpec org.apache.texera.amber.engine.common.UtilsSpec org.apache.texera.amber.engine.faulttolerance.CheckpointSpec org.apache.texera.web.observability.WorkflowMetricsRecorderSpec"
sbt "$WUNUSED" "WorkflowExecutionService/testOnly org.apache.texera.web.resource.dashboard.DatasetSearchQueryBuilderSpec org.apache.texera.web.resource.dashboard.DashboardResourceSpec org.apache.texera.web.resource.dashboard.admin.user.AdminUserResourceSpec org.apache.texera.web.resource.dashboard.hub.HubResourceSpec org.apache.texera.web.ComputingUnitMasterSpec org.apache.texera.web.ComputingUnitWorkerSpec"
sbt "$WUNUSED" "WorkflowExecutionService/testOnly org.apache.texera.web.resource.dashboard.DatasetSearchQueryBuilderSpec org.apache.texera.web.resource.dashboard.ModelSearchQueryBuilderSpec org.apache.texera.web.resource.dashboard.VersionedResourceTablesSpec org.apache.texera.web.resource.dashboard.DashboardResourceSpec org.apache.texera.web.resource.dashboard.hub.EntityTablesSpec org.apache.texera.web.resource.dashboard.hub.HubEntityModelSpec org.apache.texera.web.resource.dashboard.hub.HubResourceSpec"
sbt WorkflowCore/scalafmtCheckAll WorkflowOperator/scalafmtCheckAll WorkflowExecutionService/scalafmtCheckAll Observability/scalafmtCheckAll NotebookMigrationService/scalafmtCheckAll "WorkflowCore/scalafixAll --check" "WorkflowOperator/scalafixAll --check" "WorkflowExecutionService/scalafixAll --check" "Observability/scalafixAll --check" "NotebookMigrationService/scalafixAll --check"
```

- JUnit XML, compared per test:
- First commit: the first three test commands and the e2e case run 36
suites that load every file the commit changes, and
`SQLSourceOpExecSpec` calls `fetchBatchByBoundary` for each numeric type
through a mocked JDBC result. All 554 tests pass on `main` and all 553
with the commit. Each test has the same outcome as on `main`; the
missing one is the removed `asterixDBSourceOpDesc` case.
- Second commit: the fourth command runs the 20 suites that load the
account, notification, dashboard-search and Hub code, against an
embedded PostgreSQL. All 525 tests pass before and after the commit,
each with the same outcome.
- Third commit: the sixth and seventh test commands run every
`Observability`, `NotebookMigrationService` and scan-source suite, plus
the worker, statistics, checkpoint and telemetry suites that load the
changed classes. Before and after it, 581 of the 595 tests in these 48
suites pass, each with the same outcome. The other 14 fail on both sides
on this machine: 13 `ParquetScanSourceOpDescSpec` cases need Hadoop's
Windows binaries, and one `FileScanSourceOpDescSpec` case hits a Windows
temp-file lock.
- Fourth commit: the eighth test command runs the six suites it touches.
All 179 tests pass, the three new ones included.
- Fifth commit: the ninth test command runs the seven suites that load
`VersionedResourceTables` or the Hub query. All 182 tests pass.
- On the second commit's head, all 55 suites of the first two rounds
pass, the e2e case included: 1,059 tests.
- `S3StorageClientSpec` runs its 34 cases against RustFS 1.0.0 in
Testcontainers on both sides. They include a 6 MiB upload (a 5 MiB part
and a 1 MiB tail) that downloads back byte for byte, an empty upload,
and the abort when the input stream fails after the first part.
- With the fixture pointed back at `country_sales_headerless_small.csv`,
the strengthened `CSVScanSourceOpDescSpec` case fails: row 8 reads
`Republic of the Congo` instead of `Republic,of,the,Congo`. The
`DataProcessingSpec` case runs the multi-line file through the engine
and gets the same 100 rows that the single-line file gives on `main`.
- scalafmt and scalafix pass on all five touched modules.
- With `-Wunused:patvars,params,privates`, the compiler reports 26
unused names in the files of the first commit on `main`. That commit
removes 24 of them. The other two are `config` and `cr`, which the
`@OnOpen` and `@OnClose` methods of `WorkflowWebsocketResource` need for
the WebSocket API's signatures; they are reported on both.

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

Generated-by: Claude Code (Claude Opus 5.5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common ddl-change Changes to the TexeraDB DDL dependencies Pull requests that update a dependency file platform Non-amber Scala service paths

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Notebook Migration] Resolve Jupyter URL and token per user

4 participants