Skip to content

Release: consistent health checks - #42

Merged
StanBarrows merged 6 commits into
productionfrom
main
Oct 23, 2026
Merged

StanBarrows merged 6 commits into
productionfrom
main

Conversation

@StanBarrows

Copy link
Copy Markdown
Contributor

Rolls out the health check set agreed for all Laravel Cloud apps.

P1 – consistent health checks (6df09d7)

  • Adds CacheCheck, OptimizedAppCheck, JobsCheck, FailedJobsCheck, PendingMigrationsCheck, ProductionConfigCheck (production only) and SchedulePolicyCheck, with unit tests.
  • SecurityAdvisoriesCheck loses ->lastDayOfMonth(), which made it skip practically every hourly Oh Dear run.
  • HealthCheckTest now expects the full set.

No P2 changes for this app (no Postmark, no Entra SSO).

Heads-up: the Cloud deploy command of this app has no php artisan optimize, so OptimizedAppCheck will fail in production until it is added.

🤖 Generated with Claude Code

Sebastian BURGIN-FIX (ext) and others added 6 commits October 23, 2026 11:30
Adds the standard health check set agreed for all Laravel Cloud apps:
CacheCheck, OptimizedAppCheck, JobsCheck, FailedJobsCheck,
ProductionConfigCheck (production only), SchedulePolicyCheck and
PendingMigrationsCheck. HealthCheckTest now expects that set instead of
asserting that cache and optimize checks are absent.

SecurityAdvisoriesCheck loses ->lastDayOfMonth(): spatie only runs a
check when its cron is due in the minute of the request, and Oh Dear asks
once an hour, so the check was skipped on practically every run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
All Laravel Cloud apps move to SESSION_DRIVER=database, and this app had no sessions table yet. The migration skips the table if it already exists.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every codebar Laravel app now registers the same checks in the same
order. Checks that do not apply report ok instead of being left out:

- DatabaseCheck, DatabaseConnectionCountCheck (warn > 50, fail > 80),
  JobsCheck, FailedJobsCheck and PendingMigrationsCheck report
  "no database" when config('health.uses_database') is false.
- PostmarkTokenCheck reports ok when the mailer is not postmark.
- EntraClientSecretCheck finds its credentials in microsoft-entra-sso or
  services.microsoft and reports ok when no SSO is configured.
- StorageRoundTripCheck warns instead of failing while the default disk is
  local (a bucket will be added to every app).

StorageRoundTripCheck, EntraClientSecretCheck and PostmarkTokenCheck are
new in this app.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The standard health checks get one test file per class (DatabaseCheck,
DatabaseConnectionCountCheck, DatabaseAvailability) and tests for every
branch, so the coverage gate holds. PendingMigrationsCheck is now tested
against a mocked migrator; DatabaseConnectionCountCheck is no longer final
so its thresholds can be tested without a real connection count.
EntraClientSecretCheck drops the unused configKey() override.
JobsCheck and FailedJobsCheck declare strict types, as the repo's
architecture rule requires for every app file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The check forged the share link by replacing the first signature
character with '0'. Whenever the real signature already started with
'0' (1 in 16 per browser, so about one run in four across the four
browsers) the URL stayed valid and the server rightly answered 200,
failing the test on a different browser each time. The first character
is now flipped to a different value, and the test asserts the URL
changed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@StanBarrows
StanBarrows merged commit b18d469 into production Oct 23, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant