Make committer email be configurable for groups or projects
Problem to solve
A not uncommon scenario might be that you have a single user account for both work and personal projects, that has all relevant email addresses (work/private). Commits to work projects should use work email, and private email for personal projects. Setting this correctly in Git is not hard with git config
.
The problem is, using any Web UI related feature might use an incorrect email address. Web IDE, squash commits, edit file and more all use the Commit email
address, which might not match preferred one in a project. This can be compounded by Push rules, where e.g. a work project might enforce a specific commit email to be used, leading to these features to be unusable.
Target audience
-
Delaney, Development Team Lead, https://design.gitlab.com/research/personas#persona-delaney
-
Sasha, Software Developer, https://design.gitlab.com/research/personas#persona-sasha
Further details
Changing the notification email for groups/projects seems kind of similar to this use case. It would be great to keep both in mind when designing how this feature should look.
Proposal
New "Emails > Commit emails" section in User settings
-
Commit emails
is a new section in "Emails" - Default commit email setting is moved from Profile over to this area.
- Could be moved to a separate MR if we want to reduce scope. The idea of this move is to group all things related to commit emails in one spot.
- "Custom commit emails" is the section in the "Commit emails" section that allows users to link a commit email to a group or project.
- Custom emails are displayed in separate lists for group and project.
- When adding or editing a custom commit email you can search for a group or project in the filter dropdown. This is used elsewhere in GitLab.
- Using a modal to present the user a way to enter details of the custom commit email
- Only verified emails should be listed in the dropdown selection for commit email.
- To reduce scope of this issue, I would be ok with not having an
edit
functionality and requiring the user to delete an existing custom commit email and adding a new one for editing.
Display of commit email when committing via UI
In areas where the user is committing code changes we would need to make it visible which email account they are committing with.
We should only display this if there are one or more custom commit emails set.
Further considerations
In the initial proposal, there was the idea of adding a widget at the project overview level to display/change the email:
I don't think there is a section for user specific settings on projects currently, so I don't know exactly where this fits. The only setting I can think of is the notification setting, that is user specific. Changing commit email for the project could exist in a similar UI widget as notifications.
This could explored further perhaps as a global user nav element if we want to increase visibility and/or if we want to increase ease of changing emails #26710 (comment 1204676431).
Links / references
- Figma: Design