{"id":31761115,"url":"https://github.com/kvist-no/digestive","last_synced_at":"2026-04-16T11:02:27.650Z","repository":{"id":315442510,"uuid":"864132643","full_name":"kvist-no/digestive","owner":"kvist-no","description":"Service that is responsible for once a day sending a gRPC call to a microservice so that it triggers the creation and delivery of the daily email digests for our customers.","archived":false,"fork":false,"pushed_at":"2025-09-18T15:08:41.000Z","size":53,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-18T18:08:01.897Z","etag":null,"topics":["digest","grpc","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kvist-no.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-09-27T14:53:24.000Z","updated_at":"2025-09-18T15:08:45.000Z","dependencies_parsed_at":"2025-09-18T18:08:37.625Z","dependency_job_id":"cc06a6ea-28b9-476d-b095-11a35975382c","html_url":"https://github.com/kvist-no/digestive","commit_stats":null,"previous_names":["kvist-no/digestive"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/kvist-no/digestive","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kvist-no%2Fdigestive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kvist-no%2Fdigestive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kvist-no%2Fdigestive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kvist-no%2Fdigestive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kvist-no","download_url":"https://codeload.github.com/kvist-no/digestive/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kvist-no%2Fdigestive/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002052,"owners_count":26083286,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["digest","grpc","rust"],"created_at":"2025-10-09T21:46:56.447Z","updated_at":"2025-10-09T21:46:57.893Z","avatar_url":"https://github.com/kvist-no.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Digestive\n\n[![CI](https://github.com/kvist-no/digestive/workflows/Rust/badge.svg)](https://github.com/kvist-no/digestive/actions)\n\nAn app for sending a preconfigured gRPC command to trigger daily email digest generation. Purpose built to be run as a CronJob in a Kubernetes cluster with Sentry monitoring.\n\n## How It Works\n\nThe service performs these steps:\n1. Reports job start to Sentry for monitoring\n2. Connects to your notification service via gRPC and sends a command to trigger digest email generation\n4. Reports success/failure status back to Sentry\n\n## Configuration\n\nConfigure the service using these environment variables:\n\n### Required Variables\n```env\n# Which environment we're running in (used for Sentry monitoring)\nENVIRONMENT=staging\nCRON_URL=https://oxxxxxxxxxxxxxxxx.ingest.de.sentry.io/api/xxxxxxxxxxxxxxxx/cron/digest-trigger/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/\nNOTIFICATION_SERVICE_URL=https://notification.init.svc.cluster.local:8080\nRUST_LOG=info\n```\n\n### Optional Variables (with defaults)\n```env\n# Who is sending the command (shown in logs and potentially forwarded)\nCOMMAND_FROM=\"Kubernetes Debrief Trigger CronJob\"\n# The specific command to send to the notification service\nCOMMAND_COMMAND=\"SendDigestEmailsCommand\"\n# JSON data payload for the command\nCOMMAND_DATA=\"{\\\"template\\\":\\\"daily-digest\\\"}\"\n# Optional requester identifier\nCOMMAND_REQUESTER=\"\"\n```\n\n## Local Development \u0026 Testing\n\n### Prerequisites\n- Rust 1.70+ (`rustup` recommended)\n- Protocol Buffers compiler (`protoc`)\n\nOn macOS:\n```bash\nbrew install protobuf\n```\n\n### Build and Run\nUse `task`. Update `.env.local` to point to your local notification service.\n\n## Monitoring Your CronJob\n- Check CronJob status: `kubectl get cronjobs`\n- View recent job runs: `kubectl get jobs`\n- Check logs: `kubectl logs -l job-name=digestive-daily-\u003ctimestamp\u003e`\n- Monitor in Sentry for cron job health and failure alerts\n\n## Deployment as Kubernetes CronJob\n\nThis service is designed to run as a Kubernetes CronJob.\n\n**Production Usage**: This service is currently deployed in production at [kvist-no/infra](https://github.com/kvist-no/infra/blob/main/kubernetes/backend-tools/digest-trigger-cronjob.yaml#L39).\n\nHere's an example configuration:\n\n```yaml\napiVersion: batch/v1\nkind: CronJob\nmetadata:\n  name: digestive-daily\n  namespace: your-namespace\nspec:\n  # Run every day at 8 AM UTC\n  schedule: \"0 8 * * *\"\n  jobTemplate:\n    spec:\n      template:\n        spec:\n          restartPolicy: OnFailure\n          containers:\n          - name: digestive\n            image: your-registry/digestive:latest\n            env:\n            - name: ENVIRONMENT\n              value: \"staging\"\n            - name: CRON_URL\n              valueFrom:\n                secretKeyRef:\n                  name: digestive-secrets\n                  key: sentry-cron-url\n            - name: NOTIFICATION_SERVICE_URL\n              value: \"https://notification.init.svc.cluster.local:8080\"\n            - name: RUST_LOG\n              value: \"info\"\n            - name: COMMAND_DATA\n              value: '{\"template\":\"daily-digest\"}'\n            resources:\n              requests:\n                memory: \"32Mi\"\n                cpu: \"10m\"\n              limits:\n                memory: \"64Mi\"\n                cpu: \"100m\"\n          # Clean up completed jobs after 3 successful runs and 1 failed run\n          successfulJobsHistoryLimit: 3\n          failedJobsHistoryLimit: 1\n```\n\n### Kubernetes Secret for Sentry URL\n```yaml\napiVersion: v1\nkind: Secret\nmetadata:\n  name: digestive-secrets\n  namespace: your-namespace\ntype: Opaque\nstringData:\n  sentry-cron-url: \"https://oxxxxxxxxxxxxxxxx.ingest.de.sentry.io/api/xxxxxxxxxxxxxxxx/cron/digest-trigger/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkvist-no%2Fdigestive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkvist-no%2Fdigestive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkvist-no%2Fdigestive/lists"}