开发者贡献授权
是什么? 开发者在提交代码的时候做出一个声明,声明自己有权提交这次贡献。
为什么? 因为开源项目如采用宽松许可证如MIT,只能管出站(outbound),不能管进站(inbound)。
怎么做? 常见的有两种,CLA和DCO,这两个的本质不同在于CLA是协议,DCO是声明。
- 签署CLA需要开发者打开一个网页,填写自己的姓名和提交代码用的邮箱。
- 使用DCO需要开发者在每次git commit的时候加上 -s参数,这样会在提交记录中生成一个,例如
Signed-by Yingjie Shang dev@yingjie.dev的内容- 采用DCO可以在不打击开源社区贡献者积极性的前提下,保障社区在采纳代码时降低合规风险。
- 这样可被认为社区有采取积极的行动来保障合入的代码是合规的,若真到了对簿公堂,不会是完全失责。
别的项目怎么做?
| Project | LICENSE | CLA or DCO |
|---|---|---|
| OpenClaw | MIT | N/A |
| IronClaw | APL 2.0 | N/A |
| NemoClaw | APL 2.0 | N/A |
| PicoClaw | MIT | N/A |
我们怎么做? 为了降低贡献的门槛,打消开发者的疑虑,我提议分别在贡献指南和PR模板中写入对应的文本。
PR模板:开发者每次提PR的时候肯定会看到的内容
markdown
## 描述 / Description
请简要描述您的更改 / Please briefly describe your changes:
-
## 贡献者声明 / Contributor Agreement
在提交此 PR 之前,请确认您已阅读并同意 `CONTRIBUTING.md` 中的条款,并勾选以下选项:
Before submitting this PR, please confirm you have read and agreed to the terms in `CONTRIBUTING.md` and check the following boxes:
- [ ] **权利确认 / Ownership Confirmation**: 我确认我有权提交此代码(包括已获得雇主同意)。/ I confirm I have the right to submit this code (including employer consent if applicable).
- [ ] **许可确认 / License Confirmation**: 我同意此贡献按照本项目的开源许可证进行授权。/ I agree to license this contribution under the project's open source license.
## 类型 / Type of Change
- [ ] 🐛 Bug 修复 / Bug fix
- [ ] ✨ 新功能 / New feature
- [ ] 📝 文档更新 / Documentation update
- [ ] 🔨 重构 / RefactoringCONTRIBUTING.md:贡献指南
markdown
# 贡献指南 / Contributing Guide
感谢您有兴趣为本项目做出贡献!为了让项目健康发展,请您在提交代码前仔细阅读以下条款。
Thank you for your interest in contributing to this project! To ensure the healthy development of the project, please read the following terms carefully before submitting your code.
## 贡献者许可协议 / Contributor License Agreement
通过向本项目提交拉取请求或以其他形式贡献代码,您确认并同意以下条款:
By submitting a pull request or otherwise contributing code to this project, you represent and agree that:
1. **权利保证**:您有权提交该贡献。该贡献是您的原创作品,或者您有权代表版权所有者提交该贡献。
**Ownership**: You have the right to submit the contribution. The contribution is your original work, or you have the right to submit it on behalf of the copyright holder.
2. **雇主同意**:如果您的贡献属于您在雇佣期间创作的工作成果,或者涉及您与雇主签署的协议,您确认您已获得雇主的书面同意,允许您向本项目提交该贡献。
**Employer Consent**: If your contribution was created during your employment or relates to agreements with your employer, you confirm that you have obtained written consent from your employer to submit this contribution to this project.
3. **许可授权**:您授予项目维护者和用户永久的、全球性的、免费的、非独占的许可,允许其根据本项目规定的开源许可证(见 `LICENSE` 文件)使用、复制、修改、展示和分发您的贡献。
**License Grant**: You grant the project maintainers and users a perpetual, worldwide, royalty-free, non-exclusive license to use, copy, modify, display, and distribute your contribution under the open-source license specified in the `LICENSE` file of this project.
4. **专利授权**:您授予项目维护者和用户永久的、免费的专利许可,允许其制造、使用、销售、许诺销售、进口本项目中包含您贡献的部分。
**Patent Grant**: You grant a perpetual, royalty-free patent license to the project maintainers and users to make, use, sell, offer for sale, and import the part of the project that contains your contribution.
## 如何贡献 / How to Contribute
1. Fork 本仓库 / Fork this repository.
2. 创建新分支 / Create a new branch.
3. 进行修改 / Make your changes.
4. 提交 Pull Request / Submit a Pull Request.
我们期待您的贡献!
We look forward to your contributions!在CI/CD设置门禁,检查贡献者提的PR中是否对授权要求打勾了✔。
附录
有没有办法100%确保贡献者提交的代码是原创的? 这个需求一般发生在将开源项目捐赠给开源软件基金会或被公司收购。 成熟的开源项目通常采用软件组成分析(SCA)来扫描代码库,来证明自己项目中的代码是具有一定原创率的。SCA的原理是用被测项目的代码和数据库中收录的代码进行对比。