Repository navigation
fix(problem-deploy): inject disruptions on asymmetric (same-account) rows - #1712
Conversation
…rows #1711 made resolveDeployment return same-account targets but assumed Lite rows carry neither competitorRoleArn nor externalIdParameterName. In reality the deploy-handler persists competitorRoleArn to the deployment row (deploy.ts:177) while externalIdParameterName only rides the deploy event detail (deploy.ts:259-261). So every COMPLETE row is asymmetric: role set, externalId absent. resolveDeployment then returned a target with a lone competitorRoleArn, which assumeCompetitorRole rejects via its both-or-neither guard ("must be provided together"). Lite disruptions still failed end-to-end — now throwing instead of the previous no_deployment no-op, but injecting nothing either way. Honor the same both-or-neither contract in resolveDeployment: emit the cross-account fields only when both are present; otherwise resolve a same-account target and let the executor inject with its own credentials (the ssm:SendCommand grant added in #1711). Verified against the live Lite deploy (hello-world-battle / frontend-down): the COMPLETE row carries competitorRoleArn=TenkaCloud-local-deploy-Role and no externalIdParameterName; the target EC2 (i-046414a66bfb65dd7) is SSM-managed and Online, so once the command is sent the injection lands. Closes #1710 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe PR fixes same-account deployment resolution by coupling ChangesSame-account/cross-account coupling
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1712 +/- ##
=======================================
Coverage 92.75% 92.75%
=======================================
Files 434 434
Lines 11899 11899
Branches 3655 3655
=======================================
Hits 11037 11037
Misses 295 295
Partials 567 567 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
PR-1711 のフォローアップ。Lite モードの障害注入がまだ end-to-end で動かない残りギャップを塞ぎます。Closes #1710。
PR-1711 は「Lite 行は
competitorRoleArn/externalIdParameterNameを両方持たない」前提でresolveDeploymentを緩めましたが、実際の deployment 行はそうなっていません:competitorRoleArnを行に永続化する(deploy.ts:177)externalIdParameterNameは deploy event detail にしか載せず、行には書かない(deploy.ts:259-261)→ 実際の COMPLETE 行は 「role 有・externalId 無」の非対称(Lite の実機 DDB で確認済み。
competitorRoleArn=arn:…:role/TenkaCloud-local-deploy-Role、externalIdParameterName欠落)。この行に対し PR-1711 後の
resolveDeploymentは lonecompetitorRoleArnを target に載せ、assumeCompetitorRoleの both-or-neither ガード(assume-competitor-role.ts:135-137)がcompetitorRoleArn and externalIdParameterName must be provided togetherで throw します。注入は依然として走りません(no_deployment の silent no-op が throw に変わっただけ)。修正
resolveDeploymentが cross-account fields をassumeCompetitorRoleと同じ both-or-neither 契約で扱うようにします:ssm:SendCommandgrant で注入)片方だけの行はそもそも AssumeRole 不能なので、same-account 扱いが唯一の動作可能な解釈です。
実機検証(Lite, account 672726205532 / ap-northeast-1)
tc-hello-world-battle-team-1の COMPLETE 行が非対称であることを DDB scan で確認i-046414a66bfb65dd7は SSM-managed / Online、stack にInstanceIdOutput あり → executor が SendCommand を発行すれば着地するFollow-up(本 PR スコープ外)
SaaS (cross-account) の disruption は
externalIdParameterNameが行に永続化されていないため従来から一度も動作していません(旧実装でも常にno_deployment)。真の cross-account 注入には deploy-handler での externalId 永続化 + executor role へのsts:AssumeRole付与(IAM)が必要で、別 issue として扱うべきです。本 PR は SaaS の挙動を変えません(後述)。Test plan
disruption-executor-store.test.tsに非対称行(role 有・externalId 無)→ same-account target を pin するテストを追加。修正前 FAIL(lonecompetitorRoleArnが target に混入することを実証)→ 修正後 PASS の両方向確認済みdisruption-*.test.ts全 14 file / 186 tests green、tsc --noEmitclean、make harnessno findings、biome cleanRegression analysis
no_deployment(no-op)、PR-1711 実装は throw、本修正は same-account injection 試行(対象 instance が control account に無く SendCommand が InvalidInstanceId で fail)。いずれも「注入されない」点は同じで、動いていたものを壊す回帰はなし。将来 externalId が永続化されれば両方 string → cross-account 経路が従来どおり機能する(既存テストで pin 済み)resolveDeploymentの戻り値構築のみの修正)Physical impact
make deploy)Summary by CodeRabbit
Bug Fixes
Testing