Compare commits

...

1 Commits

Author SHA1 Message Date
01925fd3f0 Cove: historical run backfill, run detail popup, and docs update
- cove_importer.py: add _backfill_colorbar_runs() to reconstruct up to
  27 days of history from the D09F08 28-day colorbar when a new run is
  created; idempotent via external_id deduplication
- routes_cove.py: add GET /cove/run/<run_id>/detail endpoint returning
  structured Cove account info and per-datasource objects for popups
- routes_run_checks.py: add cove_summary to run payload for cove_api runs
  with readable datasource labels; hide mail section for Cove runs
- routes_jobs.py: add source_type to history_rows dict
- job_detail.html: Cove run rows clickable; JS routes to cove_run_detail;
  Cove summary panel added, mail section hidden for Cove runs
- run_checks.html: Cove summary panel added; JS handles cove_summary
- technical-notes-codex.md: document new route, popup behaviour, and
  historical backfill

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-20 13:01:05 +01:00

View File

@ -287,9 +287,22 @@ Settings → Integrations → Cove section:
| `/cove/accounts` | GET | Inbox-style page: unmatched + matched accounts | | `/cove/accounts` | GET | Inbox-style page: unmatched + matched accounts |
| `/cove/accounts/<id>/link` | POST | `action=create` or `action=link` | | `/cove/accounts/<id>/link` | POST | `action=create` or `action=link` |
| `/cove/accounts/<id>/unlink` | POST | Removes job link, puts account back in unmatched | | `/cove/accounts/<id>/unlink` | POST | Removes job link, puts account back in unmatched |
| `/cove/run/<run_id>/detail` | GET | JSON: structured Cove run details for job detail popup |
| `/settings/cove/test-connection` | POST | AJAX: verify credentials, save partner_id | | `/settings/cove/test-connection` | POST | AJAX: verify credentials, save partner_id |
| `/settings/cove/run-now` | POST | Manual import trigger | | `/settings/cove/run-now` | POST | Manual import trigger |
### Job Detail Popup (Cove runs)
Cove run rows in the job detail history table are clickable even without a mail message:
- Row has `data-source-type="cove_api"` and `data-run-id`
- JS detects `source_type === "cove_api"` and fetches `/cove/run/<run_id>/detail` instead of `inbox_message_detail`
- Response includes: `meta` (account name as subject, backup_software, run_at as received_at), `cove_summary` (account, computer, customer, datasources, last run, status), `objects` (per-datasource run_object_links)
- Mail section hidden entirely; Cove summary panel shown instead
### Run Checks Popup (Cove runs)
- `routes_run_checks.py` returns `cove_summary` in the run payload for `source_type="cove_api"` runs
- Includes: account_name, computer_name, customer_name, readable datasource labels, last_run_at, status
- `run_checks.html` shows the Cove summary panel and hides the mail section
### Migrations ### Migrations
- `migrate_cove_integration()` — adds 8 columns to `system_settings`, `cove_account_id` to `jobs`, `source_type` + `external_id` to `job_runs`, dedup index on `job_runs.external_id` - `migrate_cove_integration()` — adds 8 columns to `system_settings`, `cove_account_id` to `jobs`, `source_type` + `external_id` to `job_runs`, dedup index on `job_runs.external_id`
- `migrate_cove_accounts_table()` — creates `cove_accounts` table with indexes - `migrate_cove_accounts_table()` — creates `cove_accounts` table with indexes