oh-graphic-gitcode-pr-creator
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseOpenHarmony Graphic Gitcode PR Creator
OpenHarmony图形子系统Gitcode PR创建指南
Quick Start
快速开始
Create a Gitcode PR by following these steps:
- Check git status - Verify modified files
- Commit changes - Add Signed-off-by to commit message
- Push to remote - Push branch to origin
- Create Issue - Create related issue
- Create PR - Use PR template from
.gitcode/PULL_REQUEST_TEMPLATE.zh-CN.md
按照以下步骤创建Gitcode PR:
- 检查Git状态 - 验证已修改的文件
- 提交变更 - 在提交信息中添加Signed-off-by
- 推送到远程仓库 - 将分支推送到origin
- 创建Issue - 创建相关的Issue
- 创建PR - 使用中的PR模板
.gitcode/PULL_REQUEST_TEMPLATE.zh-CN.md
Workflow
工作流
1. Check Git Status
1. 检查Git状态
bash
git status
git diff <file>bash
git status
git diff <file>2. Commit Changes
2. 提交变更
Get user config and create commit with Signed-off-by:
bash
git config user.name
git config user.email
git add <files>
git commit -m "<message>\n\nSigned-off-by: <name> <<email>>"获取用户配置并创建包含Signed-off-by的提交:
bash
git config user.name
git config user.email
git add <files>
git commit -m "<message>\n\nSigned-off-by: <name> <<email>>"3. Push to Remote
3. 推送到远程仓库
bash
git push origin <branch-name>Note: You need to ask the user for the target branch name before creating the PR. Common options:
- (default for most cases)
master - (for 6.1 release branch)
OpenHarmony-6.1-Release
bash
git push origin <branch-name>注意:在创建PR前,你需要询问用户目标分支名称。常见选项:
- (大多数情况下的默认分支)
master - (适用于6.1版本发布分支)
OpenHarmony-6.1-Release
4. Create Issue
4. 创建Issue
Use to create issue with:
gitcode_create_issue- Title: PR title
- Body: Description of changes
使用创建Issue,包含:
gitcode_create_issue- 标题:PR标题
- 正文:变更描述
5. Create PR
5. 创建PR
Read PR template from and fill in:
.gitcode/PULL_REQUEST_TEMPLATE.zh-CN.md- Description: Summary of changes
- Issue number: Link to created issue
- Test & Result: Test information
- CodeCheck: Fill all self-check results with "Pass"
- L0新增用例自检结果: Check appropriate box
Use with formatted body.
gitcode_create_pull_request从读取PR模板并填写以下内容:
.gitcode/PULL_REQUEST_TEMPLATE.zh-CN.md- 描述:变更摘要
- Issue编号:关联已创建的Issue链接
- 测试与结果:测试信息
- CodeCheck:将所有自检结果填写为“Pass”
- L0新增用例自检结果:勾选对应的选项
使用提交格式化后的正文。
gitcode_create_pull_requestCodeCheck Template
CodeCheck模板
When filling CodeCheck table, ensure all rows have "Pass" in the result column:
| 类型 | 自检项 | 自检结果 |
|---|---|---|
| 多线程 | ... | Pass |
| 内存操作 | ... | Pass |
| 外部输入 | ... | Pass |
| 敏感信息 | ... | Pass |
| 数学运算 | ... | Pass |
| 初始化 | ... | Pass |
| 权限管理 | ... | Pass |
填写CodeCheck表格时,确保所有行的结果列都填写“Pass”:
| 类型 | 自检项 | 自检结果 |
|---|---|---|
| 多线程 | ... | Pass |
| 内存操作 | ... | Pass |
| 外部输入 | ... | Pass |
| 敏感信息 | ... | Pass |
| 数学运算 | ... | Pass |
| 初始化 | ... | Pass |
| 权限管理 | ... | Pass |
Common Patterns
常见场景
Test Optimization PRs
测试优化类PR
For test file optimizations:
- Description: "Optimize <test_file> - remove redundant code and improve coverage"
- CodeCheck: All Pass (test code doesn't typically trigger security checks)
- L0用例: Check "是,有新增L0用例,且完成自检"
针对测试文件优化:
- 描述:“优化<test_file> - 移除冗余代码并提升覆盖率”
- CodeCheck:全部Pass(测试代码通常不会触发安全检查)
- L0用例:勾选“是,有新增L0用例,且完成自检”
Bug Fix PRs
Bug修复类PR
For bug fixes:
- Description: "Fix <bug_description> in <file>"
- Test & Result: Describe test scenario and expected behavior
- CodeCheck: All Pass
针对Bug修复:
- 描述:“修复<file>中的<bug_description>”
- 测试与结果:描述测试场景和预期行为
- CodeCheck:全部Pass
Important Notes
重要注意事项
- Always use the Chinese PR template for OpenHarmony projects
- Ensure branch name is descriptive
- Link PR to issue for traceability
- Force push with when amending commits
--force
- 针对OpenHarmony项目,请始终使用中文PR模板
- 确保分支名称具有描述性
- 将PR与Issue关联以实现可追溯性
- 当修改提交时,使用参数强制推送
--force