zed/crates/collab/migrations
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
..
20210527024318_initial_schema.sql
20210607190313_create_access_tokens.sql
20210805175147_create_chat_tables.sql
20210916123647_add_nonce_to_channel_messages.sql
20210920192001_add_interests_to_signups.sql
20220421165757_drop_signups.sql
20220505144506_add_trigram_index_to_users.sql
20220506130724_create_contacts.sql
20220518151305_add_invites_to_users.sql
20220523232954_allow_user_deletes.sql
20220620211403_create_projects.sql
20220913211150_create_signups.sql
20220929182110_add_metrics_id.sql
20221111092550_reconnection_support.sql
20221125192125_add_added_to_mailing_list_to_signups.sql
20221207165001_add_connection_lost_to_room_participants.sql
20221213125710_index_room_participants_on_room_id.sql
20221214144346_change_epoch_from_uuid_to_integer.sql
20221219181850_project_reconnection_support.sql
20230103200902_replace_is_completed_with_completed_scan_id.sql
20230202155735_followers.sql
20230508211523_add-repository-entries.sql
20230511004019_add_repository_statuses.sql
20230529164700_add_worktree_settings_files.sql
20230605191135_remove_repository_statuses.sql
20230616134535_add_is_external_to_worktree_entries.sql
20230727150500_add_channels.sql
20230819154600_add_channel_buffers.sql
20230825190322_add_server_feature_flags.sql
20230907114200_add_channel_messages.sql
20230925210437_add_channel_changes.sql
20230926102500_add_participant_index_to_room_participants.sql
20231004130100_create_notifications.sql
20231009181554_add_release_channel_to_rooms.sql
20231010114600_add_unique_index_on_rooms_channel_id.sql
20231011214412_add_guest_role.sql
20231017185833_projects_room_id_fkey_on_delete_cascade.sql
20231018102700_create_mentions.sql
20231024085546_move_channel_paths_to_channels_table.sql
20240103025509_add_role_to_room_participants.sql
20240111085546_fix_column_name.sql Switch to non-destructive migration 2024-01-11 10:33:33 -08:00
20240117150300_add_impersonator_to_access_tokens.sql For impersonating access tokens, store impersonatee in the new column 2024-01-17 18:06:16 -08:00
20240122174606_add_contributors.sql Add REST APIs for getting and adding contributors 2024-01-22 10:48:33 -08:00
20240122224506_add_requires_zed_cla_column_to_channels.sql Add requires_zed_cla column to channels table 2024-01-22 16:41:24 -08:00
20240129193601_fix_parent_path_index.sql Fix slow query for fetching descendants of channels (#7008) 2024-01-29 13:24:59 -08:00
20240203113741_add_reply_to_message.sql Add the ability to reply to a message (#7170) 2024-02-06 13:22:54 -07:00
20240207041417_add_in_call_column_to_room_participants.sql single click channel (#7596) 2024-02-09 14:18:27 -07:00
20240213200201_remove_unused_room_columns.sql drop columns (#7742) 2024-02-14 14:30:48 -07:00
20240214102900_add_extensions.sql Add an extensions API to the collaboration server (#7807) 2024-02-15 12:53:57 -08:00
20240220234826_add_rate_buckets.sql 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
20240221151017_add_edited_at_field_to_channel_message.sql Channel chat: Add edit message (#9035) 2024-03-19 19:49:04 -06:00
20240226163408_hosted_projects.sql channel projects (#8456) 2024-02-26 22:15:11 -07:00
20240226164505_unique_channel_names.sql fix migration (#8451) 2024-02-26 13:50:26 -07:00
20240227215556_hosted_projects_in_projects.sql hosted projects (#8627) 2024-03-04 19:17:40 -07:00
20240307163119_denormalize_buffer_ops.sql Denormalize buffer operations (#9026) 2024-03-07 11:35:47 -07:00
20240315182903_non_null_channel_role.sql Finish migration to role instead of is_admin (#9414) 2024-03-15 13:04:48 -06:00
20240315183903_channel_parent_path_not_null.sql Finish migration to role instead of is_admin (#9414) 2024-03-15 13:04:48 -06:00
20240320124800_add_extension_schema_version.sql Add a schema to extensions, to prevent installing extensions on too old of a Zed version (#9599) 2024-03-20 17:33:26 -04:00
20240321162658_add_devservers.sql remoting (#9680) 2024-03-22 08:44:56 -06:00
20240335123500_add_extension_wasm_api_version.sql Add telemetry events for loading extensions (#9793) 2024-03-25 17:30:48 -04:00
20240402155003_add_dev_server_projects.sql WIP: remoting (#10085) 2024-04-11 15:36:35 -06:00
20240409082755_create_embeddings.sql Semantic Index (#10329) 2024-04-12 11:40:59 -06:00
20240412165156_dev_servers_per_user.sql remote projects per user (#10594) 2024-04-23 15:33:09 -06:00
20240417192746_unique_remote_projects_by_paths.sql remote projects per user (#10594) 2024-04-23 15:33:09 -06:00
20240502150229_rename_to_dev_server_projects.sql Rename RemoteProject -> DevServerProject (#11301) 2024-05-02 11:00:08 -06:00
20240502180204_remove_old_remote_projects.sql Slicker remote project creation (#11309) 2024-05-02 12:46:52 -06:00
20240514164510_store_ssh_connect_string.sql Support terminals with ssh in remote projects (#11913) 2024-05-17 17:48:07 +03:00
20240715230940_add_worktrees_to_dev_server_projects.sql remoting: Allow Add/Remove remote folder (#14532) 2024-07-16 12:01:59 -06:00
20240729170526_add_billing_subscription.sql collab: Add billing_subscriptions table (#15448) 2024-07-29 14:32:13 -04:00
20240730014107_add_billing_customer.sql collab: Add separate billing_customers table (#15457) 2024-07-29 22:48:21 -04:00
20240730122654_add_last_stripe_event_id.sql collab: Keep track of last seen Stripe event for each record (#15480) 2024-07-30 10:00:16 -04:00
20240730182554_add_processed_stripe_events.sql collab: Rework Stripe event processing (#15510) 2024-07-30 16:35:11 -04:00
20240731120800_add_stripe_cancel_at_to_billing_subscriptions.sql Allow users to stop a previously scheduled cancelation of their Zed Pro plan (#15562) 2024-07-31 16:36:46 -04:00
20240812073542_add_accepted_tos_at.sql assistant: Require user to accept TOS for cloud provider (#16111) 2024-08-12 17:43:35 +02:00
20240812204045_add_github_user_created_at_to_users.sql collab: Restrict usage of the LLM service to accounts older than 30 days (#16133) 2024-08-12 17:27:21 -04:00
20240816181658_add_enabled_for_all_to_feature_flags.sql collab: Allow enabling feature flags for all users (#16372) 2024-08-16 15:17:03 -04:00
20240822215737_add_unique_constraint_on_github_user_id_on_users.sql collab: Make users.github_user_id required and unique (#16704) 2024-08-22 18:27:22 -04:00
20240823155956_add_is_fifo_to_worktree_entries.sql Fix fifo files hanging the project wide search (#16039) 2024-08-26 10:40:20 -06:00
20241002120231_add_local_settings_kind.sql Prepare to sync other kinds of settings (#18616) 2024-10-02 22:00:40 +03:00
20241009190639_add_billing_preferences.sql collab: Add billing preferences for maximum LLM monthly spend (#18948) 2024-10-09 16:29:07 -04:00
20241019184824_adjust_symlink_data.sql Show project panel symlink icons for remote clients (#19464) 2024-10-19 19:44:47 +03:00
20241021202606_add_custom_llm_monthly_allowance_in_cents_to_users.sql collab: Add support for a custom monthly allowance for LLM usage (#19525) 2024-10-21 17:12:33 -04:00
20241023201725_remove_dev_servers.sql Migration to remove dev servers (#19639) 2024-10-30 11:55:55 -06:00
20250108184547_add_stripe_cancellation_reason_to_billing_subscriptions.sql collab: Record cancellation reason on billing subscriptions (#22853) 2025-01-08 19:38:10 +00:00
20250113230049_expand_git_status_information.sql Represent git statuses more faithfully (#23082) 2025-01-16 00:01:38 +00:00
20250117100620_add_user_name.sql Allow filling co-authors in the git panel's commit input (#23329) 2025-01-18 22:57:17 +02:00