ZIm/crates/collab/src/db/tables
Kirill Bulatov 0199eca289
Allow filling co-authors in the git panel's commit input (#23329)
https://github.com/user-attachments/assets/78db908e-cfe5-4803-b0dc-4f33bc457840


* starts to extract usernames out of `users/` GitHub API responses, and
pass those along with e-mails in the collab sessions as part of the
`User` data

* adjusts various prefill and seed test methods so that the new data can
be retrieved from GitHub properly

* if there's an active call, where guests have write permissions and
e-mails, allow to trigger `FillCoAuthors` action in the context of the
git panel, that will fill in `co-authored-by:` lines, using e-mail and
names (or GitHub handle names if name is absent)

* the action tries to not duplicate such entries, if any are present
already, and adds those below the rest of the commit input's text

Concerns:

* users with write permissions and no e-mails will be silently omitted
— adding odd entries that try to indicate this or raising pop-ups is
very intrusive (maybe, we can add `#`-prefixed comments?), logging seems
pointless

* it's not clear whether the data prefill will run properly on the
existing users — seems tolerable now, as it seems that we get e-mails
properly already, so we'll see GitHub handles instead of names in the
worst case. This can be prefilled better later.

* e-mails and names for a particular project may be not what the user
wants.
E.g. my `.gitconfig` has
```
[user]
    email = mail4score@gmail.com

# .....snip

[includeif "gitdir:**/work/zed/**/.git"]
    path = ~/.gitconfig.work
```

and that one has

```
[user]
    email = kirill@zed.dev
```

while my GitHub profile is configured so, that `mail4score@gmail.com` is
the public, commit e-mail.

So, when I'm a participant in a Zed session, wrong e-mail will be
picked.
The problem is, it's impossible for a host to get remote's collaborator
git metadata for a particular project, as that might not even exist on
disk for the client.

Seems that we might want to add some "project git URL <-> user name and
email" mapping in the settings(?).
The design of this is not very clear, so the PR concentrates on the
basics for now.

When https://github.com/zed-industries/zed/pull/23308 lands, most of the
issues can be solved by collaborators manually, before committing.

Release Notes:

- N/A
2025-01-18 22:57:17 +02:00
..
access_token.rs For impersonating access tokens, store impersonatee in the new column 2024-01-17 18:06:16 -08:00
billing_customer.rs collab: Rework Stripe event processing (#15510) 2024-07-30 16:35:11 -04:00
billing_preference.rs collab: Add billing preferences for maximum LLM monthly spend (#18948) 2024-10-09 16:29:07 -04:00
billing_subscription.rs collab: Record cancellation reason on billing subscriptions (#22853) 2025-01-08 19:38:10 +00:00
buffer.rs Denormalize buffer operations (#9026) 2024-03-07 11:35:47 -07:00
buffer_operation.rs Simplify buffer_operations schema 2023-08-23 18:37:01 -07:00
buffer_snapshot.rs Snapshot channel notes buffers when everyone leaves 2023-08-23 18:37:01 -07:00
channel.rs Fix slow query for fetching descendants of channels (#7008) 2024-01-29 13:24:59 -08:00
channel_buffer_collaborator.rs WIP 2023-08-23 18:34:43 -07:00
channel_chat_participant.rs Start work on restoring server-side code for chat messages 2023-09-07 16:32:49 -07:00
channel_member.rs Ignore old admin column 2023-10-13 14:08:40 -06:00
channel_message.rs Channel chat: Add edit message (#9035) 2024-03-19 19:49:04 -06:00
channel_message_mention.rs Persist chat mentions 2023-10-18 16:56:03 -07:00
contact.rs Reorganize source files of collab::db 2023-08-18 16:23:33 -07:00
contributor.rs Add REST APIs for getting and adding contributors 2024-01-22 10:48:33 -08:00
embedding.rs Semantic Index (#10329) 2024-04-12 11:40:59 -06:00
extension.rs Add an extensions API to the collaboration server (#7807) 2024-02-15 12:53:57 -08:00
extension_version.rs Add telemetry events for loading extensions (#9793) 2024-03-25 17:30:48 -04:00
feature_flag.rs collab: Allow enabling feature flags for all users (#16372) 2024-08-16 15:17:03 -04:00
follower.rs Undo making project optional on stored follower states 2023-09-28 14:21:44 -07:00
language_server.rs Reorganize source files of collab::db 2023-08-18 16:23:33 -07:00
notification.rs Generalize notifications' actor id to entity id 2023-10-17 10:34:50 -07:00
notification_kind.rs Make notification db representation more flexible 2023-10-12 17:42:32 -07:00
observed_buffer_edits.rs Avoid N+1 query for channels with notes changes 2023-10-02 15:58:34 -07:00
observed_channel_messages.rs Add database implementation of channel message change tracking 2023-10-01 22:32:11 -07:00
processed_stripe_event.rs collab: Rework Stripe event processing (#15510) 2024-07-30 16:35:11 -04:00
project.rs Remove hosted projects (#19754) 2024-10-27 19:44:21 -07:00
project_collaborator.rs Reorganize source files of collab::db 2023-08-18 16:23:33 -07:00
rate_buckets.rs Allow AI interactions to be proxied through Zed's server so you don't need an API key (#7367) 2024-03-19 19:22:26 +01:00
room.rs Remove environment guards (#7741) 2024-02-13 13:20:14 -07:00
room_participant.rs revert single channel click (#7738) 2024-02-13 12:53:49 -07:00
server.rs Reorganize source files of collab::db 2023-08-18 16:23:33 -07:00
signup.rs Reorganize source files of collab::db 2023-08-18 16:23:33 -07:00
user.rs Allow filling co-authors in the git panel's commit input (#23329) 2025-01-18 22:57:17 +02:00
user_feature.rs Update database and RPC to provide configured feature flags 2023-08-25 14:34:32 -07:00
worktree.rs Reorganize source files of collab::db 2023-08-18 16:23:33 -07:00
worktree_diagnostic_summary.rs Reorganize source files of collab::db 2023-08-18 16:23:33 -07:00
worktree_entry.rs Show project panel symlink icons for remote clients (#19464) 2024-10-19 19:44:47 +03:00
worktree_repository.rs Reorganize source files of collab::db 2023-08-18 16:23:33 -07:00
worktree_repository_statuses.rs Represent git statuses more faithfully (#23082) 2025-01-16 00:01:38 +00:00
worktree_settings_file.rs Prepare to sync other kinds of settings (#18616) 2024-10-02 22:00:40 +03:00