[Event-Bus E2E] Forgejo PR → event bus → Gotify push + email + observer goal evaluation #28

Open
opened 2026-09-09 23:43:55 +00:00 by poimen · 0 comments
Member

What

End-to-end verification that the full event pipeline works.

Depends On

  • #20 Gotify deployed
  • #21 Event router
  • #22 Forgejo adapter
  • #23 Target dispatchers
  • #24 ObserverWorkflow

Test Scenario

Happy Path

  1. Create a PR in homelab repo (via API or manual)
  2. Forgejo webhook fires to POST /v1/events/forgejo
  3. Gateway adapter translates to {source:"forgejo", type:"pr.created", subject:"rock/homelab#N"}
  4. Router matches → targets: gotify, sqs:forgejo-events, temporal
  5. All 3 targets receive the event

Verification Commands

# 1. Check gateway audit log
kubectl -n api logs -l app=api-gateway --since=60s | grep "event routed"
# Expect: {"source":"forgejo","type":"pr.created","targets":"gotify,sqs:forgejo-events,temporal"}

# 2. Check Gotify received message
curl -s -H "X-Gotify-Key: <client-token>" gotify.notifications.svc/message | jq .messages[0]
# Expect: title contains "pr.created"

# 3. Check SMTP sidecar sent email
kubectl -n notifications logs deploy/gotify -c smtp-emailer --since=60s | grep "Email sent"
# Expect: "Email sent for message N: pr.created"

# 4. Check inbox
# Expect: email at [email protected] within 60s

# 5. Check SQS queue
curl -s sqs-mgmt.sqs.svc/queue/forgejo-events/messages
# Expect: event JSON with source=forgejo, type=pr.created

# 6. Check Temporal ObserverWorkflow
# Temporal Web UI → observer-main → Event History → SignalExternalWorkflowExecutionInitiated
# Expect: signal contains the pr.created event

# 7. Check goal evaluation
kubectl -n poimen logs deploy/poimen-workflows --since=60s | grep "goal evaluated"
# Expect: pr_review_sla timer started for this PR

Failure Scenarios

  • Gotify down: event still delivered to SQS and Temporal, Gotify dispatch logged as failed
  • SQS down: event still delivered to Gotify and Temporal, SQS dispatch → DLQ
  • Temporal down: event still delivered to Gotify and SQS, Temporal dispatch logged as failed
  • Invalid HMAC: Forgejo webhook with tampered payload → 403, no event routed

Acceptance

  • PR creation triggers full pipeline — all 7 verification commands pass
  • Email received within 60s of PR creation
  • Push notification received on Gotify mobile/desktop client
  • SQS message matches canonical event schema
  • Observer goal evaluation visible in Temporal Web UI
  • Each failure scenario verified: partial outage does not block healthy targets
  • Merge PR → pr.merged event flows through same pipeline with correct type
## What End-to-end verification that the full event pipeline works. ## Depends On - #20 Gotify deployed - #21 Event router - #22 Forgejo adapter - #23 Target dispatchers - #24 ObserverWorkflow ## Test Scenario ### Happy Path 1. Create a PR in homelab repo (via API or manual) 2. Forgejo webhook fires to `POST /v1/events/forgejo` 3. Gateway adapter translates to `{source:"forgejo", type:"pr.created", subject:"rock/homelab#N"}` 4. Router matches → targets: gotify, sqs:forgejo-events, temporal 5. All 3 targets receive the event ### Verification Commands ```bash # 1. Check gateway audit log kubectl -n api logs -l app=api-gateway --since=60s | grep "event routed" # Expect: {"source":"forgejo","type":"pr.created","targets":"gotify,sqs:forgejo-events,temporal"} # 2. Check Gotify received message curl -s -H "X-Gotify-Key: <client-token>" gotify.notifications.svc/message | jq .messages[0] # Expect: title contains "pr.created" # 3. Check SMTP sidecar sent email kubectl -n notifications logs deploy/gotify -c smtp-emailer --since=60s | grep "Email sent" # Expect: "Email sent for message N: pr.created" # 4. Check inbox # Expect: email at [email protected] within 60s # 5. Check SQS queue curl -s sqs-mgmt.sqs.svc/queue/forgejo-events/messages # Expect: event JSON with source=forgejo, type=pr.created # 6. Check Temporal ObserverWorkflow # Temporal Web UI → observer-main → Event History → SignalExternalWorkflowExecutionInitiated # Expect: signal contains the pr.created event # 7. Check goal evaluation kubectl -n poimen logs deploy/poimen-workflows --since=60s | grep "goal evaluated" # Expect: pr_review_sla timer started for this PR ``` ### Failure Scenarios - [ ] Gotify down: event still delivered to SQS and Temporal, Gotify dispatch logged as failed - [ ] SQS down: event still delivered to Gotify and Temporal, SQS dispatch → DLQ - [ ] Temporal down: event still delivered to Gotify and SQS, Temporal dispatch logged as failed - [ ] Invalid HMAC: Forgejo webhook with tampered payload → 403, no event routed ## Acceptance - [ ] PR creation triggers full pipeline — all 7 verification commands pass - [ ] Email received within 60s of PR creation - [ ] Push notification received on Gotify mobile/desktop client - [ ] SQS message matches canonical event schema - [ ] Observer goal evaluation visible in Temporal Web UI - [ ] Each failure scenario verified: partial outage does not block healthy targets - [ ] Merge PR → `pr.merged` event flows through same pipeline with correct type
poimen added this to the Event-Driven Platform milestone 2026-09-09 23:43:55 +00:00
Sign in to join this conversation.