The GitHub Actions job "Required Checks" on texera.git/task/migrateBackend has 
succeeded.
Run started by GitHub user Yicong-Huang (triggered by Yicong-Huang).

Head commit for run:
75a8af14b2da34705ff8fe3ae6f18462581329ce / Yicong Huang 
<[email protected]>
fix(amber): normalize login handles in migration 33 instead of refusing

The migration raised `RAISE EXCEPTION` when any password-holding account's name
was blank, whitespace-padded, or shared with another. Those are reachable states
today — `AdminUserResource.updateUser` writes `user.getName` through without
trimming, and nothing has ever constrained `"user".name` to be unique — so a
single such row turned changeset 33 into a failed liquibase changeset and a
deployment that cannot start until an operator hand-edits the database.

Nothing about minting a handle for the first time requires the old name to be
clean, so it is normalized: trimmed, replaced by `user-<uid>` when trimming
leaves nothing, and suffixed with `-<uid>` when it still collides (the lowest
uid keeps the unsuffixed form). The de-duplication runs inside the filling
UPDATE rather than only in the following pass, because `uq_provider_identity` is
already in force and two accounts named "john" otherwise collide with each other
within that single statement. The bounded loop then resolves a suffixed handle
that collides with a literal one, following 28.sql's dataset-name precedent.

The LOCAL backfill now inserts the row without a handle and lets that UPDATE
mint it, since NULLs do not collide under the unique constraint — inserting the
raw name would abort before any normalization could run.

Every minted handle that differs from the account name is reported via
RAISE NOTICE, with a closing count: the handle is what the user types to log in,
so an operator must be able to see which accounts got one they cannot guess.

Verified against embedded Postgres on three paths — an old-schema database
seeded with all of the previously-fatal shapes (padded, blank, three-way
duplicate, and a trim that creates a fresh collision), a re-run over the
already-migrated result, and a database built from this PR's own DDL. All three
commit; afterwards no LOCAL row has a null or duplicated handle, every GOOGLE
row still carries its original google_id verbatim, and ck_provider_credential
holds.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

Report URL: https://github.com/apache/texera/actions/runs/31419529282

With regards,
GitHub Actions via GitBox

Reply via email to