oh-graphic-gitcode-pr-creator

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

OpenHarmony Graphic Gitcode PR Creator

OpenHarmony图形子系统Gitcode PR创建指南

Quick Start

快速开始

Create a Gitcode PR by following these steps:
  1. Check git status - Verify modified files
  2. Commit changes - Add Signed-off-by to commit message
  3. Push to remote - Push branch to origin
  4. Create Issue - Create related issue
  5. Create PR - Use PR template from
    .gitcode/PULL_REQUEST_TEMPLATE.zh-CN.md
按照以下步骤创建Gitcode PR:
  1. 检查Git状态 - 验证已修改的文件
  2. 提交变更 - 在提交信息中添加Signed-off-by
  3. 推送到远程仓库 - 将分支推送到origin
  4. 创建Issue - 创建相关的Issue
  5. 创建PR - 使用
    .gitcode/PULL_REQUEST_TEMPLATE.zh-CN.md
    中的PR模板

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:
  • master
    (default for most cases)
  • OpenHarmony-6.1-Release
    (for 6.1 release branch)
bash
git push origin <branch-name>
注意:在创建PR前,你需要询问用户目标分支名称。常见选项:
  • master
    (大多数情况下的默认分支)
  • OpenHarmony-6.1-Release
    (适用于6.1版本发布分支)

4. Create Issue

4. 创建Issue

Use
gitcode_create_issue
to create issue with:
  • Title: PR title
  • Body: Description of changes
使用
gitcode_create_issue
创建Issue,包含:
  • 标题:PR标题
  • 正文:变更描述

5. Create PR

5. 创建PR

Read PR template from
.gitcode/PULL_REQUEST_TEMPLATE.zh-CN.md
and fill in:
  • 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
gitcode_create_pull_request
with formatted body.
.gitcode/PULL_REQUEST_TEMPLATE.zh-CN.md
读取PR模板并填写以下内容:
  • 描述:变更摘要
  • Issue编号:关联已创建的Issue链接
  • 测试与结果:测试信息
  • CodeCheck:将所有自检结果填写为“Pass”
  • L0新增用例自检结果:勾选对应的选项
使用
gitcode_create_pull_request
提交格式化后的正文。

CodeCheck 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
    --force
    when amending commits
  • 针对OpenHarmony项目,请始终使用中文PR模板
  • 确保分支名称具有描述性
  • 将PR与Issue关联以实现可追溯性
  • 当修改提交时,使用
    --force
    参数强制推送