feat: add auto update script for all datasets in marked channels #178#181
Conversation
Add batch auto-update functionality that processes all datasets in channels with `allow_auto_update` enabled in their data_query config. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Refactor run_auto_update into discrete stage functions with log separators - Add per-channel result summary in check_auto_update_results (grouped by AutoUpdateResult) - Run deduplication automatically for channels that triggered reindex - Refactor create_auto_update_jobs to accept channel_ids and return job schemas - Use deployment_id in channel log messages for consistency Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Split check_auto_update_results into get_reindex_channel_ids and get_auto_update_results (returns AutoUpdateChannelResult data) - Move result logging to the auto_update script - Run deduplication before printing final statistics - Show reindex version status breakdown for REINDEX_TRIGGERED results Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
/deploy-review
|
Example of script logsNOTE: Tested locally with docker-compose.
|
The script was tested locally, but I verified that the admin backend still starts and runs in the Review environment.
|
- Log exceptions from asyncio.gather in job processing and deduplication - Move auto-update channel filtering from ChannelService to the script - Remove unused get_auto_update_channels and selectinload import - Use most_common() for deterministic result summary ordering - Batch commit instead of per-iteration flush when creating jobs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sort channel IDs before asyncio.gather to ensure correct error attribution in the zip loop. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Applicable issues
Description of changes
Adds a new
ADMIN_MODE=AUTO_UPDATEcontainer mode that runs a batch auto-update script for all datasets in channels withallow_auto_updateenabled.The script (
statgpt/admin/auto_update.py) performs four stages:@background_tasksemaphore)channel 'statgpt-sample' (id=1): 3 NO_CHANGES, 2 REINDEX_TRIGGERED (1 COMPLETED, 1 FAILED)Also adds
make statgpt_auto_updateandmake statgpt_fix_statusestargets.Checklist
Reviewenvironment.By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.