Skip to content

Revert SRE drill: restore AlitaBot startup#302

Merged
Szer merged 1 commit into
mainfrom
revert/sre-drill
Jul 27, 2026
Merged

Revert SRE drill: restore AlitaBot startup#302
Szer merged 1 commit into
mainfrom
revert/sre-drill

Conversation

@Szer

@Szer Szer commented Jul 27, 2026

Copy link
Copy Markdown
Owner

Reverts the deliberate startup failure from #298. The drill is complete and succeeded.

Drill results

Two deploy runs were needed, and the first one found a real gap.

Run 1 (30255492040)verify-deploy.sh caught the crashloop and classified it correctly:

FAILED: Pod is not healthy after 180s grace period. Health: Progressing
Failure class: app

Then notify-failure: skipped, sre: skipped. Cause: alita-deploy.yml had sre-enabled: false, making AlitaBot the one bot in the fleet without SRE coverage — while sre.md claimed "every bot ... opts into SRE coverage by default." Fixed in #300.

Run 2 (30256392998)deploy / sre / investigate: success. The SRE agent executed for the first time in its existence and filed the incident report on #301.

What the agent got right

Decision Outcome
Severity P2, correctly — recognised the old ReplicaSet was still serving
Rollback Declined. "No rollback performed — not required. Existing replicas remained healthy"
ArgoCD auto-sync Left enabled. Never disabled it, so the if: always() re-enable was never needed
Root cause Found it in Loki, quoted the exception verbatim, named the exact commit
Closure Structured incident report, issue closed

Declining the rollback is the important one: rolling back a P2 where the old pod is healthy would have been unnecessary disruption, and the agent has the ArgoCD permissions to do it.

Validated in production

🤖 Generated with Claude Code

https://claude.ai/code/session_01P41roCWN5Fec7m69sSaunU

@Szer
Szer merged commit a655e1f into main Jul 27, 2026
4 checks passed
@Szer
Szer deleted the revert/sre-drill branch July 27, 2026 10:17
Szer added a commit that referenced this pull request Jul 27, 2026
…ent validation, take 2 (#303)

Deliberate, owner-authorized production drill, second in the series (see #298/#302 for
take 1 — a STARTUP failure that correctly did not trigger a rollback, since the old pod
kept serving). This one is different on purpose: startup and /healthz succeed normally, so
Kubernetes retires the old ReplicaSet and this broken one takes over — AlitaBot looks
healthy to Kubernetes while being functionally dead, which should push the SRE agent
toward a rollback this time.

Two failure points, both logging SRE_DRILL_RUNTIME_FAILURE at Error via the existing
Serilog logger, both gated on `not TestMode`:
- DrillRuntimeFailureLoop: a hosted BackgroundService ticking every 15s, throwing and
  logging Error on every tick — traffic-independent, so it fires within
  verify-deploy.sh's 2-minute Loki error-log window even though AlitaBot is dormant and
  can go days without an inbound Telegram update.
- The webhook update handler now throws before calling BotService.OnUpdate, so real
  Telegram updates fail too (secondary; the loop above is what actually gets detected).

Gate verified live: prod bot_setting.TEST_MODE = 'false'; tests/AlitaBot.Tests sets
TEST_MODE=true via both the container env var and a seeded bot_setting row
(ContainerTestBase.fs). AlitaBot-only; no migration/config/Helm/workflow changes.

REVERT IMMEDIATELY AFTER THE DRILL via `git revert` of this commit.


Claude-Session: https://claude.ai/code/session_01P41roCWN5Fec7m69sSaunU

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant