Skip to content

Report weekly dataset/model counts to services reporting webhook - #76

Open
nee1k wants to merge 1 commit into
mainfrom
weekly-services-report-webhook
Open

nee1k wants to merge 1 commit into
mainfrom
weekly-services-report-webhook

Conversation

@nee1k

@nee1k nee1k commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds an opt-in weekly background job (ENABLE_WEEKLY_REPORT) that POSTs Patra's total model-card and datasheet counts to an external webhook (Carlos's services reporting board), per Beth's request — the board is currently being showcased.
  • Plain asyncio background task started/cancelled from rest_server/main.py's existing lifespan hook — no new dependency. Reports once immediately on startup, then every 7 days.
  • Webhook URL, auth token, and JSON payload shape (WEEKLY_REPORT_WEBHOOK_URL / WEEKLY_REPORT_WEBHOOK_TOKEN) are placeholders — Carlos's real spec isn't available yet. build_payload()/post_report() in rest_server/features/weekly_report/service.py are isolated so updating them later is a small, contained change.
  • Off by default everywhere (including docker-compose.backend.yml); a no-op even when enabled if the webhook URL isn't set.

Test plan

  • pytest tests/test_weekly_report.py -v — 13/13 new tests pass (count query, payload shape, webhook POST success/failure/auth, flag-gating, lifespan wiring)
  • pytest tests/ -v --ignore=tests/test_mcp_server.py — full suite, 200/200 pass, no regressions
  • Manual smoke test: built and ran the real Docker stack with ENABLE_WEEKLY_REPORT=true pointed at a local listener — confirmed an immediate POST on startup with the expected payload shape and Authorization: Bearer <token> header
  • Confirm Carlos's actual webhook URL/auth/payload spec and update build_payload()/post_report() accordingly before enabling in production

Beth wants Patra to periodically report its dataset and model counts to
Carlos's services reporting board, which is currently being showcased.
Adds an opt-in (ENABLE_WEEKLY_REPORT) asyncio background task that posts
counts on startup and every 7 days after. Webhook URL/token and payload
shape are placeholders pending Carlos's actual spec.
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