|
|
|
@@ -34,8 +34,12 @@ kubeseal --format=yaml --namespace=slack-relay \
|
|
|
|
|
> apps/overlays/upc-dev/slack-relay/slack-relay-secrets-sealed.yaml
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Then uncomment `slack-relay-secrets-sealed.yaml` in `kustomization.yaml` and
|
|
|
|
|
commit.
|
|
|
|
|
Then add `slack-relay-secrets-sealed.yaml` to `kustomization.yaml` and commit.
|
|
|
|
|
|
|
|
|
|
`namespace.yaml` in this directory exists for ordering: the app-of-apps applies
|
|
|
|
|
the SealedSecret, so the namespace has to be created by the same sync rather
|
|
|
|
|
than by the child Application's chart (`namespace.create: false` in the values).
|
|
|
|
|
Without it the parent sync fails with `namespaces "slack-relay" not found`.
|
|
|
|
|
|
|
|
|
|
| Key | Purpose |
|
|
|
|
|
|---|---|
|
|
|
|
@@ -59,13 +63,30 @@ add `SLACK_MODE=bot` to `app.extraEnv` in the values file.
|
|
|
|
|
|
|
|
|
|
## 3. Verify
|
|
|
|
|
|
|
|
|
|
Port-forward the service, then post a signed event. No Node needed — the
|
|
|
|
|
signature is an HMAC that `openssl` can compute:
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
kubectl -n slack-relay port-forward svc/slack-relay-app 3000:3000
|
|
|
|
|
AIGITBOT_WEBHOOK_SECRET=... node scripts/send-test-event.js http://localhost:3000
|
|
|
|
|
kubectl -n slack-relay port-forward svc/slack-relay-app 3000:3000 &
|
|
|
|
|
|
|
|
|
|
SECRET=$(kubectl -n slack-relay get secret slack-relay-secrets \
|
|
|
|
|
-o jsonpath='{.data.AIGITBOT_WEBHOOK_SECRET}' | base64 -d)
|
|
|
|
|
|
|
|
|
|
BODY='{"schemaVersion":1,"id":"smoke-1","eventType":"prworkflow.completed","timestamp":"2026-10-20T12:00:00Z","integration":{"botName":"review-bot","platform":"gitea"},"repository":{"owner":"Forte","name":"launchpad","pullRequest":42},"data":{"workflowKey":"review","status":"SUCCESS","durationMs":41230}}'
|
|
|
|
|
|
|
|
|
|
curl -i -X POST http://localhost:3000/hooks/ai-git-bot \
|
|
|
|
|
-H 'Content-Type: application/json' \
|
|
|
|
|
-H "X-EventHook-Signature-256: sha256=$(printf '%s' "$BODY" | openssl dgst -sha256 -hmac "$SECRET" -r | cut -d' ' -f1)" \
|
|
|
|
|
--data "$BODY"
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
(`scripts/send-test-event.js` lives in the slack-relay repo.) A real check is
|
|
|
|
|
ai-git-bot's own delivery log, which shows the response code per delivery.
|
|
|
|
|
`200 {"status":"delivered"}` means the message reached Slack. Re-running with
|
|
|
|
|
the same `id` returns `{"status":"duplicate"}` — bump the id to send another.
|
|
|
|
|
The same request is in `scripts/send-test-event.js` in the slack-relay repo if
|
|
|
|
|
Node is available.
|
|
|
|
|
|
|
|
|
|
The real check afterwards is ai-git-bot's own delivery log, which shows the
|
|
|
|
|
response code per delivery.
|
|
|
|
|
|
|
|
|
|
## Reading the logs
|
|
|
|
|
|
|
|
|
|