← 中文资源

简体中文版本

特性标记安全发布工作流

用特性标记按百分比渐进发布新功能,支持即时回滚。

阅读英文原文

概述

特性标记安全发布工作流是一个中级难度的工作流。用特性标记按百分比渐进发布新功能,支持即时回滚。该工作流的目标是:Deploy a new feature safely using gradual rollout with the ability to instantly roll back.

环境准备

执行本工作流需要以下环境:A feature flag system;A new feature behind a flag;Monitoring and alerting for the feature。请确保在开始前准备好所有必需的工具和资源,以避免中途因环境问题中断。

执行步骤

本工作流包含5个步骤。步骤1:Create the flag——Create a feature flag in the flag system with a description and owner. 步骤2:Roll out to 5 percent——Enable the flag for 5 percent of users and monitor for errors. 步骤3:Gradually increase——Increase the rollout percentage in stages: 25, 50, 75, 100 percent. 步骤4:Monitor each stage——Check error rates, performance, and user feedback at each stage before proceeding. 步骤5:Full rollout or rollback——Complete the rollout at 100 percent or roll back instantly if issues are detected.

验证与清理

预期结果:The new feature is safely rolled out to all users, or rolled back, with minimal risk at each stage.。验证方法:Monitor error rates and performance metrics at each rollout stage; confirm the flag can be turned off instantly.。清理操作:Disable the feature flag if issues are detected; clean up the flag after full successful rollout.。estimatedMinutes 为 45 分钟。

代码示例

# Execute the workflow steps as documented above
echo "Workflow completed successfully"