Add initial implementation of the Outbox pattern with database integration and serializers.#1
Merged
Merged
Conversation
…integration and serializers.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
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:
For more information about GitHub Code Scanning, check out the documentation. |
There was a problem hiding this comment.
Pull request overview
Introduces the first end-to-end implementation of a transactional outbox write-side adapter for the tiny-blocks ecosystem, including Doctrine DBAL persistence, configurable schema layout, payload/snapshot serialization, and a comprehensive test/tooling setup.
Changes:
- Adds
DoctrineOutboxRepositoryplus supporting schema, SQL-building, and exception types for persisting outbox records inside an existing transaction. - Introduces payload and snapshot serialization abstractions (including reflection-based defaults) with JSON validation.
- Adds integration/unit tests (including Docker-backed MySQL) plus CI/static-analysis configuration and expanded README documentation.
Reviewed changes
Copilot reviewed 65 out of 66 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/OutboxTableFactory.php | Test helper to create outbox tables for integration tests. |
| tests/Models/RefundIssued.php | Test domain event fixture. |
| tests/Models/OrderPlaced.php | Test domain event fixture. |
| tests/Models/OrderId.php | Test aggregate identity fixture. |
| tests/Models/Order.php | Test aggregate fixture producing events/snapshots. |
| tests/Models/EventRecordFactory.php | Test factory for building deterministic EventRecords. |
| tests/Mocks/RefundIssuedSerializer.php | Test payload serializer for refund events. |
| tests/Mocks/OrderPlacedSerializer.php | Test payload serializer for order events. |
| tests/Mocks/InvalidSnapshotSerializer.php | Test snapshot serializer producing invalid JSON. |
| tests/Mocks/InvalidPayloadSerializer.php | Test payload serializer producing invalid JSON. |
| tests/Mocks/InMemoryOutboxRepositoryMock.php | In-memory outbox repository test double. |
| tests/Mocks/FallbackOrderPlacedSerializer.php | Secondary serializer used to test “first match wins”. |
| tests/Mocks/DriverExceptionStub.php | Test stub for DBAL driver exception plumbing. |
| tests/Mocks/CustomOrderSnapshotSerializer.php | Test snapshot serializer producing custom JSON. |
| tests/IntegrationTestCase.php | Base class for DB-backed integration tests with cleanup. |
| tests/InMemoryOutboxRepositoryTest.php | Unit tests for in-memory repository behavior. |
| tests/DoctrineOutboxRepositoryTest.php | Integration + unit-style tests for Doctrine repository behavior. |
| tests/Database.php | Docker-based MySQL test database bootstrap. |
| tests/bootstrap.php | PHPUnit bootstrap that starts the database container. |
| src/Serialization/SnapshotSerializers.php | Collection wrapper to locate snapshot serializers. |
| src/Serialization/SnapshotSerializerReflection.php | Default reflection snapshot serializer. |
| src/Serialization/SnapshotSerializer.php | Snapshot serializer interface. |
| src/Serialization/SerializedSnapshot.php | Value object for validated snapshot JSON. |
| src/Serialization/SerializedPayload.php | Value object for validated payload JSON. |
| src/Serialization/PayloadSerializers.php | Collection wrapper to locate payload serializers. |
| src/Serialization/PayloadSerializerReflection.php | Default reflection payload serializer. |
| src/Serialization/PayloadSerializer.php | Payload serializer interface. |
| src/Schema/UniqueConstraint.php | Encapsulates configured unique constraint name detection. |
| src/Schema/TableLayout.php | Public schema configuration object (table/columns/constraint). |
| src/Schema/IdentityColumnType.php | Enum for BINARY vs STRING identity storage. |
| src/Schema/Columns.php | Column-name configuration object. |
| src/OutboxRepository.php | Public outbox repository contract. |
| src/Internal/TableLayoutBuilder.php | Internal builder for TableLayout. |
| src/Internal/StringIdentityColumn.php | Converts identities to string for SQL bindings. |
| src/Internal/OutboxInsert.php | Builds INSERT SQL + parameter bindings from a record. |
| src/Internal/IdentityColumn.php | Base identity-column abstraction. |
| src/Internal/ColumnsBuilder.php | Internal builder for Columns. |
| src/Internal/BinaryIdentityColumn.php | Converts UUID strings to 16-byte binary. |
| src/Exceptions/SnapshotSerializerNotConfigured.php | Public exception for missing snapshot serializer. |
| src/Exceptions/PayloadSerializerNotConfigured.php | Public exception for missing payload serializer. |
| src/Exceptions/OutboxRequiresActiveTransaction.php | Public exception for missing active transaction. |
| src/Exceptions/InvalidSnapshotJson.php | Public exception for invalid snapshot JSON. |
| src/Exceptions/InvalidPayloadJson.php | Public exception for invalid payload JSON. |
| src/Exceptions/DuplicateOutboxEvent.php | Public exception for duplicate event id insertion. |
| src/Exceptions/DuplicateAggregateSequence.php | Public exception for duplicate aggregate sequence insertion. |
| src/DoctrineOutboxRepository.php | Doctrine DBAL-backed OutboxRepository implementation. |
| README.md | Full library documentation and usage examples. |
| phpunit.xml | PHPUnit configuration with coverage outputs. |
| phpstan.neon.dist | PHPStan configuration (level 9). |
| Makefile | Dev/test/review helper targets via Docker. |
| infection.json.dist | Infection mutation testing configuration. |
| composer.json | Package metadata, deps, and scripts. |
| .gitignore | Ignores vendor, reports, caches, IDE dirs. |
| .github/workflows/codeql.yml | CodeQL security workflow configuration. |
| .github/workflows/ci.yml | CI pipeline for install, review, and tests. |
| .github/workflows/auto-assign.yml | Auto-assign workflow for issues/PRs. |
| .github/dependabot.yml | Dependabot configuration for Composer and Actions. |
| .github/copilot-instructions.md | Repository Copilot instruction pointer. |
| .gitattributes | Export-ignore rules for Packagist tarball. |
| .editorconfig | Editor configuration for consistent formatting. |
| .claude/rules/php-library-testing.md | Testing conventions (BDD structure, PHPUnit rules). |
| .claude/rules/php-library-modeling.md | Library modeling/public API boundary rules. |
| .claude/rules/php-library-documentation.md | Documentation standards for README and docs. |
| .claude/rules/php-library-code-style.md | Project-wide PHP code style and design rules. |
| .claude/rules/github-workflows.md | GitHub Actions workflow standards for this repo. |
| .claude/CLAUDE.md | High-level project conventions and command list. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.