Rejecting every Co-authored-by line also rejected human co-authors, including the line GitHub adds when a contributor commits a review suggestion. Reject only the identities that AI tools add on their own: anthropic.com, openai.com and cursor.com addresses, Copilot and [bot] accounts. Other AI help still goes in Assisted-by. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Zakk <zakk@gentoozh.org>
6.4 KiB
貢獻指南
gentoo-zh 是 Gentoo 的 overlay(第三方 ebuild 儲存庫),依賴 ::gentoo(metadata/layout.conf 中 masters = gentoo)。
Note
蓄意規避本文規定者將被移出組織,其維護的所有套件也將被 treeclean。此規則適用於所有維護者,包括 owner 和 member。
套件
-
ebuild 只使用
~arch關鍵字; -
::gentoo已有的相依套件不在本儲存庫重複新增;除特殊情況外,不新增與::gentoo同名的套件; -
每個套件須有
metadata.xml,並寫明維護者; -
LICENSE須與所打包軟體聲明的授權條款一致,::gentoo沒有的授權條款須加入licenses/和profiles/license_groups; -
除特殊情況外,同一套件的改動須放在同一個提交中;
-
套件須登記到
.github/workflows/overlay.toml,依category/package的字母順序插入,無法由 nvchecker 追蹤的,需以註解說明原因; -
可自動更新版本的套件見 scripts/autobump.zh.md;
-
ebuild 提交前須進行測試;
-
不再維護的套件,須先發 issue 尋找接手者。無人接手的,依據 last rites 流程移除:在
profiles/package.mask最上方加入條目,寫明作者、電子郵件、日期(UTC)、原因和移除日期,至少 30 天後移除。範例:# Zakk <zakk@gentoozh.org> (2026-11-18) # Upstream archived. # Removal on 2026-12-18. net-proxy/daed
參考:
提交
所有改動經 Pull Request 合併,禁止直接推送到 master 或繞過 CI。
提交遵循 Gentoo git workflow:
- 首行為摘要,格式為
category/package: 摘要,不超過 69 個字元; - 內文可選;如有內文,須與摘要行之間空一行;
- 須附
Signed-off-by:,可用pkgdev commit --signoff新增; - 版本更新的格式為
category/package: add 0.5, drop 0.4; - Pull Request 中不得有 merge commit,同步 master 時使用
git rebase,不使用git merge。
範例:
app-misc/foo: fix build with GCC 16
Add a missing include.
Signed-off-by: A Developer <example@gentoo.org>
常用指令:
pkgdev manifest # 更新 Manifest
pkgcheck scan --net # 檢查目前的改動
pkgdev commit --signoff # 提交,產生摘要行並附 Signed-off-by
pkgdev commit --signoff -m "fix build with GCC 16" -m "Add a missing include."
# 自訂摘要行和內文
pkgcheck scan --commits --net # 發起 Pull Request 前檢查本分支的提交
Note
pkgdev commit的-b和-c會關聯到 bugs.gentoo.org,不要用於本儲存庫的 issue。
Pull Request 描述
需按 Pull Request 範本填寫:
- 描述寫在
<!-- Please put the pull request description above -->上方; - 關閉本儲存庫的 issue 時,在描述中加入
Closes #N; - 改動了套件、
eclass/、profiles/或licenses/時,須勾選 pkgcheck 對應項目;如果使用了 AI,須勾選 AI 聲明項目。
範例:
Because upstream 1.2.3 fixes a crash on Wayland, add it.
Closes #12345
<!-- Please put the pull request description above -->
---
Please check all the boxes that apply:
- [x] I have run `pkgcheck scan --commits --net` to check for issues with my commits.
- [x] If I used AI: I understand every change, tested it and take responsibility for it; commits with AI-written changes carry `Assisted-by:`.
Please note that all boxes must be checked for the pull request to be merged.
Note
發起 Pull Request 後,須修復 pkgcheck 和 CI 回報的問題,包括 QA 警告。
AI 政策
允許使用 AI,但須滿足以下要求:
- 使用 AI 輔助時須遵守 AGENTS.md;
- 貢獻者須理解 AI 生成的內容;
Signed-off-by須由貢獻者本人新增,不得由工具新增;- 新增
Signed-off-by前,貢獻者須確認 AI 生成的部分沒有複製授權條款不相容的程式碼; - AI 生成的提交訊息和 Pull Request 描述須準確、精簡、無冗餘,且所寫內容須經核實。
聲明
包含 AI 生成內容的提交,須在 Signed-off-by: 上方新增 Assisted-by: 行,格式遵循 Linux 核心 規範: Assisted-by: 工具名:模型名。用 pkgdev commit -T 新增:
pkgdev commit --signoff -m "fix build with GCC 16" -m "Add a missing include." -T Assisted-by:Claude:claude-opus-5-5
產生的提交訊息:
app-misc/foo: fix build with GCC 16
Add a missing include.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: A Developer <example@gentoo.org>
Note
AI 協助不得以
Co-authored-by:標註,否則 CI 會拒絕該提交。 人類共同作者可正常使用Co-authored-by:。
以下情況無需聲明:
- 小改動或機械性改動;
- 僅使用 AI 審查自己的改動,並自行修復 AI 發現的問題。
禁止
- 在人類貢獻者沒有確認建置成功、通過測試和逐條審閱自動化工具產生的內容時,由自動化工具直接發起 Pull Request 或發表留言。
- 隱瞞或淡化 AI 的參與程度。
autobump、nvchecker 等本儲存庫自有的 bot 不受上述規則限制。
測試
AI 生成的改動與其他改動適用相同的測試要求,ebuild 須經過冒煙測試。不得虛報未實際進行的測試。
執行
如果懷疑貢獻中使用了 AI 卻未聲明,我們會要求說明,貢獻者須如實回答;拒絕說明的,我們會關閉該 Pull Request 或 issue。本規則同樣適用於維護者。
AI agent 可使用 gentoo-zh/skills 進行打包、更新版本和程式碼審查。該工具集僅落實 AGENTS.md 的規範,不額外增設規則。安裝指令:
npx skills add gentoo-zh/skills -g
本節參考 OpenWrt packages 的 AI 政策。