Skip to content

Add PSR-15 liveness and readiness health check handlers.#1

Open
gustavofreze wants to merge 3 commits into
mainfrom
feature/develop
Open

Add PSR-15 liveness and readiness health check handlers.#1
gustavofreze wants to merge 3 commits into
mainfrom
feature/develop

Conversation

@gustavofreze

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings June 16, 2026 01:49
@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a small health-check domain model plus PSR-15 HTTP handlers for liveness/readiness, including optional dependency drivers (Doctrine DBAL and AWS SSM) and a drain-marker short-circuit for graceful shutdown scenarios. It also adds the tiny-blocks-standard repo scaffolding (CI, QA tooling config, documentation, and Claude rules/skills) to support consistent contributions and automated quality gates.

Changes:

  • Add liveness (LivenessHandler) and readiness (ReadinessHandler) PSR-15 handlers with a drain-marker option.
  • Add health-check domain primitives (HealthCheck, HealthChecks, HealthReport, Dependency*, Status, Readiness) plus Doctrine/SSM check implementations.
  • Add unit test coverage and repo tooling/CI/docs scaffolding (PHPUnit/PHPStan/PHPCS/Infection, GitHub workflows, templates, README/SECURITY/CLAUDE).

Reviewed changes

Copilot reviewed 78 out of 81 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tests/Unit/StatusTest.php Adds unit coverage for Status enum helpers.
tests/Unit/SsmHealthCheckTest.php Verifies AWS SSM health check behavior and probe shape.
tests/Unit/ReadinessTest.php Adds unit coverage for Readiness enum helpers.
tests/Unit/ReadinessHandlerTest.php Covers readiness handler response mapping and drain behavior.
tests/Unit/MonotonicClockFake.php Adds a deterministic clock for duration-measurement tests.
tests/Unit/LivenessHandlerTest.php Covers liveness handler response contract.
tests/Unit/HealthTest.php Adds unit coverage for Health factories and predicates.
tests/Unit/HealthReportTest.php Covers report payload formatting and readiness reduction.
tests/Unit/HealthChecksTest.php Covers immutability and aggregation behavior of HealthChecks.
tests/Unit/HealthCheckFake.php Provides a HealthCheck test double for unit tests.
tests/Unit/DrainMarkerTest.php Covers drain marker presence detection.
tests/Unit/DoctrineHealthCheckTest.php Verifies Doctrine DBAL health check behavior and probing.
tests/Unit/DependencyTest.php Covers dependency measurement, metadata, and timing behavior.
tests/Unit/DependencyHealthTest.php Covers failure classification and payload formatting for one dependency.
tests/Unit/DependencyHealthsTest.php Covers readiness reduction across multiple dependency results.
src/Status.php Introduces binary per-check status enum.
src/SsmHealthCheck.php Adds AWS SSM dependency health check.
src/ReadinessHandler.php Adds PSR-15 readiness handler with drain-marker short-circuit.
src/Readiness.php Introduces aggregate readiness enum and helpers.
src/LivenessHandler.php Adds PSR-15 liveness handler returning UP.
src/Internal/Assessment.php Internal runner that measures dependencies and builds a report.
src/HealthReport.php Aggregates dependency results and formats response payload.
src/HealthChecks.php Immutable typed collection of registered dependencies (critical/optional).
src/HealthCheck.php Defines the health-check contract.
src/Health.php Models per-check outcome (Status + optional detail).
src/DrainMarker.php Adds filesystem-based drain signal used by readiness.
src/DoctrineHealthCheck.php Adds Doctrine DBAL dependency health check with optional probe query.
src/DependencyHealths.php Reduces per-dependency results into Readiness.
src/DependencyHealth.php Models one measured dependency result and serializes it.
src/Dependency.php Wraps a check with criticality, measures it, and captures failures.
SECURITY.md Adds security policy and reporting instructions.
README.md Documents library purpose, usage, and payload shape.
phpunit.xml Adds PHPUnit configuration and coverage outputs.
phpstan.neon.dist Adds PHPStan config (level max) with one internal ignore.
phpcs.xml Adds PSR-12 PHPCS ruleset.
Makefile Adds Docker-wrapped dev/test/review commands.
infection.json.dist Adds Infection mutation-testing configuration and thresholds.
composer.json Adds package metadata, dependencies, and standard scripts.
CLAUDE.md Adds contributor/agent workflow and ecosystem conventions index.
.idea/misc.xml Adds IDE-specific project metadata (time tracking).
.idea/.gitignore Adds IDE-local ignore file inside .idea/.
.gitignore Adds repo ignore rules for dependencies, caches, and editor files.
.gitattributes Adds export-ignore rules for Packagist tarball contents.
.editorconfig Adds editor formatting defaults for the repo.
.github/workflows/codeql.yml Adds CodeQL workflow for scheduled/push/PR security checks.
.github/workflows/ci.yml Adds CI workflow running composer review and composer tests.
.github/workflows/auto-assign.yml Adds workflow to auto-assign new issues/PRs.
.github/PULL_REQUEST_TEMPLATE.md Adds standard PR template/checklist.
.github/ISSUE_TEMPLATE/feature_request.md Adds feature request issue template.
.github/ISSUE_TEMPLATE/bug_report.md Adds bug report issue template.
.github/dependabot.yml Adds Dependabot configuration for Composer and Actions.
.github/copilot-instructions.md Adds repo-local Copilot instruction index.
.claude/skills/tiny-blocks-create/SKILL.md Adds scaffolding skill documentation and asset map.
.claude/skills/tiny-blocks-create/assets/github/workflows/ci.yml Adds canonical CI workflow asset.
.claude/skills/tiny-blocks-create/assets/github/PULL_REQUEST_TEMPLATE.md Adds canonical PR template asset.
.claude/skills/tiny-blocks-create/assets/github/ISSUE_TEMPLATE/feature_request.md Adds canonical feature-request template asset.
.claude/skills/tiny-blocks-create/assets/github/ISSUE_TEMPLATE/bug_report.md Adds canonical bug-report template asset.
.claude/skills/tiny-blocks-create/assets/docs/SECURITY.md Adds canonical SECURITY.md asset.
.claude/skills/tiny-blocks-create/assets/config/phpunit.xml Adds canonical PHPUnit config asset.
.claude/skills/tiny-blocks-create/assets/config/phpstan.neon.dist Adds canonical PHPStan config asset.
.claude/skills/tiny-blocks-create/assets/config/phpcs.xml Adds canonical PHPCS config asset.
.claude/skills/tiny-blocks-create/assets/config/Makefile Adds canonical Makefile asset.
.claude/skills/tiny-blocks-create/assets/config/infection.json.dist Adds canonical Infection config asset.
.claude/skills/tiny-blocks-create/assets/config/composer.json Adds canonical composer.json asset template.
.claude/skills/tiny-blocks-create/assets/config/.gitignore Adds canonical .gitignore asset.
.claude/skills/tiny-blocks-create/assets/config/.gitattributes Adds canonical .gitattributes asset.
.claude/skills/tiny-blocks-create/assets/config/.editorconfig Adds canonical .editorconfig asset.
.claude/skills/tiny-blocks-consume/SKILL.md Adds skill to prefer tiny-blocks deps and refresh catalog.
.claude/skills/tiny-blocks-consume/scripts/refresh-catalog.py Adds script to refresh tiny-blocks package catalog.
.claude/skills/tiny-blocks-consume/references/catalog.md Adds cached tiny-blocks package catalog.
.claude/skills/commit-message/SKILL.md Adds Conventional Commits formatting skill doc.
.claude/settings.json Adds Claude settings and hook configuration.
.claude/rules/php-library-tooling.md Adds repo tooling invariants.
.claude/rules/php-library-testing.md Adds PHPUnit/testing conventions.
.claude/rules/php-library-modeling.md Adds modeling/naming/value-object conventions.
.claude/rules/php-library-github-workflows.md Adds GitHub Actions workflow conventions.
.claude/rules/php-library-documentation.md Adds README/docs conventions.
.claude/rules/php-library-architecture.md Adds folder/public API boundary conventions.
.claude/hooks/php-prose-punctuation-conformance.py Adds prose punctuation conformance hook.
.claude/hooks/php-ordering-conformance.py Adds PHP declaration ordering conformance hook.
Files not reviewed (2)
  • .idea/.gitignore: Generated file
  • .idea/misc.xml: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/DrainMarker.php Outdated
Comment thread .gitattributes
Comment thread Makefile
Comment thread .github/workflows/codeql.yml
Comment thread .idea/misc.xml Outdated
Comment thread src/Dependency.php
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.

3 participants