Skip to content
Snippets Groups Projects

Backend changes to add User Job Title

Merged Aishwarya Subramanian requested to merge add-user-job-title-column into master
All threads resolved!

What does this MR do?

This MR adds support for User Job title to be used in User Profile pages.

  1. Adds a new column job_title in users table
  2. Controller changes to permit and save job_title. UI related changes for this column to be added in !25155 (merged)
  3. Ability to retrieve job_title through User apis
  4. Updates api documentation

Test cases:

Workflow Expected Status
User updates job_title through Settings page Stores job_title in db
    User visits Settings page Display job_title if present
      User retrieve api: /api/v4/users/1 Return 'job_title' value as appropriate

        Closes #207043 (closed)

        Screenshots

        Does this MR meet the acceptance criteria?

        Conformity

        Availability and Testing

        Security

        If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

        • Label as security and @ mention @gitlab-com/gl-security/appsec
        • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
        • Security reports checked/validated by a reviewer from the AppSec team
        Edited by Aishwarya Subramanian

        Merge request reports

        Loading
        Loading

        Activity

        Filter activity
        • Approvals
        • Assignees & reviewers
        • Comments (from bots)
        • Comments (from users)
        • Commits & branches
        • Edits
        • Labels
        • Lock status
        • Mentions
        • Merge request status
        • Tracking
      • assigned to @asubramanian1 and unassigned @jarka

        • Resolved by Aishwarya Subramanian

          Thanks @asubramanian1, left a few questions.

          Generally I'd like to avoid adding more DB columns to users table. The table grows rapidly (column and record count). Most of the columns are used quite rarely, however we still have to load them from the DB and allocate ruby objects for them whenever we use User.find.

          job_title would be used only at a few places and each of them are quite "simple":

          • Popover (JSON request per user)
          • User's profile page (HTML)
          • API: singular (show) and collection (index) requests

          Similar MR: !20254 (comment 281455431)

          I already started working on a migration (!25519 (closed)), however it might take a while and I don't want to be a blocker...

          My proposal:

          Create a new table user_details, you can just take the migration from my MR and add only two fields: user_id and job_title. On the application level we could use delegation to assign the form value to the user_detail association. I think we do something similar with user_preference association.

          What do you think?

          Edited by Adam Hegyi
      • unassigned @ahegyi

      • added 1 commit

        • 0189654c - Apply suggestion to spec/requests/api/users_spec.rb

        Compare with previous version

      • added 1 commit

        • d1fcd333 - Apply suggestion to spec/requests/api/users_spec.rb

        Compare with previous version

      • added 1 commit

        Compare with previous version

      • added 1 commit

        Compare with previous version

      • added 1 commit

        Compare with previous version

      • added 1 commit

        Compare with previous version

      • added 1 commit

        Compare with previous version

      • added 1 commit

        Compare with previous version

      • added 351 commits

        Compare with previous version

      • added 13 commits

        Compare with previous version

      • added 1 commit

        Compare with previous version

      • Aishwarya Subramanian changed the description

        changed the description

      • assigned to @ahegyi and unassigned @asubramanian1

      • Aishwarya Subramanian changed the description

        changed the description

      • Aishwarya Subramanian marked the checklist item Code review guidelines as completed

        marked the checklist item Code review guidelines as completed

      • Aishwarya Subramanian changed the description

        changed the description

      • added 163 commits

        Compare with previous version

      • added 1 commit

        Compare with previous version

      • Adam Hegyi
      • Adam Hegyi
      • Adam Hegyi assigned to @asubramanian1 and unassigned @ahegyi

        assigned to @asubramanian1 and unassigned @ahegyi

      • added 1 commit

        Compare with previous version

      • assigned to @ahegyi and unassigned @asubramanian1

      • added databaseapproved label and removed databasereviewed label

      • Adam Hegyi approved this merge request

        approved this merge request

      • unassigned @ahegyi

      • added 1 commit

        Compare with previous version

      • Aishwarya Subramanian resolved all threads

        resolved all threads

      • Aishwarya Subramanian resolved all threads

        resolved all threads

      • assigned to @jarka and unassigned @asubramanian1

      • Jarka Košanová
      • assigned to @asubramanian1 and unassigned @jarka

      • added 1 commit

        Compare with previous version

      • assigned to @jarka and unassigned @asubramanian1

      • Jarka Košanová resolved all threads

        resolved all threads

      • Jarka Košanová enabled an automatic merge when the pipeline for 8bd9ab21 succeeds

        enabled an automatic merge when the pipeline for 8bd9ab21 succeeds

      • Thanks @asubramanian1 . MWPS set.

      • mentioned in commit 61cec768

      • added workflowcanary label and removed workflowstaging label

      • added workflowproduction label and removed workflowcanary label

      • mentioned in issue #24072 (closed)

      • Please register or sign in to reply
        Loading