Repository navigation
feat: schema switches, schema-shape file and drift detection (phase 2b) - #6
Merged
Merged
Conversation
Add the non-default value of every schema switch (identity modes, uuid/ulid keys, typed owner keys, dedicated stores, soft deletes with restore-on-set, JSON translations, the definitions table), record the produced shape in database/settings-schema.php and read it instead of live config, and report drift in doctor. Add a pairwise switch matrix (10 shapes, 141 pairs) on SQLite/MySQL/Postgres and a weekly full product, audit queries via $settings->audit(), a single retry for plain set() after a conflict, the prune ability, and readiness flushes on tenancy events.
Comment on lines
+85
to
+107
| name: Schema switches · full product | ||
| if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 20 | ||
| env: | ||
| LARANAIL_SETTINGS_MATRIX: full | ||
| COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.GITHUB_TOKEN }}"}}' | ||
| steps: | ||
| - uses: actions/checkout@v7 | ||
|
|
||
| - name: Setup PHP 8.4 | ||
| uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # 2.40.0 | ||
| with: | ||
| php-version: '8.4' | ||
| extensions: dom, curl, libxml, mbstring, zip, fileinfo, pdo, sqlite3, pdo_sqlite | ||
| coverage: none | ||
| tools: composer:v2 | ||
|
|
||
| - name: Install dependencies | ||
| run: composer update --prefer-dist --no-interaction --no-progress | ||
|
|
||
| - name: Run the full switch matrix | ||
| run: vendor/bin/pest --group=matrix |
Both were generated by make-store test runs during phase 2 and committed by mistake in 1dba487; nothing references them.
Laravel appends fluent indexes after every other command, so with uuid or ulid ids PostgreSQL saw the parent_id foreign key before the primary key it references (SQLSTATE 42830). The audit and prune tests no longer write non-JSON into a json column or compare JSON text byte for byte, which MySQL and PostgreSQL do not preserve.
Phase 2b's end-to-end matrix covers almost every line, so every mutant re-ran it and the job hit its 45-minute limit. The shapes stay tested in the Tests workflow; the limit rises to 60 minutes.
Whole-package mutation passed 45 minutes once phase 2b landed. Pull requests now mutate the src/ files they add or modify (in parallel, 15-minute limit); the full run moves to a weekly schedule and manual dispatch.
…rocesses A pull request touching 35 src files produced 2,572 mutants and still passed 15 minutes on Xdebug with four processes. PCOV collects coverage several times faster, and restoring Pest's per-mutant cache means a re-run only tests what changed.
…tation With eight processes, one worker's install test deleted config/laranail/settings.php while another was booting. Those tests are grouped shared-app and run in the sequential Tests workflow.
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.
Summary
Phase 2b of the settings design: every schema switch, the schema-shape file, and the Phase 2 follow-ups.
slug_per_row/uid_only;ids.typeuuid / ulid (following db-tools unless set) and typed owner keys; dedicated stores with a fallback store; table prefix and per-table names; the optionalsettings_definitionstable withsync-definitions; JSON translations; soft deletes with restore-on-set, for stores and categories.database/settings-schema.phprecords the shape install produced; migrations and the runtime read it, anddoctorreports drift against it.$settings->audit()with filters, cursor and paging, gated byview_audit.set()retries once after a write conflict (writes.retry_on_conflict); version-named writes never retry.pruneability and audited; schema readiness flushes on stancl/tenancy and spatie/laravel-multitenancy tenant events (by event name, no dependency).Checks run locally