SuperAPI AI 工具集

create-pr-azdo

编程与开发

查看项目

更新于 10-16 09:47

技能介绍

用途:在 Azure DevOps 上一致地创建拉取请求,同时编码仓库对线性历史的偏好。优先使用仓库封装脚本 scripts/pr-azdo.sh,以减少 Maintainer 审批中断(单条终端调用)。

合并策略说明:CONTRIBUTING.md 规定该仓库要求使用 Rebase and merge 合并策略。Azure DevOps UI/合并选项因项目设置而异;合并时选择最接近“rebase/线性历史”的可用选项(常称为 Rebase and fast-forward);若不可用,需询问 Maintainer 采用何种方式。

硬性规则——必须:在非 main 分支上工作;创建 PR 前确保工作树干净;创建 PR 前推送分支;PR 标题与描述保持常规且便于审查;创建 PR 前在聊天中发布确切的标题与描述;使用标准描述模板(Problem / Change / Verification)。不得:在 Maintainer 未明确要求的情况下使用会引入合并提交的策略进行合并。

步骤:0. 标题与描述(必需):在运行任何 PR 创建命令前,在聊天中提供确切 PR 标题与描述,模板为 ## Problem / ## Change / ## Verification。推荐单命令封装:scripts/pr-azdo.sh create --title "<type(scope): summary>" --description "<why + what + testing notes>";放弃测试 PR(清理):scripts/pr-azdo.sh abandon --id <pr-id>。1. 预检:git branch --show-current 与 scripts/git-status.sh --short。2. 推送分支:git push -u origin HEAD。3. 创建 PR:az repos pr create --title "<type(scope): summary>" --description "<why + what + testing notes>" --source-branch "$(git branch --show-current)" --target-branch main(为最小示例,需按目标仓库设置 --organization/--project)。4. 合并:如需合并 PR,先与 Maintainer 确认确切合并选项;可用时优先选择 rebase/线性历史选项。

限制:合并选项依 Azure DevOps 项目设置而定,部分选项可能不可用;未提供更具体的平台差异、权限要求或脚本实现细节。