The GitHub Actions job "Required Checks" on 
texera.git/backport/6402-add-user-email-as-part-of-registration-i-v1.2 has 
failed.
Run started by GitHub user Yicong-Huang (triggered by Yicong-Huang).

Head commit for run:
aecee945f34ff204463ed3cc8ec7eb3a64439c2c / Mrudhulraj 
<[email protected]>
fix(user): Add user email as part of registration in authentication  (#6402)

<!--
   Thanks for sending a pull request (PR)! Here are some tips for you:
1. If this is your first time, please read our contributor guidelines:
[Contributing to
Texera](https://github.com/apache/texera/blob/main/CONTRIBUTING.md)
     2. Ensure you have added or run the appropriate tests for your PR
     3. If the PR is work in progress, mark it a draft on GitHub.
4. Please write your PR title to summarize what this PR proposes, we
       are following Conventional Commits style for PR titles as well.
5. Be sure to keep the PR description updated to reflect all changes.
   -->

   ### What changes were proposed in this PR?

PR fixes a bug local-account registration where the user's email was
silently being dropped.
   Two layers were silently dropping the email:

   | Layer | Before | After |
   | --- | --- | --- |
| Frontend Sign Up form | No email input | New required email input with
format validation |
| `auth.service.ts → POST /auth/register` | Sent `{ username, password
}` | Sends `{ username, email, password }` |
| `UserRegistrationRequest` (Scala case class) | `(username, password)`
| `(username, email, password)` |
| `AuthResource.register` | `user.setEmail(username)` |
`user.setEmail(request.email)` |

Before, every locally-registered user had `email = username` in the
database,
because the request DTO had no `email` field and the resource fell back
to
`setEmail(username)`. After this PR, the user-entered email is what
lands in
   the `user.email` column.

   Frontend-side, the new `registerEmail` form control uses
`[Validators.required, Validators.email]`. A new
`UserService.validateEmail`
does a defensive non-empty + regex check before the request is sent. A
new
`#emailErrorTip` template renders "Please input your email." messages on
the Sign Up tab.

   Before-After user registration:

   UI changes before:
<img width="1500" height="800" alt="sign up page"
src="https://github.com/user-attachments/assets/d8b0b2e4-117b-4bb4-8a28-162155358b6c";
/>

 After entering the user-email as part of the sign-up in the forms:
<img width="1500" height="800" alt="User Registration post fix"
src="https://github.com/user-attachments/assets/b8cff507-d907-47b8-af95-3d3e8c32d046";
/>

`newUser` Registered with email post-fix; `testUser` (pre-fix) was
registered without an email and the email field is filled with the
Username :

<img width="1913" height="286" alt="admin page post fix"
src="https://github.com/user-attachments/assets/e3dca870-bf72-4e9b-a23f-46e64f8870ca";
/>

   ### Any related issues, documentation, discussions?

   Fixes #6559

   ### How was this PR tested?

   Unit tests (frontend, `local-login.component.spec.ts`):

   - `requires registerEmail and enforces email format` — covers the
`Validators.required` and `Validators.email` behavior on
`registerEmail`.
   - `register › sets registerErrorMessage when the email is empty`
   - `register › sets registerErrorMessage when the email is malformed`

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

 <!--
Choose one and delete the other. Per ASF guidance, if generative AI
tooling
 helped author this PR, include `Generated-by: <tool> <version>`.

 TODO: replace with one of the two lines below.
 -->
 Yes for frontend forms and testing. Backend was fixed manually.

(backported from commit bf25dd2d47ab7ea7bcbd4bb7b7e9e1f41ec195eb)

Co-authored-by: Yicong Huang <[email protected]>

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

With regards,
GitHub Actions via GitBox

Reply via email to