Skip to content

feat: add discord alerting for dependabot pull requests - #54

Open
xnoto wants to merge 1 commit into
mainfrom
feat/grafana-dependabot-alerts
Open

feat: add discord alerting for dependabot pull requests#54
xnoto wants to merge 1 commit into
mainfrom
feat/grafana-dependabot-alerts

Conversation

@xnoto

@xnoto xnoto commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

What

Grafana-side of the Dependabot PR alerting pipeline, fully managed as code via grafana-operator CRs:

File Purpose
contactpoint-discord.yaml GrafanaContactPoint (discord); webhook URL resolved from SOPS-encrypted discord-webhook Secret via valuesFrom (key token, matches .sops.yaml encrypted_regex)
notificationpolicy.yaml GrafanaNotificationPolicy — root route → discord. Owns the entire policy tree; extend route.routes for future alert sources
serviceaccount-alerts.yaml GrafanaServiceAccount (github-actions-alerts, Editor); operator mints the token into the grafana-alerts-token Secret (key token)
discord-webhook-secret.yaml SOPS-encrypted webhook URL (encrypt-only with repo age key)
kustomization.yaml, ksops-grafana-secrets.yaml wiring

After sync

Copy the generated token into tfroot-github/secrets/secrets.yaml as grafana_alerts_token (needed by the stacked tfroot-github PR):

kubectl --context k3s -n grafana get secret grafana-alerts-token -o jsonpath='{.data.token}' | base64 -d

If alert POSTs return 403, recreate the service account CR with role: Admin.

Merge order

Second, after shared-workflows#14. ArgoCD syncs on merge; contact point/policy/service account appear in Grafana automatically.

Validation

  • pre-commit run: check-yaml, kube-linter, gitleaks pass.
  • CRD shapes verified against grafana-operator v5.24.0 (the deployed version) examples and controller source.
  • kustomize build not run locally: the ksops generator requires the age private key; ArgoCD performs the build with its own key.

- GrafanaContactPoint (discord) resolves its webhook URL from the
  SOPS-encrypted discord-webhook Secret via valuesFrom
- GrafanaNotificationPolicy routes the whole policy tree to it
- GrafanaServiceAccount (github-actions-alerts, Editor) mints the token
  used by GitHub Actions to post alerts; stored in grafana-alerts-token
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