Repository navigation
CI: add a protected 25-to-20 indexer cap rollback - #662
khaliqgant wants to merge 2 commits into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
There was a problem hiding this comment.
🔍 Devin Review: 2 flags
Not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)
Confidence Score: 5/5
[Medium impact] The reviewed changes appear safe to merge; protected execution still requires the documented rollout approvals and mapping grant.
|
There was a problem hiding this comment.
1 issue found across 4 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="terraform/examples/aws-hosted-session-pipeline/README.md">
<violation number="1" location="terraform/examples/aws-hosted-session-pipeline/README.md:107">
P1: This checklist requires a mapping-only apply permission, but the protected apply role used by this workflow can be configured with broad writes to every managed resource. Provision and select a dedicated mapping-only role or add an enforced mapping-only scope before treating this rollback as protected.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
|
|
||
| Before the first raise, attach the successful import-only plan and apply | ||
| receipts, the old-writer freeze and transfer receipt, verification of the | ||
| mapping-only apply permission, and the protected rollback operator |
There was a problem hiding this comment.
P1: This checklist requires a mapping-only apply permission, but the protected apply role used by this workflow can be configured with broad writes to every managed resource. Provision and select a dedicated mapping-only role or add an enforced mapping-only scope before treating this rollback as protected.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At terraform/examples/aws-hosted-session-pipeline/README.md, line 107:
<comment>This checklist requires a mapping-only apply permission, but the protected apply role used by this workflow can be configured with broad writes to every managed resource. Provision and select a dedicated mapping-only role or add an enforced mapping-only scope before treating this rollback as protected.</comment>
<file context>
@@ -100,7 +100,21 @@ concurrency headroom, including other mappings on the function. Dispatch
+
+Before the first raise, attach the successful import-only plan and apply
+receipts, the old-writer freeze and transfer receipt, verification of the
+mapping-only apply permission, and the protected rollback operator
+assignment. Confirm `DelaySeconds` is 30 and stays at 30 in the reviewed plan.
+A code landing alone does not authorize an apply.
</file context>
There was a problem hiding this comment.
Addressed the deployment dependency in 6e7f2e69. This workflow must use the exact-mapping apply scope from #663 in both directions. The runbook now requires the approved bootstrap run and verified permission on the protected environment's role before use, and excludes the broader full role. #662 stays held for source review. The permission is a separate change and needs its own owner-approved saved plan.
There was a problem hiding this comment.
2 issues found across 2 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="scripts/hosted/tests/smoke.sh">
<violation number="1" location="scripts/hosted/tests/smoke.sh:106">
P2: This mismatch case does not verify that the plan was rejected before claiming its one-time apply attempt. Assert that the `102-1` `apply-attempt.json` object is absent, otherwise a claim-before-validation regression can pass the smoke test and consume the saved plan.</violation>
</file>
<file name="terraform/examples/aws-hosted-session-pipeline/README.md">
<violation number="1" location="terraform/examples/aws-hosted-session-pipeline/README.md:91">
P3: This link points to a nonexistent `indexer-mapping-scope` section, so operators cannot use the runbook to verify the required mapping-only permission. Add the referenced section or link to the actual policy documentation.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
| if GATE_ALLOW="$rollback" INDEXER_MAX_CONCURRENCY=20 "$SCRIPT" apply "$T/rollbackfwd" 214-1 102-1 "$sha3" >"$T/rollbackfwd.log" 2>&1; then | ||
| echo "FAIL: rollback apply accepted a forward plan"; exit 1 | ||
| fi | ||
| grep -q "GATE_ALLOW changed since the plan" "$T/rollbackfwd.log" \ |
There was a problem hiding this comment.
P2: This mismatch case does not verify that the plan was rejected before claiming its one-time apply attempt. Assert that the 102-1 apply-attempt.json object is absent, otherwise a claim-before-validation regression can pass the smoke test and consume the saved plan.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At scripts/hosted/tests/smoke.sh, line 106:
<comment>This mismatch case does not verify that the plan was rejected before claiming its one-time apply attempt. Assert that the `102-1` `apply-attempt.json` object is absent, otherwise a claim-before-validation regression can pass the smoke test and consume the saved plan.</comment>
<file context>
@@ -97,19 +97,26 @@ if "$SCRIPT" apply "$T/a6" 205-1 102-1 "$sha3" >/dev/null 2>&1; then echo "FAIL:
+if GATE_ALLOW="$rollback" INDEXER_MAX_CONCURRENCY=20 "$SCRIPT" apply "$T/rollbackfwd" 214-1 102-1 "$sha3" >"$T/rollbackfwd.log" 2>&1; then
+ echo "FAIL: rollback apply accepted a forward plan"; exit 1
+fi
+grep -q "GATE_ALLOW changed since the plan" "$T/rollbackfwd.log" \
+ || { echo "FAIL: rollback apply did not check the forward plan's gate binding"; exit 1; }
okrun 103
</file context>
| grep -q "GATE_ALLOW changed since the plan" "$T/rollbackfwd.log" \ | |
| grep -q "GATE_ALLOW changed since the plan" "$T/rollbackfwd.log" \ | |
| || { echo "FAIL: rollback apply did not check the forward plan's gate binding"; exit 1; } | |
| [ ! -e "$T/s3/plans_hosted_session-pipeline_102-1_apply-attempt.json" ] \ | |
| || { echo "FAIL: rollback apply claimed an attempt before rejecting the plan"; exit 1; } |
| zero-diff adoption and the writer handoff, with the existing mapping write | ||
| permission in the protected apply role. The operation supplies the target | ||
| zero-diff adoption and the writer handoff, with the protected apply role | ||
| provisioned in [indexer mapping scope](../aws-hosted-session-pipeline-ci/README.md#indexer-mapping-scope). |
There was a problem hiding this comment.
P3: This link points to a nonexistent indexer-mapping-scope section, so operators cannot use the runbook to verify the required mapping-only permission. Add the referenced section or link to the actual policy documentation.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At terraform/examples/aws-hosted-session-pipeline/README.md, line 91:
<comment>This link points to a nonexistent `indexer-mapping-scope` section, so operators cannot use the runbook to verify the required mapping-only permission. Add the referenced section or link to the actual policy documentation.</comment>
<file context>
@@ -87,8 +87,9 @@ state (no destroy) and the deploy guard is verified; only then is the freeze lif
-zero-diff adoption and the writer handoff, with the existing mapping write
-permission in the protected apply role. The operation supplies the target
+zero-diff adoption and the writer handoff, with the protected apply role
+provisioned in [indexer mapping scope](../aws-hosted-session-pipeline-ci/README.md#indexer-mapping-scope).
+The operation supplies the target
after the private tfvars on the Terraform command line. The default `adopt`
</file context>
Change
Add an explicit
rollback-indexer-capoperation to the dispatch-only hosted pipeline workflow. It pins the target to 20 and admits only an in-place 25-to-20 change to the existing indexer event source mapping's maximum concurrency. Plan and apply use the existing protected saved-plan requirements for SHA, run, attempt, digest, operation, and owner environment review.Keep import-only adoption as the default. Document the required state and writer receipts, mapping-only permission, rollback custody, watcher triggers, and readback of
DelaySeconds=30.Verification
All 29 zero-diff gate tests and the hosted CI smoke suite passed. The smoke test checks the target after private tfvars, the gate-binding refusal when either direction is given the other direction’s saved plan, and successful validation of the reverse operation using a mocked provider. Diff checks passed.
Review and rollout
This PR is stacked on #636 at
6a498fb2to show only the rollback delta. Retarget to main after #636 lands and confirm exact-head checks on the resulting PR. Hold for exact-head D5 static PASS, green CI and Infra Ops review. Both cap directions depend on the deployed exact-mapping apply scope from #663. Infra Ops owns protected execution and the owner approves the exact saved plan before an apply.