docs: Surface how team development works

Đang mở
#244 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
45/100
Loại issue
Tài liệu
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
git, postgresql, sql

Hướng nghiên cứu

Bắt đầu với phần cộng tác trong README và các lệnh graphile-migrate được thảo luận trong thread Discord: watch --once, uncommit và commit. Ghi lại workflow được khuyến nghị cho branch, việc kiểm thử, merge, thứ tự migration và race condition, đồng thời làm rõ khi nào không cần uncommit. Hoàn thành khi một người mới có thể hiểu cách kiểm thử và merge các thay đổi của nhóm một cách an toàn.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

From Discord https://discord.com/channels/489127045289476126/498852330754801666/1381598278738771968

how is team development supposed for graphile-migrate?
for example:

Developer 1 created in
migrations/current.sql
DROP VIEW IF EXISTS public.test_vew CASCADE
;
CREATE VIEW public.test_vew AS
SELECT 1
;

gm uncommit -> rebase -> gm commit => push
since order of migrations is important there isn't really a better solution

but if order is not important?

Order is almost always important, since it can have an impact on things like the order of columns in a table or the output of pg_dump. Graphile Migrate deliberately choses to support linear history only and this is enforced through hashing. As written in the docs (https://github.com/graphile/migrate?tab=readme-ov-file#collaboration) we recommend you only commit either just before or just after you merge to your main branch. Should you wish to try a different framework that does not hold the same opinions and allows for non-linear history, sqitch is commonly mentioned and seems to be well liked.

For each task we create a separate branch, the developer develops it, then this branch is tested, then it is merged into the master. When using graphile-migrate, you will have to run
gm uncommit -> rebase -> gm commit => push before merging into the master

You don't need to do that, you can just run graphile-migrate watch --once rather than committing. You should almost never have to uncommit. You can test your PR without committing the migration.

I've never considered this before... but we could probably integrate it into a git merge hook

i have a check that blocks merging if something hasn't been committed to avoid accidents

If I felt the need to automate it, I'd probably just add a GitHub Action on main that commits pending migration and pushes it.

you'd still run the risk of merging in the wrong order breaking main

True, it would introduce a race condition.

Ngôn ngữ chính
TypeScript
Star
836
Fork
71
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của graphile/migrate

Tất cả issue của graphile/migrate

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.