代码贡献请遵循如下工作流:
首次,你需要 fork the repository on GitHub, 检出你 fork 的代码至本地,然后 将本地fork同步到上游, 并且确保在每次开始变更前已经同步了最新的上游.
为你打算做的改动创建一个分支。如果你的贡献是基于已知的Issue,建议用以下方式命名你的分支:"[feat|fix]--<简短描述>"。 在你本地创建分支:
git checkout -b feat-17-support-statefulset
当你的修改就绪时,就可以提交,如果与issues相关,可以在提交信息中提及Issue ID。
git add .
git commit -m "feat: #17 support statefulset ......"
git push -u origin feat-17-support-statefulset
注意: 如果在自己分支开发阶段,如有需要合并最新的master
, 请在本地环境配置 git rebase
,从而避免出现无效的提交信息,具体配置指令如下:
# branch.autosetuprebase only changes the default pull “mode” for new branches that have an upstream to track.
git config branch.autosetuprebase always
# use the pull.rebase config option to change the behavior for every git pull (instead of only newly-created branches)
git config pull.rebase true
如果您提交的代码涉及到数据迁移,请在internal/migrations
目录下添加迁移脚本,并在migration.go
中注册该脚本
type MigrationXXXXX struct {
}
func (m MigrationXXXXX) GetCreateAt() time.Time{
//时间请设定为提交代码的当前时间,以便于系统自动记录迁移历史
return time.Date(2022, 1, 1, 0, 0, 0, 0, time.Local)
}
func (m Migration20220101) Upgrade(ormer orm.Ormer) error{
//样例代码如下,err不为nil时,会自动回滚所有操作
/*
err := ormer.Raw(xxxx).Exec()
return err
*/
}
//在migrations.go中
func InitMigration() {
migrationTypes := MigrationTypes{
//注册
new(MigrationXXXXX),
//...
}
}
Create a pull request to the main repository on GitHub.
When the reviewer makes some comments, address any feedback that comes and update the pull request.
When your contribution is accepted, your pull request will be approved and merged to the main branch.
The workflow for documentation is similar. Please take into account a few things:
After you make changes, you can use yarn run dev
commands have a preview locally.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。