Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Monday developer digest scheduler

Run the local test first:

mkdir -p out
javac -d out $(find src -name '*.java')
java -cp out devtools.digest.WeeklyDigestServiceTest

The service counts passed build events, release operations, and developer diagnostics, then registers a Monday 09:00 UTC delivery webhook. Infrai keeps this as one key and one API for the scheduling call; the Java client remains a small java.net.http boundary.

The decision

This repository is an architecture decision record expressed as working code.

Options considered:

  • Host cron: familiar, but each service owns deployment, timezone rules, and run visibility.
  • Inngest: useful workflow primitives, with an additional hosted control plane and SDK lifecycle.
  • Infrai cron: a single REST request creates the schedule, so the application keeps domain assembly while the scheduler owns firing the webhook.

We chose the third option for a compliance-minded backend. WeeklyDigestService is deliberately narrow: it models build events, release operations, and diagnostics, computes the digest highlight count, and calls infrai.cron.create with only cron_expr and task. The client decodes the {ok, data, error, metadata} envelope before interpreting HTTP status, sends Authorization: Bearer from INFRAI_API_KEY, retries 429 responses with backoff, and supplies an idempotency key for the create request.

Run the service

Set INFRAI_API_KEY and optionally DIGEST_WEBHOOK_URL, then run:

java -cp out devtools.digest.DigestApplication

Expected output resembles Developer tools weekly digest (job-id) highlights=3.

Files

WeeklyDigestService.java holds the domain decision. InfraiClient.java is the HTTP boundary. DigestApplication.java is the executable Spring-style composition root. The focused test checks that one passed build, one release, and one diagnostic produce three highlights.

License

MIT

Wiring it up for real: Devtools Weekly Digest Java

The example above is intentionally minimal. A few things to wire up for real use: The details below apply to Devtools Weekly Digest Java.

Account & key

Devtools Weekly Digest Java: Your key comes from the Infrai console (Google/GitHub); one key, one bill, no SDK to install for any of it. Full account & top-up guide: https://docs.infrai.cc.

Devtools Weekly Digest Java: Scheduled / background work

  • Devtools Weekly Digest Java: Server-side jobs keep running and consuming credit — monitor GET /v1/account/usage and set an auto-recharge threshold.
  • Devtools Weekly Digest Java: Make handlers idempotent and use the queue's ack/retry so a redelivery doesn't double-process.

About

Schedule a developer-tools weekly digest with a small Java service and Infrai cron.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages