Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
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.asynciobackground task started/cancelled fromrest_server/main.py's existinglifespanhook — no new dependency. Reports once immediately on startup, then every 7 days.WEEKLY_REPORT_WEBHOOK_URL/WEEKLY_REPORT_WEBHOOK_TOKEN) are placeholders — Carlos's real spec isn't available yet.build_payload()/post_report()inrest_server/features/weekly_report/service.pyare isolated so updating them later is a small, contained change.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 regressionsENABLE_WEEKLY_REPORT=truepointed at a local listener — confirmed an immediate POST on startup with the expected payload shape andAuthorization: Bearer <token>headerbuild_payload()/post_report()accordingly before enabling in production