项目管理

“一个人无法吹奏出交响乐;需要整个管弦乐队来演奏”

— Halford E. Luccock

本文档概述了我们针对 REST 框架的项目管理流程。

目的是确保项目具有较高的"总线系数",并且在可预见的未来能够持续获得良好的支持。欢迎提出改进我们流程的建议。


维护团队

我们有一个季度维护周期,新成员可以在此期间加入维护团队。我们目前将团队规模限制为 5 名成员,并且可能会鼓励人们退出团队一个周期,以便新成员参与。

当前团队

2015 年第 4 季度的维护团队

维护周期

每个维护周期都由使用Process标签打开的问题发起。

  • 要考虑担任维护者角色,只需针对问题发表评论即可。
  • 现有成员必须通过勾选他们的姓名明确选择加入下一个周期。
  • 关于新团队的最终决定将由@tomchristie做出。

维护团队成员将作为合作者添加到存储库中。

应将以下模板用于问题描述,并作为选择团队的正式流程。

This issue is for determining the maintenance team for the *** period.

Please see the [Project management](https://django-rest-framework.django.ac.cn/topics/project-management/) section of our documentation for more details.

---

#### Renewing existing members.

The following people are the current maintenance team. Please checkmark your name if you wish to continue to have write permission on the repository for the *** period.

- [ ] @***
- [ ] @***
- [ ] @***
- [ ] @***
- [ ] @***

---

#### New members.

If you wish to be considered for this or a future date, please comment against this or subsequent issues.

To modify this process for future maintenance cycles make a pull request to the [project management](https://django-rest-framework.django.ac.cn/topics/project-management/) documentation.

团队成员的职责

团队成员具有以下职责。

  • 关闭无效或已解决的工单。
  • 向工单添加分类标签和里程碑。
  • 合并最终确定的拉取请求。
  • 使用mkdocs gh-deploy构建并部署文档。
  • 构建并更新包含的翻译包。

维护者的进一步说明

  • 代码更改应采用拉取请求的形式 - 不要直接推送到 master。
  • 维护者通常不应合并自己的拉取请求。
  • 每个问题/拉取请求在分类后应只有一个标签。
  • 使用is:open no:label搜索未分类的问题。

应当注意,积极参与 REST 框架项目显然不需要成为维护团队的一部分。几乎所有问题分类和项目改进的重要部分都可以积极开展工作,而不管你在存储库中的合作者状态如何。


发布流程

发布经理在每个季度维护周期中选出。

  • 经理应由 @tomchristie 选择。
  • 然后,经理将拥有添加到 PyPI 包中的维护者角色。
  • 然后,前一位经理将从 PyPI 包中移除维护者角色。

我们的 PyPI 版本将由当前发布经理或 @tomchristie 处理。每个版本都应有一个贴有 Release 标签并标记为相应里程碑的开放问题。

应将以下模板用于问题描述,并作为发布清单。

Release manager is @***.
Pull request is #***.

During development cycle:

- [ ] Upload the new content to be translated to [transifex](https://django-rest-framework.django.ac.cn/topics/project-management/#translations).


Checklist:

- [ ] Create pull request for [release notes](https://github.com/encode/django-rest-framework/blob/master/docs/topics/release-notes.md) based on the [*.*.* milestone](https://github.com/encode/django-rest-framework/milestones/***).
- [ ] Update supported versions:
    - [ ] `setup.py` `python_requires` list
    - [ ] `setup.py` Python & Django version trove classifiers
    - [ ] `README` Python & Django versions
    - [ ] `docs` Python & Django versions
- [ ] Update the translations from [transifex](https://django-rest-framework.django.ac.cn/topics/project-management/#translations).
- [ ] Ensure the pull request increments the version to `*.*.*` in [`restframework/__init__.py`](https://github.com/encode/django-rest-framework/blob/master/rest_framework/__init__.py).
- [ ] Ensure documentation validates
    - Build and serve docs `mkdocs serve`
    - Validate links `pylinkvalidate.py -P http://127.0.0.1:8000`
- [ ] Confirm with @tomchristie that release is finalized and ready to go.
- [ ] Ensure that release date is included in pull request.
- [ ] Merge the release pull request.
- [ ] Push the package to PyPI with `./setup.py publish`.
- [ ] Tag the release, with `git tag -a *.*.* -m 'version *.*.*'; git push --tags`.
- [ ] Deploy the documentation with `mkdocs gh-deploy`.
- [ ] Make a release announcement on the [discussion group](https://groups.google.com/forum/?fromgroups#!forum/django-rest-framework).
- [ ] Make a release announcement on twitter.
- [ ] Close the milestone on GitHub.

To modify this process for future releases make a pull request to the [project management](https://django-rest-framework.django.ac.cn/topics/project-management/) documentation.

将版本推送到 PyPI 时,确保你的环境已从我们的开发 requirement.txt 安装,以便文档和 PyPI 安装始终针对固定的一组包进行构建。


翻译

维护团队负责管理 REST 框架中包含的翻译包。通过 transifex 服务 管理将源字符串翻译成多种语言。

管理 Transifex

使用 官方 Transifex 客户端 将翻译上传和下载到 Transifex。使用 pip 安装客户端

pip install transifex-client

要使用它,你需要一个具有密码的 Transifex 登录名,并且你需要具有对 Transifex 项目的管理访问权限。你需要创建一个包含你的凭据的 ~/.transifexrc 文件。

[https://www.transifex.com]
username = ***
token = ***
password = ***
hostname = https://www.transifex.com

上传新的源文件

当任何用户可见字符串发生更改时,应将其上传到 Transifex,以便翻译人员可以开始翻译它们。为此,只需运行

# 1. Update the source django.po file, which is the US English version.
cd rest_framework
django-admin makemessages -l en_US
# 2. Push the source django.po file to Transifex.
cd ..
tx push -s

推送源文件时,Transifex 将更新资源的源字符串以匹配新源文件中的源字符串。

以下是如何处理旧源文件和新源文件之间的差异

  • 将添加新字符串。
  • 也将添加修改后的字符串。
  • 新源文件中不存在的字符串将连同其翻译一起从数据库中删除。如果该源字符串稍后重新添加,则 Transifex Translation Memory 将自动包含翻译字符串。

下载翻译

当翻译人员完成翻译后,需要将其从 Transifex 下载到 REST 框架存储库中。为此,运行

# 3. Pull the translated django.po files from Transifex.
tx pull -a --minimum-perc 10
cd rest_framework
# 4. Compile the binary .mo files for all supported languages.
django-admin compilemessages

项目要求

我们的所有测试要求都固定到确切版本,以确保我们的测试运行可重现。我们在 requirements 目录中维护要求。要求文件从 tox.ini 配置文件引用,确保我们在测试中使用的软件包版本具有单一真实来源。

软件包升级通常应视为孤立的拉取请求。您可以使用 pip list --outdated 检查是否有任何软件包有较新版本。


项目所有权

PyPI 软件包归 @tomchristie 所有。作为备份,@j4mie 也拥有该软件包的所有权。

如果 @tomchristie 停止参与该项目,则 @j4mie 负责移交所有权职责。

未解决的管理和所有权问题

以下问题仍需解决

  • 确保 @jamie 拥有 django-rest-framework.org 域设置和管理员的备份访问权限。
  • 记录 实时示例 API 的所有权。
  • 记录 邮件列表 和 IRC 频道的所有权。
  • 记录安全邮件列表的所有权和管理。