菜单

项目和里程碑

相关源文件

本文档描述了 Gitea 中的项目(Projects)和里程碑(Milestones)功能,这些功能是用于组织和跟踪 issue 和 pull request 的工具。项目提供看板式(Kanban-style)的面板,用于可视化工作流程,而里程碑则将具有目标日期的 issue 分组,用于发布或冲刺(sprints)。

概述

Gitea 提供了两个互补的工具来组织您的工作

  1. 项目(Projects) - 看板式面板,具有可自定义的列,issue 可以在其中进行可视化组织和跟踪
  2. 里程碑(Milestones) - 基于时间的 issue 分组,包含截止日期和进度跟踪

这两个功能可以独立使用,也可以结合使用,以管理您的仓库或组织的工作流程。

来源

项目结构

一个项目包括

  1. 项目面板(Project Board) - 包含元数据(标题、描述、状态)的主容器
  2. 列(Columns) - 面板内的垂直分区(例如,“待办”、“进行中”、“完成”)
  3. 卡片(Cards) - 可以在列之间移动的单个项目(issue 或 pull request)

来源

  • models/project/project.go84-107
  • 卡片类型(仅文本或图像和文本)
  • 所有者(仓库、组织或用户)
  • 默认列(新 issue 默认放置的位置)

卡片类型

项目提供两种卡片类型

  1. 仅文本卡片 - 仅显示 issue 标题和元数据
  2. 图像和文本卡片 - 还显示 issue 中的附件图片

来源

  • models/project/project.go184-194"] AddColumns["添加自定义列"] MoveIssues["在列之间移动 issue"] Close["完成项目时关闭"]

    创建 --> 配置 配置 --> 添加列 添加列 --> 移动 issue 移动 issue --> 关闭


Sources:
- <FileRef file-url="https://github.com/go-gitea/gitea/blob/cbb2e529/routers/web/repo/projects.go#L134-L169" min=134 max=169 file-path="routers/web/repo/projects.go">Hii</FileRef>

- Each column can have a custom title and color
- Issues can be dragged and dropped between columns
- A default column can be set for new issues
- Columns are automatically sorted by the sorting order

Sources:
- <FileRef file-url="https://github.com/go-gitea/gitea/blob/cbb2e529/routers/web/repo/projects.go#L517-L548" min=517 max=548 file-path="routers/web/repo/projects.go">Hii</FileRef>
- Show issue details including labels, assignees, and linked PRs

Sources:
- <FileRef file-url="https://github.com/go-gitea/gitea/blob/cbb2e529/templates/projects/view.tmpl#L3-L123" min=3 max=123 file-path="templates/projects/view.tmpl">Hii</FileRef>
- **Deadline** (optional date)
- **Progress** (calculated from open/closed issues)

```mermaid
classDiagram
    class Milestone {
        Title: string
        Description: string
        Deadline: date
        Status: open/closed
        Progress: percentage
        NumIssues: int
        NumClosedIssues: int
    }
    
    class Issue {
        Title: string
        Number: int
        Status: open/closed
        MilestoneID: int
    }
    
    Milestone "1" -- "many" Issue : contains

来源

  • routers/web/repo/milestone.go32-99"] AssignIssues["为里程碑分配 issue"] TrackProgress["跟踪进度"] Close["完成里程碑时关闭"]

    创建 --> 配置 配置 --> 分配 issue 分配 issue --> 跟踪进度 跟踪进度 --> 关闭


Sources:
- <FileRef file-url="https://github.com/go-gitea/gitea/blob/cbb2e529/routers/web/repo/milestone.go#L101-L140" min=101 max=140 file-path="routers/web/repo/milestone.go">Hii</FileRef>
- Sorting options (due date, name, completion)

Sources:
- <FileRef file-url="https://github.com/go-gitea/gitea/blob/cbb2e529/routers/web/repo/milestone.go#L32-L99" min=32 max=99 file-path="routers/web/repo/milestone.go">Hii</FileRef>
- Milestone pages list all associated issues and PRs
- Issue filters can be based on project or milestone assignment

Sources:
- [templates/repo/issue/card.tmpl:1-78](
- [models/issues/issue_project.go:16-166](
- [routers/web/repo/milestone.go:241-275](