Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Bug 报告
description: 可以复现的缺陷
labels: [kind/bug, needs-triage]
body:
- type: textarea
id: observed
attributes:
label: 现象
description: 实际看到什么,带上错误信息、日志或截图
placeholder: |
命令:
结果:
validations:
required: true

- type: textarea
id: expected
attributes:
label: 预期
description: 你认为应该发生什么,依据是什么
validations:
required: true

- type: textarea
id: reproduce
attributes:
label: 复现步骤
description: 从干净环境开始的最小步骤,写清能否稳定复现
validations:
required: true

- type: textarea
id: environment
attributes:
label: 环境
description: 系统、运行时版本、依赖版本
value: |
- 系统:
- 运行时:
- 依赖:
validations:
required: true

- type: textarea
id: scope
attributes:
label: 涉及范围
description: 会动到的模块,是否有其他入口受影响
placeholder: 无 / 具体描述
validations:
required: true
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
39 changes: 39 additions & 0 deletions .github/ISSUE_TEMPLATE/epic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Epic
description: 需要多个 PR 的大功能,作为跟踪容器,不对应 PR
labels: [kind/epic]
body:
- type: textarea
id: goal
attributes:
label: 目标
description: 整体要达成什么,为什么现在做
validations:
required: true

- type: textarea
id: children
attributes:
label: 切片清单
description: 列出各片;也可以用原生的 sub-issue 关系挂载
placeholder: |
- [ ] #12
- [ ] #13
validations:
required: true

- type: textarea
id: done
attributes:
label: 整体完成判定
description: 满足什么条件这个 epic 可以关闭
validations:
required: true

- type: textarea
id: out-of-scope
attributes:
label: 不做的部分
description: 明确排除的场景;没有写「无」
placeholder: 无
validations:
required: true
39 changes: 39 additions & 0 deletions .github/ISSUE_TEMPLATE/feature.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: 功能请求
description: 缺什么能力,先评估再排期
labels: [kind/feature, needs-triage]
body:
- type: textarea
id: problem
attributes:
label: 要解决的问题
description: 现在哪里不顺,具体场景是什么,谁受影响
validations:
required: true

- type: textarea
id: proposal
attributes:
label: 设想的做法
description: 已经有想法就写清对外行为;没有就写「暂无」
placeholder: 暂无
validations:
required: true

- type: textarea
id: done
attributes:
label: 完成的判定
description: 逐条写成可执行的判定:跑哪条命令、看到什么结果
placeholder: |
- [ ]
validations:
required: true

- type: textarea
id: out-of-scope
attributes:
label: 明确不做的部分
description: 这次不覆盖的场景;没有写「无」
placeholder: 无
validations:
required: true
37 changes: 37 additions & 0 deletions .github/ISSUE_TEMPLATE/refactor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: 重构请求
description: 行为不变的结构调整,可独立合入、独立回滚
labels: [kind/refactor, ready-for-agent]
body:
- type: textarea
id: current
attributes:
label: 现状问题
description: 当前结构哪里不合理,依据是什么
validations:
required: true

- type: textarea
id: target
attributes:
label: 目标结构
description: 改成什么样,模块边界在哪里
validations:
required: true

- type: textarea
id: unchanged
attributes:
label: 必须保持不变的行为
description: 对外行为、配置、数据的哪些部分不能变
validations:
required: true

- type: textarea
id: acceptance
attributes:
label: 验收标准
description: 逐条写成可执行判定
placeholder: |
- [ ] 命令:``,结果:
validations:
required: true
47 changes: 47 additions & 0 deletions .github/ISSUE_TEMPLATE/task.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: 工作切片
description: 已明确范围、可交给一个会话独立完成的任务
labels: [ready-for-agent]
body:
- type: input
id: parent
attributes:
label: 上级 Issue
description: 来自哪个 epic 或功能请求,写编号;没有写「无」
placeholder: 无 / #12
validations:
required: true

- type: textarea
id: goal
attributes:
label: 目标
description: 一段话说清这一片要交付什么
validations:
required: true

- type: textarea
id: scope
attributes:
label: 范围
description: 会动到的文件与模块;明确不做哪些相邻的事
validations:
required: true

- type: textarea
id: blocked-by
attributes:
label: 前置依赖
description: 依赖的 issue 编号,没有写「无」;也可以用原生的 blocked-by 关系挂上
placeholder: 无 / #12
validations:
required: true

- type: textarea
id: acceptance
attributes:
label: 验收标准
description: 逐条写成可执行判定;没有验收标准不开工
value: |
- [ ]
validations:
required: true
29 changes: 29 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# PR 按改动路径打标签。键是标签名,值是匹配规则。
# 路径按仓库实际结构改。

kind/docs:
- changed-files:
- any-glob-to-any-file:
- "**/*.md"
- "docs/**"

kind/chore:
- changed-files:
- any-glob-to-any-file:
- ".github/**"
- "scripts/**"
- "package.json"
- "pnpm-lock.yaml"
- "pnpm-workspace.yaml"
- "tsconfig.json"
- "vitest.config.ts"
- "eslint.config.mjs"
- ".prettierrc"
- ".prettierignore"
- ".gitattributes"
- ".gitignore"

# 所有 PR 先挂待评估标志,与 issue 侧一致
needs-triage:
- changed-files:
- any-glob-to-any-file: "**"
21 changes: 21 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## 关联

Closes #

## 做了什么

一段话说明这次改动的目标与范围。顺手做的无关改动另开一个 PR。

## 验收

- [ ] 命令:``,结果:

## 影响面与回滚

会动到的模块、对外行为、配置与数据;出问题时怎么撤回。

## 检查清单

- [ ] 一个 PR 只对应一个逻辑变更,提交信息形如 `type(scope): 中文描述`
- [ ] 本地跑了完整测试,不只跑改动的那一条
- [ ] 涉及对外接口或结构的改动已同步到 `docs/`(或仓库里的 `CONTEXT.md`)
24 changes: 24 additions & 0 deletions .github/workflows/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# PR 打开时按改动路径打标签,路径规则在 .github/labeler.yml。
#
# 用 pull_request_target 而不是 pull_request:前者在默认分支的上下文里运行,不需要
# checkout 也能读到配置(配置不在 runner 上时 action 会走 API 从源仓库读),而且不会
# 执行 PR 里的代码。
#
# sync-labels 关着,只加不摘:路径规则改了以后,已经贴错的标签要人工清掉。
name: pr-labeler

on:
pull_request_target:

permissions:
contents: read
pull-requests: write

jobs:
label:
runs-on: ubuntu-latest
steps:
# 只读改动路径,不执行 PR 里的代码
- uses: actions/labeler@v7
with:
sync-labels: false
55 changes: 55 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# 长期无活动的条目标记与关闭:issue 60 天打 stale、再过 7 天关闭;PR 是 14 天与 7 天。
#
# 豁免:带 frozen 的条目,以及带 kind/epic 的 issue(epic 是跟踪容器,本来就不该被
# 自动关掉,所以它不必再加 frozen)。
#
# 关闭理由统一是 not planned。要区分「判定不做」与「长期无活动」,看标签:前者带
# wontfix,后者带 stale。
#
# 已经带 stale 的条目被补上 frozen 时,remove-stale-when-updated 默认开启,会在下一次
# 运行把 stale 摘掉。
name: stale

on:
schedule:
- cron: "0 2 * * *"
workflow_dispatch:

permissions:
issues: write
pull-requests: write

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v11
with:
# issue:60 天没活动打标记,再过 7 天关闭
days-before-issue-stale: 60
days-before-issue-close: 7
# PR:14 天没活动打标记,再过 7 天关闭
days-before-pr-stale: 14
days-before-pr-close: 7

stale-issue-label: stale
stale-pr-label: stale

# frozen 表示长期保留;epic 是跟踪容器,不参与过期
exempt-issue-labels: frozen,kind/epic
exempt-pr-labels: frozen

close-issue-reason: not_planned

stale-issue-message: >
这条 60 天没有活动。请补齐进展、改成 frozen,或在 7 天内说明保留理由;
逾期按 not planned 关闭,随时可以重新打开。
close-issue-message: >
因长期没有活动按 not planned 关闭。需要继续时重新打开,并补上新的上下文。
stale-pr-message: >
这个 PR 14 天没有活动。请更新分支或写明阻塞原因;
7 天后关闭,代码仍在原分支上。
close-pr-message: >
因长期没有活动关闭。需要继续时重新打开,或基于原分支重开一个 PR。

operations-per-run: 100
Loading
Loading