Document features deployed behind feature flags

原文:https://docs.gitlab.com/ee/development/documentation/feature_flags.html

Document features deployed behind feature flags

manbetx 客户端打不开使用功能标志来战略性地推出自己的功能的部署. 我们在功能标记后面记录功能的方式取决于其状态(启用或禁用). 状态更改时,进行更改的开发人员必须相应地更新文档 .

Criteria

根据部署功能标记后的 GitLab 功能的过程:

  • 默认情况下,功能标志应处于关闭状态.
  • 功能标记应尽可能短地保留在代码库中,以减少对功能标记记帐的需求.
  • 为了构建最终版本并为自我管理的用户提供功能,功能标志至少应至少默认为 on.

根据标志的状态,请参阅下面的文档说明:

注意:功能级别的**(CORE ONLY)**徽标或等效标记应添加到以下行和标题中,即启用/禁用功能标志,因为这样做需要管理员访问权限,因此,它表示不能由 GitLab.com 的普通用户完成.

Features disabled by default

对于默认情况下禁用的功能,如果由于缺乏完整性而无法使用它们,或者仍在内部评估中(例如,出于性能方面的考虑),请不要对其进行文档化 :仅在以下情况下添加(或合并)文档:该功能是安全的,可供最终用户使用和测试.

对于默认情况下禁用的功能标志,如果最终用户可以使用它们:

  • 说默认情况下它是禁用的.
  • 说是否在 GitLab.com 上启用了它.
  • 说说是否可以针对每个项目启用或禁用它.
  • 说出是否建议将其用于生产.
  • 记录如何启用和禁用它.

例如,对于默认情况下禁用的功能,可以在每个项目上启用或禁用 GitLab.com 上禁用的功能,并且不准备用于生产环境:

  1. # Feature Name
  2. > - [Introduced](link-to-issue) in GitLab 12.0.
  3. > - It's deployed behind a feature flag, disabled by default.
  4. > - It's disabled on GitLab.com.
  5. > - It's able to be enabled or disabled per-project
  6. > - It's not recommended for production use.
  7. > - To use it in GitLab self-managed instances, ask a GitLab administrator to [enable it](#anchor-to-section). **(CORE ONLY)**
  8. (...)
  9. ### Enable or disable <Feature Name> **(CORE ONLY)**
  10. <Feature Name> is under development and not ready for production use. It is
  11. deployed behind a feature flag that is **disabled by default**.
  12. [GitLab administrators with access to the GitLab Rails console](../path/to/administration/feature_flags.md)
  13. can enable it for your instance. <Feature Name> can be enabled or disabled per-project
  14. To enable it:
  15. ```ruby # Instance-wide
  16. Feature.enable(:<feature flag>)
  17. # or by project
  18. Feature.enable(:<feature flag>, Project.find(<project id>))

To disable it:

```ruby # Instance-wide Feature.disable(:)

or by project

Feature.disable(:, Project.find())

  1. ```
  2. 根据要记录的功能的状态来调整 Blur.
  3. ### Features that became enabled by default[](#features-that-became-enabled-by-default "Permalink")
  4. 对于默认启用的功能:
  5. * 假设默认情况下已启用它.
  6. * 说是否在 GitLab.com 上启用了它.
  7. * 说说是否可以针对每个项目启用或禁用它.
  8. * 说出是否建议将其用于生产.
  9. * 记录如何禁用和启用它.
  10. 例如,对于最初部署时默认情况下禁用的功能,默认情况下已启用,在 GitLab.com 上启用了该功能,该功能无法按项目启用或禁用,并且可以用于生产环境:

Feature Name

  • Introduced in GitLab 12.0.
  • It was deployed behind a feature flag, disabled by default.
  • Became enabled by default on GitLab 12.1.
  • It’s enabled on GitLab.com.
  • It’s not able to be enabled or disabled per-project
  • It’s recommended for production use.
  • For GitLab self-managed instances, GitLab administrators can opt to disable it. (CORE ONLY)

(…)

Enable or disable (CORE ONLY)

is under development but ready for production use. It is deployed behind a feature flag that is enabled by default. GitLab administrators with access to the GitLab Rails console can opt to disable it for your instance it cannot be enabled or disabled per-project.

To disable it:

```ruby Feature.disable(:)

  1. To enable it:
  2. ```ruby Feature.enable(:<feature flag>)
  1. 根据要记录的功能的状态来调整 Blur.
  2. ### Features directly enabled by default[](#features-directly-enabled-by-default "Permalink")
  3. 对于默认启用的功能:
  4. * 说默认情况下已启用.
  5. * 说是否在 GitLab.com 上启用了它.
  6. * 说说是否可以针对每个项目启用或禁用它.
  7. * 说出是否建议将其用于生产.
  8. * 记录如何禁用和启用它.
  9. For example, for a feature enabled by default, enabled on GitLab.com, cannot be enabled or disabled per-project, and ready for production use:

Feature Name

  • Introduced in GitLab 12.0.
  • It’s deployed behind a feature flag, enabled by default.
  • It’s enabled on GitLab.com.
  • It’s not able to be enabled or disabled per-project
  • It’s recommended for production use.
  • For GitLab self-managed instances, GitLab administrators can opt to disable it. (CORE ONLY)

(…)

Enable or disable (CORE ONLY)

is under development but ready for production use. It is deployed behind a feature flag that is enabled by default. GitLab administrators with access to the GitLab Rails console can opt to disable it for your instance.

To disable it:

```ruby Feature.disable(:)

  1. To enable it:
  2. ```ruby Feature.enable(:<feature flag>)
  1. 根据要记录的功能的状态来调整 Blur.
  2. ### Features with flag removed[](#features-with-flag-removed "Permalink")
  3. 功能准备就绪并且标记已删除后,请清理文档. 删除功能标记的提及,只保留一个在版本历史记录注释中提及该标记的注释:

Feature Name

(…) ```