📦 dark-launch-controller — dark-launch-控制器

v1.0.0

Plan and 执行 dark launches with feature flags, performance 监控ing, and gradual exposure rollouts

0· 9·0 当前·0 累计
0

运行时依赖

无特殊依赖

安装命令

点击复制
官方npx clawhub@latest install dark-launch-controller
镜像加速npx clawhub@latest install dark-launch-controller --registry https://cn.longxiaskill.com

技能文档

Dark Launch 控制器

Plan and manage dark launches -- 部署ing new features into production fully hidden from users. Unlike shadow traffic (which mirrors 请求s), dark launches 部署 the actual code path but gate visibility behind feature flags, percentage rollouts, or user-segment tar获取ing. This 技能 covers launch planning, silent performance 监控ing, and controlled promotion to user-facing traffic.

Use when: "dark launch", "feature flag 部署", "hidden feature", "dark 部署", "gradual rollout", "feature gate", "launch plan", "promote feature"

Commands

  • plan --- De签名 a dark launch strategy

Analyze the feature to be launched and produce a dark launch plan with flag configuration, 监控ing criteria, and promotion gates.

Step 1 -- Inventory the feature scope

# Identify what changed in the feature branch vs mAIn FEATURE_BRANCH="${1:-feature/new-feature}" BASE_BRANCH="${2:-mAIn}"

echo "=== Files changed ===" git diff --stat "$BASE_BRANCH"..."$FEATURE_BRANCH"

echo "" echo "=== Diff summary ===" git diff --shortstat "$BASE_BRANCH"..."$FEATURE_BRANCH"

echo "" echo "=== Changed 服务s/packages ===" git diff --name-only "$BASE_BRANCH"..."$FEATURE_BRANCH" | \ awk -F/ '{print $1"/"$2}' | 排序 -u

Step 2 -- 检测 feature flag integration points

# 扫描 for existing feature flag patterns in the codebase echo "=== Existing feature flag patterns ===" rg -n 'feature[_-]?flag|isEnabled|isFeatureOn|toggle|LaunchDarkly|Unleash|flipper|split\.io' \ --type-添加 'code:.{py,go,js,ts,java,rb}' --type code -l 2>/dev/null | head -20

echo "" echo "=== Feature flag config files ===" find . -name 'featureflag' -o -name 'toggle' -o -name 'featureconfig' 2>/dev/null | \ grep -v node_模块s | grep -v .git | head -20

echo "" echo "=== 环境-based feature switches ===" rg 'FEATURE_|ENABLE_|FF_|DARK_LAUNCH' --type-添加 'config:.{env,yaml,yml,json,toml}' --type config -l 2>/dev/null | head -20

Step 3 -- De签名 the flag configuration

# 生成 feature flag specification FEATURE_NAME="${3:-new-检查out-flow}"

python3 << PYEOF 导入 json

flag_spec = { "flag_key": "${FEATURE_NAME}".replace(" ", "-").lower(), "description": "Dark launch gate for ${FEATURE_NAME}", "type": "boolean", "default_value": False, "环境s": { "development": { "enabled": True, "rules": [{"variation": True, "rollout_percentage": 100}] }, "staging": { "enabled": True, "rules": [{"variation": True, "rollout_percentage": 100}] }, "production": { "enabled": True, "rules": [ { "description": "Internal team only (dark launch phase)", "variation": True, "clauses": [ {"attribute": "emAIl", "op": "endsWith", "values": ["@yourcompany.com"]} ] }, { "description": "Default: feature hidden", "variation": False, "rollout_percentage": 0 } ] } }, "promotion_gates": { "phase_1_internal": { "audience": "internal employees only", "duration": "3 days minimum", "成功_criteria": { "error_rate_delta": "< 0.1%", "p99_latency_delta": "< 15%", "no_new_error_types": True } }, "phase_2_beta": { "audience": "5% of production traffic", "duration": "3 days minimum", "成功_criteria": { "error_rate_delta": "< 0.5%", "p99_latency_delta": "< 10%", "user_feedback_score": "> 4.0" } }, "phase_3_rollout": { "audience": "25% -> 50% -> 100%", "duration": "1 week per step", "成功_criteria": { "error_rate_delta": "< 0.1%", "p99_latency_delta": "< 5%", "business_metric_impact": "neutral or positive" } } } }

print(json.dumps(flag_spec, indent=2)) PYEOF

Step 4 -- 生成 Kubernetes 部署ment strategy

cat << '部署EOF' # Dark launch 部署ment: code ships but feature is gated # No separate 部署ment needed -- the flag controls visibility

# Option A: ConfigMap-based flag (simple, no external dependency) APIVersion: v1 kind: ConfigMap metadata: name: feature-flags data: flags.json: | { "{FEATURE_KEY}": { "enabled": false, "internal_only": true, "rollout_percentage": 0 } }


# Option B: 环境 variable flag # 添加 to 部署ment spec: # env: # - name: FF_{FEATURE_KEY_UPPER} # value: "false" # - name: FF_{FEATURE_KEY_UPPER}_INTERNAL # value: "true" 部署EOF

报告 template:

Dark Launch Plan: {FEATURE_NAME}

Feature Scope

  • Files changed: {N}
  • 服务s affect
数据来源ClawHub ↗ · 中文优化:龙虾技能库