docs: Surface how team development works

未关闭
#244 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
45/100
Issue 类型
文档
描述清晰度
基本清楚
活跃度
停滞
技术栈
git, postgresql, sql

调研方向

从 README 的协作部分以及 Discord 线程中讨论的 graphile-migrate 命令开始:watch --once、uncommit 和 commit。记录推荐的分支、测试、合并、迁移顺序和竞态条件工作流程,并明确何时不需要 uncommit。完成的标准是:新贡献者能够理解如何安全地测试和合并团队的更改。

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
TypeScript
星标
836
派生
71
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

graphile/migrate 的其他 Issue

查看 graphile/migrate 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。