The GitHub Actions job "Build and push images" on texera.git/main has failed.
Run started by GitHub user bobbai00 (triggered by bobbai00).

Head commit for run:
2fbe37ab7185cf7ed411ad8d933d8294cbc049fa / Jaeyun Kim 
<[email protected]>
feat: add affiliation attribute to user (#4113)

# What changes were proposed in this PR?
## Summary
To gather more user information for a better overview of users, this PR
introduces a new column `affiliation` to the `user` table. Now when a
user logins to the Texera for the first time (after getting approved to
REGULAR role), they will be prompted to enter their affiliation. The
answer will be recorded to the database and retrieved when admins enter
the admin dashboard.

## For Developers
Please do the following steps to incorporate with new changes:
- Apply sql/updates/16.sql to your local postgres instance
- Run
common/dao/src/main/scala/org/apache/texera/dao/JooqCodeGenerator.scala
to generate jooq tables

## Sample Video


https://github.com/user-attachments/assets/61e895db-8e30-4c59-8e98-fa527995b486


## Design of the Feature
When a user logins to the system for the first time, they will be
prompted to enter their affiliation after getting approved to REGULAR
role. The user can submit their affiliation and the frontend would send
this information to the backend to save in the database. Users can
choose to either enter the affiliation or skip the prompt and the system
would remember if the user has been prompted or not by checking the user
data from the database. Depending on the user's answer, the
`affiliation` column would have different data (more details are
included in "Backend Changes"). The system would only prompt once when
the user logins to the system for the first time and would never ask
again. To view the affiliation information, admins can go to the admin
dashboard to view the affiliations of users.

## Backend Changes
Introduced column `affiliation` to the `user` table. This column would
have three types of entry:
1. null: Indicates the user has never been prompted before. Next time
when the user logins to the system, they will be prompted to answer the
affiliation question.
2. emptry string "": the user has been prompted and did not answer the
affiliation question. This is to indicate that the user did not answer
this question (whether by hitting the skip button, ESC, X, or pressing
spaces outside of the prompt).
3. Actual value.
`16.sql` adds the column to the `user` table and ensures the existing
users' affiliation column is set to null. ddl file changed as well.

Added a `UserResource.scala` file to include the functions/apis related
to retrieving & updating User data. Currently it only contains functions
related to this PR, but in future other related functions can be added
to this file as well.

### Original `user` Schema
<img width="300" height="400" alt="image"
src="https://github.com/user-attachments/assets/5be89398-583e-486c-96af-448fffbbf2d5";
/>

### Proposed `user` Schema
<img width="300" height="400" alt="image"
src="https://github.com/user-attachments/assets/b1522ce0-f905-4865-a62d-813770eef3d7";
/>

## Frontend Changes
Added the prompt window to pop up in the main page after logging in. 
Added `affiliation` column to admin dashboard to cooperate with the new
data.
Changed files that contain class `User` as new attribute `affiliation`
is added to the class.

### Any related issues, documentation, discussions?
<!--
Please use this section to link other resources if not mentioned
already.
1. If this PR fixes an issue, please include `Fixes #1234`, `Resolves
#1234`
or `Closes #1234`. If it is only related, simply mention the issue
number.
  5. If there is design documentation, please add the link.
  6. If there is a discussion in the mailing list, please add the link.
-->
Closes Issue #4118.

### How was this PR tested?
<!--
If tests were added, say they were added here. Or simply mention that if
the PR
is tested with existing test cases. Make sure to include/update test
cases that
check the changes thoroughly including negative and positive cases if
possible.
If it was tested in a way different from regular unit tests, please
clarify how
you tested step by step, ideally copy and paste-able, so that other
reviewers can
test and check, and descendants can verify in the future. If tests were
not added,
please describe why they were not added and/or why it was difficult to
add.
-->
Manually tested.

### Was this PR authored or co-authored using generative AI tooling?
<!--
If generative AI tooling has been used in the process of authoring this
PR,
please include the phrase: 'Generated-by: ' followed by the name of the
tool
and its version. If no, write 'No'. 
Please refer to the [ASF Generative Tooling
Guidance](https://www.apache.org/legal/generative-tooling.html) for
details.
-->
Generated-by: ChatGPT 5.1 (bug fixing)

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

With regards,
GitHub Actions via GitBox

Reply via email to