Add Recent Runs visibility for rule executions

Merged
JJ
1y ago
+636-45

Adds a comprehensive tracking system for rule execution history with the following features:

  • Creates RuleRun model to track execution metadata:

    • Date/time of execution
    • Execution type (manual/scheduled)
    • Success/failure status
    • Rule reference
    • Transaction counts (processed and modified)
    • Error messages for failed runs
  • Updates RuleJob to automatically record execution results:

    • Captures transaction processing statistics
    • Handles success/failure states
    • Stores error details for debugging
  • Adds "Recent Runs" section to rules index page:

    • Paginated display (20 runs per page)
    • Columnar layout similar to LLM usage page
    • Visual status indicators (success/failed badges)
    • Error tooltips for failed runs
    • Responsive design with design system tokens
  • Includes i18n translations for all user-facing strings

This provides users with visibility into rule execution history, making it easier to debug issues and monitor rule performance.

Screenshot

Screenshot 2025-12-07 at 2 30 51β€―PM

Summary by CodeRabbit

  • New Features

    • "Recent Runs" on the rules page with pagination, timestamps, execution type (manual/scheduled), status (with error tooltip) and transaction counts.
    • Rules now persist run records (queued/processed/modified, pending/success/failed) and report live progress from background jobs.
  • Documentation

    • Added UI translations for Recent Runs (EN, CA, DE, ES, NB, RO, TR).
  • Tests

    • Adjusted a test to lock the entry-level attribute used by rule actions.

✏️ Tip: You can customize this high-level summary in your review settings.