Skip to content

feat(frontend): ask an account with no email address for one at sign-in - #7758

Merged
aglinxinyuan merged 7 commits into
apache:mainfrom
Neilk1021:task/emailVerification
Aug 21, 2026
Merged

aglinxinyuan merged 7 commits into
apache:mainfrom
Neilk1021:task/emailVerification

Conversation

@Neilk1021

@Neilk1021 Neilk1021 commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Convert.to.GIF.project.-.August.18.2026.at.11.30.35.mp4

TL;DR

Email is identity in Texera: dataset storage paths are built from it and every access grant names one. Local and Google login both guarantee an address, so nothing has ever had to ask for one, but a guaranteed address is the exception among login providers, not the norm. Adding ORCID (or any provider that authenticates someone without asserting an address) would today produce an account that cannot be shared with. This PR adds the remedy such a provider would reuse, and closes the one hole that already exists.

New Process

Before:  sign in -> token without email claim -> user with no address, sharing silently broken
After:   sign in -> token without email claim -> modal (Save | Sign out) -> reissued token -> user

AuthService.loginWithExistingToken now hands out no User at all while the stored token's email claim is empty, so an addressless account cannot reach the app in a half-working state. The prompt is not dismissable — cancelling signs out — mirroring how the invite-only registration request already behaves.

Backend — PUT /auth/email (AuthResource)

Takes the address for whichever account the request is authenticated as; there is no uid in the body. The row is re-read inside the transaction, because the pojo on the session was built from the token and is not evidence about the row as it stands now.

Address belongs to Outcome
nobody written to the caller's row
a contributor placeholder placeholder adopted — credential moves onto it, caller's row is dropped
a real account 409, "sign in to that account instead"
the caller, already set 409, an address cannot be replaced through this endpoint

Adoption keeps the placeholder's uid, because dataset contributor rows already reference it; re-pointing those instead would mean touching every table that FKs to "user". This mirrors what register already does when a registration presents a placeholder's address. It is refused unless the caller is an empty INACTIVE account and the placeholder holds no credential of its own.

Backend — AdminUserResource

addUser was the one path that wrote a credential without an address, so it was the source of the addressless rows in the first place. It now inserts a bare INACTIVE row and no credential at all.

Before After
addUser row + LOCAL credential, no email row only
updateUser, blank email, role ≠ INACTIVE activated an unreachable account 400
updateUser, blank email over an existing one silently cleared the address 400

The row is deliberately not marked is_placeholder, though an unclaimed stub is arguably what it is: DatasetAccessResource refuses to share with a placeholder, so an admin could no longer pre-share with an address before its owner first signs in.

Frontend

  • EmailRequestModalComponent — the prompt itself: who you are signed in as, why the address is needed, one input.
  • AuthService — setEmail(), promptForEmail() (re-entry guarded, so a second prompt cannot stack), and a sessionChanged() observable. Both outcomes announce themselves through it: a save replaces the token, a cancel throws it away, and either way the current user has to be re-derived.
  • UserService — subscribes to sessionChanged() and re-derives, which is what makes the user appear behind the modal on save and disappear on cancel.
  • util/email.ts — validateEmailFormat, now shared by registration and the prompt. It lives outside both services because they import each other's module. Authoritative validation stays on the backend (EmailUtil.isValid); this only catches the typo before a round trip.

Scope note: this is groundwork. With local and Google login it is unreachable by design — the only accounts that reach it today are the addressless rows older deployments still carry from the previous addUser. It is live code on a rare path, not dead code, and it is the path a future provider plugs into.

Any related issues, documentation, discussions?

Closes #7757

How was this PR tested?

Added coverage on both sides, positive and negative:

  • AuthResourceSpec — each row of the table above: a fresh address is stored and comes back in the reissued token's claim; placeholder adoption (credential moved, caller's row and its user_last_active_time gone, placeholder uid kept, and again with a caller that has an activity row); a placeholder holding its own credential refused; an address owned by a real account refused; an address already set refused; a caller no longer INACTIVE refused; blank and malformed input refused.
  • AdminUserResourceSpec — addUser writes no credential and does not mark the row a placeholder; both updateUser guards; and an emailless account that stays INACTIVE is still editable, so the guards don't over-fire.
  • auth.service.spec.ts — prompt opens only when the claim is absent, does not stack, precedes the invite-only branch, stores the reissued token and emits sessionChanged, keeps the dialog open and reports why on refusal, rejects a malformed address without calling the backend, signs out on cancel, and can prompt again afterwards.
  • email-request-modal.component.spec.ts, user.service.spec.ts — the modal's own contract and the re-derive subscription.
sbt 'WorkflowExecutionService/testOnly *AuthResourceSpec *AdminUserResourceSpec'
# Tests: succeeded 67, failed 0

cd frontend && npx ng test \
  --include src/app/common/service/user/auth.service.spec.ts \
  --include src/app/common/service/user/user.service.spec.ts \
  --include src/app/common/service/user/email-request-modal/email-request-modal.component.spec.ts
# Test Files 3 passed | Tests 52 passed

Manually, on the local dev stack (Chrome, bin/local-dev.sh up) — no login provider issues an addressless token yet, so the account has to be put in that state directly:

# a local account, then take its address away
curl -s -X POST http://localhost:8080/api/auth/register -H 'Content-Type: application/json' \
  -d '{"username":"jsmith","email":"[email protected]","password":"password"}'
docker exec texera-postgres psql -U texera -d texera_db \
  -c "UPDATE texera_db.\"user\" SET name = 'Jane Smith', email = NULL WHERE name = 'jsmith';"

Sign in as jsmith / password at localhost:4200:

Step Expected
sign in prompt appears, greets "Jane Smith", no close button, mask does not dismiss
Save bad@@x client-side error, dialog stays open, no request sent
Save an address another account owns 409 surfaced in the dialog, stays open
Save a free address dialog closes, dashboard loads as that user
re-run the UPDATE, sign in, Sign out returns to the login page, token cleared

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

Co-Authored with Claude [Generated-by: Claude Opus 5]

@github-actions github-actions Bot added engine frontend Changes related to the frontend GUI labels Aug 18, 2026
@github-actions

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

@github-actions

github-actions Bot commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Benchmark changes need a look

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

Compared against main d9e8636 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 403 0.246 24,094/32,619/32,619 us 🔴 +17.5% / 🔴 +117.5%
🟢 bs=100 sw=10 sl=64 935 0.571 104,522/151,062/151,062 us 🟢 -10.8% / 🔴 +42.4%
⚪ bs=1000 sw=10 sl=64 1,116 0.681 903,373/949,805/949,805 us ⚪ within ±5% / 🟢 -8.6%
Baseline details

Latest main d9e8636 from same runner

config metric PR latest main 7d avg Δ latest Δ 7d
bs=10 sw=10 sl=64 throughput 403 tuples/sec 451 tuples/sec 780.31 tuples/sec -10.6% -48.4%
bs=10 sw=10 sl=64 MB/s 0.246 MB/s 0.275 MB/s 0.476 MB/s -10.5% -48.3%
bs=10 sw=10 sl=64 p50 24,094 us 20,497 us 12,590 us +17.5% +91.4%
bs=10 sw=10 sl=64 p95 32,619 us 33,235 us 14,995 us -1.9% +117.5%
bs=10 sw=10 sl=64 p99 32,619 us 33,235 us 19,141 us -1.9% +70.4%
bs=100 sw=10 sl=64 throughput 935 tuples/sec 923 tuples/sec 1,006 tuples/sec +1.3% -7.0%
bs=100 sw=10 sl=64 MB/s 0.571 MB/s 0.563 MB/s 0.614 MB/s +1.4% -7.0%
bs=100 sw=10 sl=64 p50 104,522 us 103,677 us 99,387 us +0.8% +5.2%
bs=100 sw=10 sl=64 p95 151,062 us 169,276 us 106,056 us -10.8% +42.4%
bs=100 sw=10 sl=64 p99 151,062 us 169,276 us 113,689 us -10.8% +32.9%
bs=1000 sw=10 sl=64 throughput 1,116 tuples/sec 1,113 tuples/sec 1,043 tuples/sec +0.3% +7.0%
bs=1000 sw=10 sl=64 MB/s 0.681 MB/s 0.68 MB/s 0.637 MB/s +0.1% +7.0%
bs=1000 sw=10 sl=64 p50 903,373 us 902,475 us 965,215 us +0.1% -6.4%
bs=1000 sw=10 sl=64 p95 949,805 us 937,745 us 1,009,610 us +1.3% -5.9%
bs=1000 sw=10 sl=64 p99 949,805 us 937,745 us 1,039,108 us +1.3% -8.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,496.20,200,128000,403,0.246,24094.19,32618.59,32618.59
1,100,10,64,20,2139.36,2000,1280000,935,0.571,104521.68,151061.82,151061.82
2,1000,10,64,20,17925.25,20000,12800000,1116,0.681,903372.69,949805.22,949805.22

@codecov-commenter

codecov-commenter commented Aug 18, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.57895% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.50%. Comparing base (d9e8636) to head (0de1688).

Files with missing lines Patch % Lines
...ontend/src/app/common/service/user/auth.service.ts 83.33% 4 Missing and 3 partials ⚠️
...l-request-modal/email-request-modal.component.html 54.54% 5 Missing ⚠️
...apache/texera/web/resource/auth/AuthResource.scala 88.88% 1 Missing and 2 partials ⚠️
frontend/src/app/common/util/email.ts 62.50% 1 Missing and 2 partials ⚠️
...ource/dashboard/admin/user/AdminUserResource.scala 90.90% 0 Missing and 1 partial ⚠️
...ail-request-modal/email-request-modal.component.ts 85.71% 0 Missing and 1 partial ⚠️
...d/src/app/common/service/user/stub-auth.service.ts 75.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #7758      +/-   ##
============================================
- Coverage     91.52%   91.50%   -0.03%     
- Complexity     4492     4500       +8     
============================================
  Files          1174     1177       +3     
  Lines         47390    47489      +99     
  Branches       5312     5324      +12     
============================================
+ Hits          43376    43454      +78     
- Misses         2355     2367      +12     
- Partials       1659     1668       +9     
Flag Coverage Δ *Carryforward flag
access-control-service 81.00% <ø> (ø) Carriedforward from d9e8636
agent-service 98.62% <ø> (ø) Carriedforward from d9e8636
amber 88.02% <89.47%> (-0.02%) ⬇️
computing-unit-managing-service 73.67% <ø> (ø) Carriedforward from d9e8636
config-service 86.73% <ø> (ø) Carriedforward from d9e8636
file-service 75.74% <ø> (ø) Carriedforward from d9e8636
frontend 93.23% <77.63%> (-0.05%) ⬇️
notebook-migration-service 79.13% <ø> (ø) Carriedforward from d9e8636
pyamber 97.57% <ø> (ø) Carriedforward from d9e8636
workflow-compiling-service 77.19% <ø> (ø) Carriedforward from d9e8636

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

@Neilk1021

Copy link
Copy Markdown
Contributor Author

/request-review @Yicong-Huang
/request-review @aglinxinyuan

@aglinxinyuan
aglinxinyuan requested a lite review from Copilot August 20, 2026 19:17

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 reached their quota limit.

Comment thread frontend/src/styles.scss Resolved
@aglinxinyuan
aglinxinyuan added this pull request to the merge queue Aug 21, 2026
Merged via the queue into apache:main with commit 2edbdf9 Aug 21, 2026
23 checks passed
renovate-bot pushed a commit to renovate-bot/apache-_-texera that referenced this pull request Sep 3, 2026
### What changes were proposed in this PR?

Closes apache#7516 by adding ORCID login as an optional feature, disabled by
default.


https://github.com/user-attachments/assets/3c1fe0f8-898b-4e22-b5ec-5a775042ed60

ORCID differs from the existing OIDC provider (Google) in two ways, and
those two differences drive
nearly all of this diff.

**1. No email address.** This PR uses ORCID's authorization-code flow
with the `/authenticate`
scope, which returns an iD and a name and no email. (ORCID does support
OpenID Connect — there's an
`openid` scope and an `id_token` — but even under `openid` it doesn't
assert an address.) Many
Texera features require a valid email, so an ORCID account is
provisioned `INACTIVE` with a NULL
email and the address is collected at first sign-in by the prompt that
apache#7758 already shipped:
`AuthService.loginWithExistingToken` hands out no user while the `email`
claim is null, and the
dialog it opens is not dismissable — cancelling signs out. This PR adds
no part of that flow and
changes none of it; it only produces the account shape the prompt was
built for.

The rules that prompt enforces (all existing `PUT /auth/email`
behaviour, listed here because they
are what makes an ORCID account safe to create without an address):

- an address held by an account that already has a credential
(LOCAL/Google/ORCID) is refused with 409
- an address held by a contributor placeholder is claimed: the ORCID
identity moves onto the
  placeholder's uid, and the row created at login is discarded
- an account that already has an address can't replace it

The attach is single-step, following repo precedent:
`AuthResource.register` already claims a
placeholder on an unverified, typed address, and there is no email
verification anywhere in the
codebase today. Adding verification is out of scope here but worth
doing.

**2. Not a single-step handoff.** Because this is a plain OAuth 2.0
authorization-code flow rather
than the OIDC path Google takes, login can't be resolved in one clean
step. The frontend gets a
dedicated callback component that resolves the code and passes it to the
backend before routing to
the homepage. The CSRF `state` parameter is now verified there — the
login page was already writing
it to `sessionStorage`, but nothing read it back.

- **`ExternalAuthProvisioner` gains a sibling entry point**, rather than
the existing one widening.
`ExternalProfile` keeps main's contract (`email: String`,
provider-verified), and a new
`ExternalIdentity(providerType, providerId, name)` covers a provider
that vouches for no address,
provisioned through `loginOrProvisionIdentityOnly`. Such a login is
deliberately never matched to
an existing account: the only address available for matching would be
one the user typed, and
linking on that is the takeover `ExternalProfile` warns about.
`GoogleAuthResource` is unchanged.
- **`refresh` no longer blanks a field the provider didn't assert.** A
returning ORCID login carries
no address, and by then the account may well have one collected through
the prompt.
- **`TexeraWebApplication`** registers the new resource.
- **`ConfigResource` / `GuiConfig`** carry the `orcidLogin` flag to the
login page.

### Config and how to enable

`user-sys.orcid.{clientId,clientSecret,baseUrl,redirectUri}`,
`GUI_LOGIN_ORCID_LOGIN`, and both k8s
values files. `baseUrl` defaults to the ORCID sandbox. `GET
/auth/orcid/config` returns 503 when any
setting is missing, so the button stays disabled and no error toast
appears.

`redirectUri` is served to the login page by `GET /auth/orcid/config`
rather than derived in the
browser, so the authorize leg and the token exchange cannot disagree —
ORCID requires them to match
byte-for-byte.

Serving ORCID locally needs the dev server on the IPv4 loopback (`ng
serve --host 127.0.0.1`),
because ORCID rejects `localhost` as a registered redirect URI and `ng
serve` binds
`localhost`/`::1` by default. This is a per-developer flag, not a
repo-wide default: `angular.json`
is unchanged.


### Any related issues, documentation, discussions?
Closes apache#7516


### How was this PR tested?

New specs on both sides. The consent screen and token exchange are the
one part that cannot be unit
tested, so `exchangeCode` is a protected seam the specs override — as
`GoogleAuthResourceSpec` does
with `verifiedPayload` — and the real flow was driven by hand against
the ORCID sandbox.

- **`OrcidAuthResourceSpec` (new)**: provisioning from an authenticated
iD — emailless INACTIVE
account plus its `auth_provider` row, idempotent on a second login, the
iD standing in for a
private name. Refusals: a response naming no iD, a blank code, each
missing config setting.
- **`ExternalAuthProvisionerSpec`**: identity-only provisioning, two
emailless accounts staying
separate on a NULL email (`"user".email` is UNIQUE, which in Postgres
doesn't constrain repeated
  NULLs), and a later-collected address surviving a refresh.
- **`GoogleAuthResourceSpec` / `AuthResourceSpec`**: unchanged by this
PR, run as regression over
  the provisioning refactor.
- **Frontend**: `orcid-callback.component.spec.ts` (new) for the state
check and every refusal path;
`auth.service.spec.ts` for the `orcidAuth` endpoint and its error
propagation; the login page's
  redirect and button gating.

```
sbt "WorkflowExecutionService/testOnly org.apache.texera.web.resource.auth.*"
cd frontend && npx ng test --watch=false
sbt scalafmtCheckAll && cd frontend && npx tsc -p tsconfig.json --noEmit && yarn format:ci
```

By hand, against the ORCID sandbox. Register
`http://127.0.0.1:4200/callback/orcid` on a sandbox
application (ORCID rejects `localhost`), then:

```
export USER_SYS_ORCID_CLIENT_ID=APP-XXXXXXXXXXXX
export USER_SYS_ORCID_CLIENT_SECRET=...          # read once per JVM, so export before starting
export GUI_LOGIN_ORCID_LOGIN=true
bin/local-dev.sh up                              # migrations + jOOQ codegen
cd frontend && npx ng serve --host 127.0.0.1
```

Sign in with ORCID at `http://127.0.0.1:4200/login`, consent, supply an
address at the prompt, and
reload to confirm you are not asked again. Refusals: a tampered `state`
on the callback URL returns
you to `/login`; an address belonging to a credentialed account keeps
the dialog open. With the
credentials unset, the button stays disabled and no error toast appears.

**Migration**: applied to a database whose enum lacked `ORCID` under
both runners this repo uses
(`bin/local-dev.sh` keeps `SET search_path`; the Liquibase runner in
`sql/docker-compose.yml` strips
it, which is why the type is schema-qualified), then re-applied to
confirm idempotence.

### Was this PR authored or co-authored using generative AI tooling?
Co-Authored with Claude Opus 5

---------

Signed-off-by: Neil Ketteringham <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Co-authored-by: Yicong Huang <[email protected]>
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

engine frontend Changes related to the frontend GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add email modal for accounts without emails provided.

4 participants