You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Address PR #68 review: make the history feature flag a true on/off switch
MONITOR_HISTORY_ENABLED was read-path only, so "default off" still ran
per-check ingestion and the hourly aggregate / daily prune jobs. Plus
follow-up correctness and clarity fixes from the code review.
Feature flag (blocker):
- Add MonitorCheckLogService::logCheckIfEnabled(); all automatic per-check
ingestion (uptime hooks, certificate listeners, domain verification) now
no-ops when the flag is off. logCheck() stays unconditional for operator
paths (backfill, seeder) so history can still be pre-staged.
- Gate monitor:aggregate-check-metrics and monitor:prune-check-history behind
->when(config('monitor-history.enabled')) and add withoutOverlapping().
Core uptime/certificate/domain checks remain ungated.
Correctness / clarity:
- Extract DomainService::resolveExpirationNotifications() and cover the
expiry-warning thresholds with tests (locks the whole-day int behaviour).
- Reword monitor:backfill-check-history so it no longer implies multi-day
history: it writes one current-state snapshot per enabled check type and
--days only sizes the aggregation window. Locked with a test.
- Heatmap legend now reflects every colour getCellClasses() emits (green/red
gradients + yellow), not a single swatch per status.
Docs / hygiene:
- Document the flag semantics, a revised rollout checklist, and the dedicated
monitor_test MySQL database the suite requires.
- Untrack the accidentally committed .phpunit.cache artifact and gitignore it.
Tests: 48 passed (was 34). Pint clean. Frontend build clean.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/installation.md
+29Lines changed: 29 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -107,3 +107,32 @@ Before you start following the guidelines, make sure to go through the [prerequi
107
107
php artisan serve
108
108
```
109
109
Note- php artisan serve command will start a development server on your local machine that listens to port 8000 by default. This command will provide a link in the terminal which we can copy and paste it in our browser and see our laraver application.
110
+
111
+
## Running tests
112
+
113
+
The test suite runs against MySQL (not SQLite) so `RefreshDatabase` exercises the
114
+
same engine as production. It uses a **dedicated** database named `monitor_test`
115
+
(configured in`phpunit.xml`) so tests never touch your development data — a guard
116
+
test fails fast if the suite is pointed anywhere else.
117
+
118
+
1. Create the test database once:
119
+
120
+
```sh
121
+
mysql -u root -e "CREATE DATABASE IF NOT EXISTS monitor_test;"
122
+
```
123
+
124
+
(Adjust the user/host to match your `.env`. No data needs to be seeded —
125
+
migrations run automatically.)
126
+
127
+
2. If `php artisan config:cache` was ever run, clear it first, otherwise the cached
128
+
`DB_DATABASE` overrides `phpunit.xml` and the suite would run against your dev DB:
0 commit comments